- NSEStockScanner is a python script made to analyse NSE tickers on a technical basis currently.
- FundamentalAnalysis module and AIPrediction module will be added on a later stage.
- Install required modules using
pip install -r requirements.txt
- Use
DataFetcher
class fromDataFetcher.py
to fetch data.
DataFetcher.py
can be used for fetching data from the NSE website and storing it intoStockData
directory- The fetched data is cleaned by
DataLoader
when loaded - It contains the following columns for each ticker.
- [
open
,high
,low
,prevclose
,ltp
,close
,vwap
,52wh
,52wl
,volume
,value
,nooftrades
]
- [
- The data is indexed by the date. All the above columns can be used directly in the signal configurations in place of the fields.
- After following the above steps, create a new config file or use the pre-existing one stored in
configs
directory. - Edit the
analysis.py
file as per your use.
- Config directory has various scripts containing description of the indicator and the technical indications to be used. The general format along with fields is described below
- Generally, one can store 2 different sections for each configuration -
DataConfig
andTickerConfig
- It contains information about the indicators to be added in the dataframe before analysis
- It requires a
field
tag containing a valid data columns described above. - It supports following 5 indicators currently
EMA
: Exponential Moving Average- Input: List of periods. Ex:
EMA
: [13, 52] - It can be accessed as
EMA13
orEMA52
- Input: List of periods. Ex:
SMA
: Simple Moving Average- Input: List of periods. Ex:
SMA
: [200] - It can be accessed as
SMA200
- Input: List of periods. Ex:
RSI
: Relative Strength Index- Input: RSI Period. Ex:
RSI
: 14 - It can be accessed as
RSI
- Input: RSI Period. Ex:
BB
: Bollinger Bands- Input: Dictionary with
ma
field representing Moving Average time andstddev
field representing StdDeviation period - It can be accessed as
BBUpper
,BBMedian
,BBLower
,BBNeck%
- Input: Dictionary with
StochRSI
: Stochastic RSI- Input: Boolean
- It can be accessed as
StochRSI
MACD
: Moving Average Convergence Divergence- Input: dict with
fast
,slow
andsignal
period - It can be accessed as
macd
,macd_histogram
,macd_signal
- Input: dict with
OBV
: On Balance Volume- Input: Boolean
- It can be accessed as
obv
EWO
: Elliot Wave Oscillator- Input: Boolean
- It can be accessed as
ewo
- It contains description of the signals for analysis.
- It requires
name
andrequiredDataLength
field.requiredDataLength
represents the minimum required data for analysis cutoff
field is auto evaluated based on thescore
provided in the confirmations, indicators and conditions. It can also be passed manually. Only symbols withSeverity
abovecutoff
will be present in the final recommendation.- The configuration is divided into 3 sections
conditions
: Represents signals that must be valid before analysisindicators
: Represents signals that indicate bullish movements.Atleast
one indicator needs to be true for the ticker to pop up in final recommendationconfirmations
: Represents signals that acts as a confimation.
- Each signal is passed as a dictionary or a list of dictionary. Each dictionary must contain the following fields. List of dictionary will be
and
ed while evaluationtype
: Type of signal out of the below available typescolor
: Color indicates sentiment for the signal ranging from -3 to +3, where +3 = GREEN and -3 = RED. 0 = Information (Neutral)score
: Score represents importance of this indicator, higher the importance more it contributes to the finalSeverity
of the symbol.
- Currently, following signals types are supported along with their required parameters,
comparePlus
: Signals true iffield1
is higher thanfield2
in the last candle- Required fields -
field1:(str | num)
andfield2:(str | num)
- Required fields -
compareMinus
: Signals true iffield1
is lower thanfield2
in the last candle- Required fields -
field1:(str | num)
andfield2:(str | num)
- Required fields -
rangePlus
: Signals true iffield1 >= field2
for the givenperiod
- Required fields -
field1:(str | num)
,field2:(str | num)
andperiod:int
- Required fields -
rangeMinus
: Signals true iffield1 <= field2
for the givenperiod
- Required fields -
field1:(str | num):
,field2:(str | num)
andperiod:int
- Required fields -
lastCrossOver
: Signals true iffield1
crossedfield2
in the givenperiod
- Required fields -
field1:str
,field2:str
andperiod:int
- Required fields -
rising
: Signals true iffield
is not decreasing for the givenperiod
- Required fields -
field:str
andperiod:int
- Required fields -
falling
: Signals true iffield
is not increasing for the givenperiod
- Required fields -
field:str
andperiod:int
- Required fields -
crossedFromAbove
: Signals true iffield1
crossedfield2
from above in the givenperiod
.- Required fields -
field1:(str | num)
,field2:(str | num)
andperiod:int
- Required fields -
crossedFromBelow
: Signals true iffield1
crossedfield2
from below in the givenperiod
.- Required fields -
field1:(str | num)
,field2:(str | num)
andperiod:int
- Required fields -
bullishDivergence
: Signals true iffield1
andfield2
had bullish divergence in the givenperiod
.- Required fields -
field1:str
,field2:str
andperiod:int
- Required fields -
bearishDivergence
: Signals true iffield1
andfield2
had bearish divergence in the givenperiod
.- Required fields -
field1:str
,field2:str
andperiod:int
- Required fields -
- Please contact
rudrad200@gmail.com
before starting. - The main aim of this project is to create customizable and fast scripts to print and analyse various tickers.
- Other ideas are always welcome.