

Use a DataFetcher to download stock data.Scanner - an interface for the "main engine" of the scan.Ī general outline of the use of these interfaces could look as such:.Validator - an interface for deciding whether a stock should be returned as a candidate from the scan or not, given the conditions it fulfills.Condition - an interface for checking whether a stock fulfills a condition.

DataReader - an interface for reading stock data files.DataFetcher - an interface for downloading stock data and saving it locally.To achieve this goal of modularity, the framework has a few different interfaces you need to implement when writing your own extensions. getCandidates () ) print ( list ( map ( lambda x : x.

max_close * 0.97 ) print ( "Looking for consolidated stocks." ) data_fetcher = YahooDataFetcher ( universe, path ) conditions = candidates = ( BasicScanner ( conditions, data_fetcher ). min () except Inde圎rror : return False def fulfilled ( self ) -> bool : """ If the difference between them is less than 3% we consider the stock consolidated """ return self. _init_ ( stock ) # We will look from the last close to 10 days back window = 10 try : # Find the max and min closes in this window self. Using a pre-written Condition: from stock_screener import Stock from stock_screener.scanner import BasicScanner from stock_150And200SMA import Above150And200SMA from stock_screener.data_fetcher import YahooDataFetcher universe = 'nasdaq' path = f './ ' # Has the stock consolidated? class Consolidating ( Condition ): def _init_ ( self, stock : Stock ) -> None : """ Always call super in the constructor. The goal is for it to be a sort of framework which easily lets users swap different modules at their own discretion. Stock-scanner is a Python3 package aimed at facilitating the rapid development of custom stock scanners/screeners.
