├── __init__.py ├── common ├── __init__.py ├── optimize_supertrend.py ├── __pycache__ │ ├── __init__.cpython-38.pyc │ ├── __init__.cpython-39.pyc │ ├── message.cpython-38.pyc │ ├── message.cpython-39.pyc │ ├── zipline.cpython-38.pyc │ ├── indicator.cpython-38.pyc │ ├── indicator.cpython-39.pyc │ ├── backtestingsuper.cpython-38.pyc │ ├── stock_selection_features_volume.py │ └── find_stock_supertrend_values.py ├── bundle.py ├── topgainers.py ├── message.py ├── pyalgotradesample.py ├── backtestingpy.py ├── backtestingmacd.py ├── backtestingrsi.py ├── backtestsupertrendrsi.py ├── supertrendadx.py ├── bot.py ├── backtestesidewayssupertrend.py ├── stock_selection_features_volume.py ├── find_supertrend_thread.py ├── stock_selection_nifty200_volume.py ├── stock_selection_features_atr.py ├── backtest_macd.py ├── backtestsuperrsi.py ├── backtestsupersma.py ├── find_stock_supertrend_values_shortterm.py ├── backtestingsuper.py ├── find_supertrend_reverse.py ├── find_stock_supertrend_values.py └── indicator.py ├── fyers ├── __init__.py ├── login_fyers.py ├── stoploss_percentage.py ├── cred.csv ├── __pycache__ │ ├── live.cpython-38.pyc │ ├── login.cpython-38.pyc │ ├── order.cpython-38.pyc │ ├── quote.cpython-38.pyc │ ├── script.cpython-38.pyc │ ├── __init__.cpython-38.pyc │ ├── __init__.cpython-39.pyc │ ├── database.cpython-38.pyc │ ├── history.cpython-38.pyc │ ├── telegram.cpython-38.pyc │ ├── login_fyers.cpython-38.pyc │ ├── accounts_login.cpython-38.pyc │ ├── look_database.cpython-38.pyc │ ├── insert_database.cpython-38.pyc │ ├── insert_database.cpython-39.pyc │ └── stoploss_percentage.cpython-38.pyc ├── quote.py ├── broker_allow_stocks.py ├── accounts_login.py ├── intraday_allow_check.py ├── script.py ├── look_database.py ├── history.py ├── database.py ├── live.py ├── accounts_database.py ├── insert_database.py ├── order.py ├── login.py └── strategy.py ├── databasestart.txt ├── supertrend_txt ├── GNFC.txt ├── PVR.txt ├── TCS.txt ├── TWL.txt ├── ABFRL.txt ├── ALOKINDS.txt ├── BEML.txt ├── BOROLTD.txt ├── BPCL.txt ├── CANBK.txt ├── ECLERX.txt ├── GLAXO.txt ├── HDFCLIFE.txt ├── INDHOTEL.txt ├── INDIACEM.txt ├── LAOPALA.txt ├── MINDAIND.txt ├── POLYPLEX.txt ├── RBLBANK.txt ├── SEQUENT.txt ├── SUNTECK.txt ├── TCIEXP.txt ├── TTML.txt ├── WIPRO.txt ├── ZEEL.txt ├── ZEELEARN.txt ├── 20MICRONS.txt ├── ABCAPITAL.txt ├── APOLSINHOT.txt ├── BAJAJELEC.txt ├── BALRAMCHIN.txt ├── BANDHANBNK.txt ├── BANKBARODA.txt ├── CARBORUNIV.txt ├── CHAMBLFERT.txt ├── HINDCOPPER.txt ├── HINDPETRO.txt ├── ICICIBANK.txt ├── INDUSTOWER.txt ├── NETWORK18.txt ├── OBEROIRLTY.txt ├── POONAWALLA.txt ├── REDINGTON.txt ├── TATAMOTORS.txt ├── TV18BRDCST.txt └── WELSPUNIND.txt ├── supertrend_values.txt ├── supertrend_values_default.txt ├── stock_selection.txt ├── test_session123123123.session ├── __pycache__ ├── login_fyers.cpython-38.pyc ├── create_database.cpython-38.pyc └── zerodha_own_api.cpython-38.pyc ├── LICENSE ├── check_database.py ├── README.md ├── accounts_database.py └── Fyers - Scrips blocked for Intraday trading - Equity.csv /__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fyers/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /databasestart.txt: -------------------------------------------------------------------------------- 1 | False -------------------------------------------------------------------------------- /supertrend_txt/GNFC.txt: -------------------------------------------------------------------------------- 1 | 41 2 | 7.6 -------------------------------------------------------------------------------- /supertrend_txt/PVR.txt: -------------------------------------------------------------------------------- 1 | 650 2 | 6.8 -------------------------------------------------------------------------------- /supertrend_txt/TCS.txt: -------------------------------------------------------------------------------- 1 | 899 2 | 7.5 -------------------------------------------------------------------------------- /supertrend_txt/TWL.txt: -------------------------------------------------------------------------------- 1 | 61 2 | 6.5 -------------------------------------------------------------------------------- /supertrend_values.txt: -------------------------------------------------------------------------------- 1 | 354 2 | 5.0 -------------------------------------------------------------------------------- /supertrend_txt/ABFRL.txt: -------------------------------------------------------------------------------- 1 | 160 2 | 6.9 -------------------------------------------------------------------------------- /supertrend_txt/ALOKINDS.txt: -------------------------------------------------------------------------------- 1 | 678 2 | 7.6 -------------------------------------------------------------------------------- /supertrend_txt/BEML.txt: -------------------------------------------------------------------------------- 1 | 233 2 | 5.6 -------------------------------------------------------------------------------- /supertrend_txt/BOROLTD.txt: -------------------------------------------------------------------------------- 1 | 455 2 | 5.9 -------------------------------------------------------------------------------- /supertrend_txt/BPCL.txt: -------------------------------------------------------------------------------- 1 | 354 2 | 5.0 -------------------------------------------------------------------------------- /supertrend_txt/CANBK.txt: -------------------------------------------------------------------------------- 1 | 772 2 | 5.1 -------------------------------------------------------------------------------- /supertrend_txt/ECLERX.txt: -------------------------------------------------------------------------------- 1 | 106 2 | 7.1 -------------------------------------------------------------------------------- /supertrend_txt/GLAXO.txt: -------------------------------------------------------------------------------- 1 | 584 2 | 7.9 -------------------------------------------------------------------------------- /supertrend_txt/HDFCLIFE.txt: -------------------------------------------------------------------------------- 1 | 343 2 | 4.9 -------------------------------------------------------------------------------- /supertrend_txt/INDHOTEL.txt: -------------------------------------------------------------------------------- 1 | 890 2 | 3.5 -------------------------------------------------------------------------------- /supertrend_txt/INDIACEM.txt: -------------------------------------------------------------------------------- 1 | 215 2 | 6.4 -------------------------------------------------------------------------------- /supertrend_txt/LAOPALA.txt: -------------------------------------------------------------------------------- 1 | 803 2 | 5.3 -------------------------------------------------------------------------------- /supertrend_txt/MINDAIND.txt: -------------------------------------------------------------------------------- 1 | 393 2 | 7.6 -------------------------------------------------------------------------------- /supertrend_txt/POLYPLEX.txt: -------------------------------------------------------------------------------- 1 | 42 2 | 6.1 -------------------------------------------------------------------------------- /supertrend_txt/RBLBANK.txt: -------------------------------------------------------------------------------- 1 | 632 2 | 7.9 -------------------------------------------------------------------------------- /supertrend_txt/SEQUENT.txt: -------------------------------------------------------------------------------- 1 | 413 2 | 6.2 -------------------------------------------------------------------------------- /supertrend_txt/SUNTECK.txt: -------------------------------------------------------------------------------- 1 | 928 2 | 5.9 -------------------------------------------------------------------------------- /supertrend_txt/TCIEXP.txt: -------------------------------------------------------------------------------- 1 | 60 2 | 6.2 -------------------------------------------------------------------------------- /supertrend_txt/TTML.txt: -------------------------------------------------------------------------------- 1 | 889 2 | 5.3 -------------------------------------------------------------------------------- /supertrend_txt/WIPRO.txt: -------------------------------------------------------------------------------- 1 | 78 2 | 5.5 -------------------------------------------------------------------------------- /supertrend_txt/ZEEL.txt: -------------------------------------------------------------------------------- 1 | 166 2 | 6.3 -------------------------------------------------------------------------------- /supertrend_txt/ZEELEARN.txt: -------------------------------------------------------------------------------- 1 | 166 2 | 6.3 -------------------------------------------------------------------------------- /supertrend_txt/20MICRONS.txt: -------------------------------------------------------------------------------- 1 | 117 2 | 5.3 -------------------------------------------------------------------------------- /supertrend_txt/ABCAPITAL.txt: -------------------------------------------------------------------------------- 1 | 904 2 | 5.4 -------------------------------------------------------------------------------- /supertrend_txt/APOLSINHOT.txt: -------------------------------------------------------------------------------- 1 | 998 2 | 7.6 -------------------------------------------------------------------------------- /supertrend_txt/BAJAJELEC.txt: -------------------------------------------------------------------------------- 1 | 736 2 | 5.1 -------------------------------------------------------------------------------- /supertrend_txt/BALRAMCHIN.txt: -------------------------------------------------------------------------------- 1 | 72 2 | 5.9 -------------------------------------------------------------------------------- /supertrend_txt/BANDHANBNK.txt: -------------------------------------------------------------------------------- 1 | 960 2 | 5.5 -------------------------------------------------------------------------------- /supertrend_txt/BANKBARODA.txt: -------------------------------------------------------------------------------- 1 | 704 2 | 6.6 -------------------------------------------------------------------------------- /supertrend_txt/CARBORUNIV.txt: -------------------------------------------------------------------------------- 1 | 602 2 | 6.6 -------------------------------------------------------------------------------- /supertrend_txt/CHAMBLFERT.txt: -------------------------------------------------------------------------------- 1 | 127 2 | 5.0 -------------------------------------------------------------------------------- /supertrend_txt/HINDCOPPER.txt: -------------------------------------------------------------------------------- 1 | 523 2 | 5.7 -------------------------------------------------------------------------------- /supertrend_txt/HINDPETRO.txt: -------------------------------------------------------------------------------- 1 | 995 2 | 4.9 -------------------------------------------------------------------------------- /supertrend_txt/ICICIBANK.txt: -------------------------------------------------------------------------------- 1 | 963 2 | 4.5 -------------------------------------------------------------------------------- /supertrend_txt/INDUSTOWER.txt: -------------------------------------------------------------------------------- 1 | 169 2 | 7.4 -------------------------------------------------------------------------------- /supertrend_txt/NETWORK18.txt: -------------------------------------------------------------------------------- 1 | 187 2 | 7.5 -------------------------------------------------------------------------------- /supertrend_txt/OBEROIRLTY.txt: -------------------------------------------------------------------------------- 1 | 945 2 | 5.9 -------------------------------------------------------------------------------- /supertrend_txt/POONAWALLA.txt: -------------------------------------------------------------------------------- 1 | 772 2 | 6.9 -------------------------------------------------------------------------------- /supertrend_txt/REDINGTON.txt: -------------------------------------------------------------------------------- 1 | 631 2 | 5.0 -------------------------------------------------------------------------------- /supertrend_txt/TATAMOTORS.txt: -------------------------------------------------------------------------------- 1 | 876 2 | 3.4 -------------------------------------------------------------------------------- /supertrend_txt/TV18BRDCST.txt: -------------------------------------------------------------------------------- 1 | 91 2 | 7.7 -------------------------------------------------------------------------------- /supertrend_txt/WELSPUNIND.txt: -------------------------------------------------------------------------------- 1 | 474 2 | 6.1 -------------------------------------------------------------------------------- /supertrend_values_default.txt: -------------------------------------------------------------------------------- 1 | 80 2 | 3.6 3 | -------------------------------------------------------------------------------- /stock_selection.txt: -------------------------------------------------------------------------------- 1 | BPCL 2 | HDFC 3 | HINDPETRO 4 | BDL 5 | JUBLFOOD 6 | AAVAS 7 | 8 | -------------------------------------------------------------------------------- /fyers/login_fyers.py: -------------------------------------------------------------------------------- 1 | from fyers.accounts_login import login_accounts 2 | accounts=login_accounts() -------------------------------------------------------------------------------- /fyers/stoploss_percentage.py: -------------------------------------------------------------------------------- 1 | def percentage(num,percentage): 2 | return round((num*percentage)/100) -------------------------------------------------------------------------------- /test_session123123123.session: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/test_session123123123.session -------------------------------------------------------------------------------- /fyers/cred.csv: -------------------------------------------------------------------------------- 1 | user_name 2 | XK04412 3 | password 4 | pancard_number 5 | fyers_api_id 6 | fyers_key 7 | http://127.0.0.2/ #redirect url for fyers 8 | -------------------------------------------------------------------------------- /common/optimize_supertrend.py: -------------------------------------------------------------------------------- 1 | from common.backtestingsuper import * 2 | a=test() 3 | open('optimized_supertrend_for_nifty.txt','w').write(f'{a[0]}\n{a[1]}') -------------------------------------------------------------------------------- /fyers/__pycache__/live.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/fyers/__pycache__/live.cpython-38.pyc -------------------------------------------------------------------------------- /__pycache__/login_fyers.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/__pycache__/login_fyers.cpython-38.pyc -------------------------------------------------------------------------------- /fyers/__pycache__/login.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/fyers/__pycache__/login.cpython-38.pyc -------------------------------------------------------------------------------- /fyers/__pycache__/order.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/fyers/__pycache__/order.cpython-38.pyc -------------------------------------------------------------------------------- /fyers/__pycache__/quote.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/fyers/__pycache__/quote.cpython-38.pyc -------------------------------------------------------------------------------- /fyers/__pycache__/script.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/fyers/__pycache__/script.cpython-38.pyc -------------------------------------------------------------------------------- /__pycache__/create_database.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/__pycache__/create_database.cpython-38.pyc -------------------------------------------------------------------------------- /__pycache__/zerodha_own_api.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/__pycache__/zerodha_own_api.cpython-38.pyc -------------------------------------------------------------------------------- /common/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/common/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /common/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/common/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /common/__pycache__/message.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/common/__pycache__/message.cpython-38.pyc -------------------------------------------------------------------------------- /common/__pycache__/message.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/common/__pycache__/message.cpython-39.pyc -------------------------------------------------------------------------------- /common/__pycache__/zipline.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/common/__pycache__/zipline.cpython-38.pyc -------------------------------------------------------------------------------- /fyers/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/fyers/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /fyers/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/fyers/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /fyers/__pycache__/database.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/fyers/__pycache__/database.cpython-38.pyc -------------------------------------------------------------------------------- /fyers/__pycache__/history.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/fyers/__pycache__/history.cpython-38.pyc -------------------------------------------------------------------------------- /fyers/__pycache__/telegram.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/fyers/__pycache__/telegram.cpython-38.pyc -------------------------------------------------------------------------------- /common/__pycache__/indicator.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/common/__pycache__/indicator.cpython-38.pyc -------------------------------------------------------------------------------- /common/__pycache__/indicator.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/common/__pycache__/indicator.cpython-39.pyc -------------------------------------------------------------------------------- /fyers/__pycache__/login_fyers.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/fyers/__pycache__/login_fyers.cpython-38.pyc -------------------------------------------------------------------------------- /fyers/__pycache__/accounts_login.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/fyers/__pycache__/accounts_login.cpython-38.pyc -------------------------------------------------------------------------------- /fyers/__pycache__/look_database.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/fyers/__pycache__/look_database.cpython-38.pyc -------------------------------------------------------------------------------- /fyers/__pycache__/insert_database.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/fyers/__pycache__/insert_database.cpython-38.pyc -------------------------------------------------------------------------------- /fyers/__pycache__/insert_database.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/fyers/__pycache__/insert_database.cpython-39.pyc -------------------------------------------------------------------------------- /common/__pycache__/backtestingsuper.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/common/__pycache__/backtestingsuper.cpython-38.pyc -------------------------------------------------------------------------------- /fyers/__pycache__/stoploss_percentage.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srikar-kodakandla/algo-trading-using-fyers-broker-api/HEAD/fyers/__pycache__/stoploss_percentage.cpython-38.pyc -------------------------------------------------------------------------------- /fyers/quote.py: -------------------------------------------------------------------------------- 1 | from fyers.script import name_to_script 2 | class quote: 3 | def __init__(self,fyers): 4 | self.fyers=fyers.fyers 5 | def quote(self,stock_name): 6 | stock_name=name_to_script(stock_name) 7 | data=data = {"symbols":stock_name} 8 | return self.fyers.quotes(data)['d'][0]['v']['cmd']['o'] -------------------------------------------------------------------------------- /common/bundle.py: -------------------------------------------------------------------------------- 1 | 2 | from zipline.data.bundles import register 3 | from zipline.data.bundles.csvdir import csvdir_equities 4 | register( 5 | 'custom-csvdir-bundle', 6 | csvdir_equities( 7 | ['daily'], 8 | '/home/ubuntu/Downloads/nifty_10min_data.csv', 9 | ), 10 | calendar_name='nifty', # US equities 11 | #start_session=start_session, 12 | #end_session=end_session 13 | ) -------------------------------------------------------------------------------- /fyers/broker_allow_stocks.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | data=pd.read_csv('Fyers - Scrips blocked for Intraday trading - Equity.csv') 3 | data=data['List of Scrips blocked for Intraday trading'] 4 | data=data.tolist() 5 | def allow(a,data=data): 6 | allowed=[] 7 | not_allowed=[] 8 | for i in a: 9 | if i not in data: 10 | allowed.append(i) 11 | else: 12 | not_allowed.append(i) 13 | 14 | return allowed 15 | 16 | 17 | -------------------------------------------------------------------------------- /fyers/accounts_login.py: -------------------------------------------------------------------------------- 1 | from fyers.login import login 2 | import pandas as pd 3 | try: 4 | h=pd.read_csv(('fyers/cred.csv')) 5 | except : 6 | h = pd.read_csv(('cred.csv')) 7 | accounts=[] 8 | def login_accounts(h=h): 9 | u=[] 10 | for i in h: 11 | accounts.append(login(h[i])) 12 | u.append(i) 13 | for i in range(len(accounts)): 14 | try: 15 | accounts[i].login(u[i]) 16 | except Exception as error: 17 | print(f'There is an error in login {error}') 18 | return accounts 19 | 20 | 21 | -------------------------------------------------------------------------------- /common/topgainers.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pandas as pd 3 | n=0 4 | y=0 5 | m=-4 6 | for k in range(68,1,-1): 7 | n=10000 8 | m=m+1 9 | for i in os.listdir('data'): 10 | try: 11 | d=pd.read_csv('data/'+i) 12 | d['pc']=((d['close']-d['open'])/d['open'])*100 13 | #d=d.sort_values(by='pc',ascending=False) 14 | c=d['pc'].iloc[k] 15 | d['name']=i[:-4] 16 | #d['name'][0] 17 | if n>c: 18 | n=c 19 | d.to_csv(f'toploosers/{m}.csv') 20 | print(y) 21 | print(d['name'][0]) 22 | y+=1 23 | except Exception as error: 24 | print(error) 25 | -------------------------------------------------------------------------------- /fyers/intraday_allow_check.py: -------------------------------------------------------------------------------- 1 | import gspread 2 | sa=gspread.service_account(filename='/home/ubuntu/google.json') 3 | #sh=sa.open('Fyers - Scrips blocked for Intraday trading') 4 | #sa.list_spreadsheet_files() 5 | sh=sa.open_by_url('https://docs.google.com/spreadsheets/d/1ZCB9rhyTkGwGIAI8G5MO9fKcO8K_82TPaSlibQkVTzU/edit#gid=0') 6 | #sh.sheet1.get() 7 | import pandas as pd 8 | data=pd.DataFrame(sh.sheet1.get()) 9 | blocked_stocks=data[0].tolist() 10 | stocks=open('/home/ubuntu/pycharmprojects/tradeautomation/stock_selection.txt').read().split('\n') 11 | allowed_stocks=[] 12 | for i in stocks: 13 | if i.upper() in blocked_stocks: 14 | print(i) 15 | else: 16 | allowed_stocks.append(i) 17 | u=str() 18 | for i in allowed_stocks: 19 | u+=str(i) 20 | u=u+'\n' 21 | open('/home/ubuntu/pycharmprojects/tradeautomation/stock_selection.txt','w').write(u) 22 | from common.message import message 23 | message(f'Fyers allowed stocks for tomorrow trading : {allowed_stocks}') 24 | print(*allowed_stocks,sep=',') -------------------------------------------------------------------------------- /common/message.py: -------------------------------------------------------------------------------- 1 | from termcolor import colored 2 | def message(a): 3 | #''.center(100,'*') 4 | #print(a) 5 | print() 6 | print (colored(a, 'green')) 7 | try: 8 | #import telepot 9 | import telegram_send 10 | #telegram_send.send(messages=["Wow that was easy!"]) 11 | except: 12 | try: 13 | import pip 14 | pip.main(['install', 'telegram_send']) 15 | #!pip install telepot 16 | except Exception as e: 17 | print(e) 18 | print('install telegram_send pip package ') 19 | TOKEN = "1920193166:AAEIi9AsdfsL6Imbo7pZn-PaVN9JsdfsMLocthiIKo" #Enter token of telegram , it will notify during order updates 20 | chat_id = "13513433780503" #chatid in telegram 21 | try: 22 | import telegram_send 23 | telegram_send.send(messages=[a]) 24 | #import telepot 25 | #bot = telepot.Bot(TOKEN)"Wow that was easy!" 26 | except Exception as e: 27 | print(e) 28 | print('unable to send message') 29 | 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 srikar kodakandla 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /common/pyalgotradesample.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | data=pd.read_csv('/home/ubuntu/Downloads/nifty_10min_data.csv',parse_dates=True) 3 | data=data.dropna() 4 | 5 | from pyalgotrade import strategy 6 | from pyalgotrade.barfeed import quandlfeed 7 | from pyalgotrade.technical import ma 8 | from pyalgotrade.barfeed import yahoofeed 9 | 10 | 11 | def safe_round(value, digits): 12 | if value is not None: 13 | value = round(value, digits) 14 | return value 15 | 16 | 17 | class MyStrategy(strategy.BacktestingStrategy): 18 | def __init__(self, feed, instrument): 19 | super(MyStrategy, self).__init__(feed) 20 | # We want a 15 period SMA over the closing prices. 21 | self.__sma = ma.SMA(feed[instrument].getCloseDataSeries(), 15) 22 | self.__instrument = instrument 23 | 24 | def onBars(self, bars): 25 | bar = bars[self.__instrument] 26 | self.info("%s %s" % (bar.getClose(), safe_round(self.__sma[-1], 2))) 27 | 28 | 29 | # Load the bar feed from the CSV file 30 | feed = quandlfeed.Feed() 31 | feed.addBarsFromCSV("orcl", "/home/ubuntu/Download/nifty_10min_data.csv") 32 | # Evaluate the strategy with the feed's bars. 33 | myStrategy = MyStrategy(feed, "orcl") 34 | myStrategy.run() -------------------------------------------------------------------------------- /common/backtestingpy.py: -------------------------------------------------------------------------------- 1 | from backtesting import Backtest, Strategy 2 | from backtesting import Backtest, Strategy 3 | from backtesting.lib import crossover 4 | import pandas as pd 5 | data = pd.read_csv('/home/ubuntu/Downloads/5min_N50_10yr.csv', parse_dates=True) 6 | #data=data[-60000:] 7 | data = data.dropna() 8 | data=data.set_index('Date') 9 | data.index=pd.to_datetime(data.index) 10 | 11 | import pandas as pd 12 | from ta.trend import MACD 13 | 14 | 15 | from backtesting.test import SMA 16 | 17 | 18 | class SmaCross(Strategy): 19 | n1 = 116 20 | n2 = 814 21 | 22 | def init(self): 23 | close = self.data.Close 24 | self.sma1 = self.I(SMA, close, self.n1) 25 | self.sma2 = self.I(SMA, close, self.n2) 26 | 27 | def next(self): 28 | if crossover(self.sma1, self.sma2): 29 | self.buy() 30 | elif crossover(self.sma2, self.sma1): 31 | self.sell() 32 | 33 | 34 | bt = Backtest(data, SmaCross, 35 | cash=100000000, commission=.002, 36 | exclusive_orders=True) 37 | 38 | #output = bt.run() 39 | 40 | 41 | 42 | stats = bt.optimize(n1=range(2, 2000, 2), 43 | n2=range(2,2000,2), 44 | #h=range(1, 100, 5), 45 | maximize='Win Rate [%]', return_heatmap=True,constraint=lambda param: param.n1 < param.n2,max_tries=16000) 46 | bt.plot() -------------------------------------------------------------------------------- /check_database.py: -------------------------------------------------------------------------------- 1 | import os 2 | from time import sleep 3 | import datetime 4 | import time 5 | from common.message import message 6 | os.system('rm database_started') 7 | os.system('rm databasestart.txt') 8 | open('database_started','w').write('False') 9 | while True: 10 | os.system('screen -dmS database ipython3 accounts_database.py') 11 | print('screen -dmS database ipython3 accounts_database.py') 12 | while not ((0 <= time.localtime().tm_wday <= 4) and (datetime.datetime.strptime( 13 | datetime.datetime.strftime(datetime.datetime.now(), "%d-%m-%Y") + " 09:15:01", 14 | "%d-%m-%Y %H:%M:%S") <= datetime.datetime.now() <= datetime.datetime.strptime( 15 | datetime.datetime.strftime(datetime.datetime.now(), "%d-%m-%Y") + " 15:30:00", 16 | "%d-%m-%Y %H:%M:%S"))): 17 | 18 | sleep(1) 19 | print('waiting market to open check_database.py') 20 | sleep(40) 21 | started=False 22 | try: 23 | with open('databasestart.txt', 'r') as f: 24 | u=f.read() 25 | except: 26 | started=False 27 | if u=='True': 28 | started=True 29 | if started: 30 | open('database_started','w').write('True') 31 | message('started database successsfully') 32 | break 33 | if not started: 34 | os.system('screen -XS database quit') 35 | os.system('rm /home/ubuntu/pycharmprojects/tradeautomation/ticks.db') 36 | print('screen -XS database quit') 37 | else: 38 | sleep(5) 39 | print('Waiting for market to open...') 40 | 41 | 42 | -------------------------------------------------------------------------------- /fyers/script.py: -------------------------------------------------------------------------------- 1 | from common import message as m 2 | def name_to_script(name): 3 | try: 4 | import os 5 | import pandas as pd 6 | import re 7 | try: 8 | a = pd.read_csv('NSE_CM.csv') 9 | #print("current working directory......",os.getcwd()) 10 | # print(a) 11 | except: 12 | os.system('curl -0 https://public.fyers.in/sym_details/NSE_CM.csv') 13 | #print("exception 1......................") 14 | finally: 15 | try: 16 | a = pd.read_csv('NSE_CM.csv') 17 | #print("finally1....") 18 | except: 19 | os.system('curl -0 https://public.fyers.in/sym_details/NSE_CM.csv') 20 | a = pd.read_csv('NSE_CM.csv') 21 | 22 | try: 23 | #print("before dd values......") 24 | dd=sorted(a[a['NSE:ABAN-EQ'].str.contains(name, flags=re.IGNORECASE)]['NSE:AMARAJABAT-EQ'].to_numpy())[0] 25 | 26 | except: 27 | try: 28 | #print("dd2 values..") 29 | dd=sorted(a[a['ABAN OFFSHORE LTD.'].str.contains(name, flags=re.IGNORECASE)]['NSE:ABAN-EQ'].to_numpy())[0] 30 | 31 | except: 32 | #print("dd3 values....vv values") 33 | vv = a[a['INE421A01028'].notna()] 34 | dd = vv[vv['INE421A01028'].str.contains(name, flags=re.IGNORECASE)]['NSE:ABAN-EQ'].to_numpy()[0] 35 | 36 | except Exception as error : 37 | m.message(f'Either the stock name is wrong or error while downloading data from fyers website \n{error}') 38 | try: 39 | return dd 40 | except Exception as error: 41 | m.message(f"can't find the given stock name {error}") 42 | return False 43 | -------------------------------------------------------------------------------- /fyers/look_database.py: -------------------------------------------------------------------------------- 1 | import time 2 | import os 3 | import pandas as pd 4 | import sqlite3 5 | from datetime import datetime 6 | import sys 7 | #inserting_data_to_database=False 8 | if os.getcwd()[0] == 'C': 9 | db = sqlite3.connect('ticks.db') 10 | else: 11 | db = sqlite3.connect('ticks.db') 12 | c = db.cursor() 13 | from fyers.script import name_to_script 14 | count1=0 15 | u='False' 16 | def get_hist(ticker, db=db,timeframe='1min'): 17 | global count1 18 | global u 19 | #token = instrumentLookup(instrument_df, ticker) 20 | try: 21 | opened=open('database_started','r').read() 22 | except: 23 | opened=False 24 | if opened=='True' and count1<6: 25 | count1+=1 26 | if os.getcwd()[0] == 'C': 27 | db = sqlite3.connect('ticks.db') 28 | else: 29 | db = sqlite3.connect('ticks.db') 30 | c = db.cursor() 31 | if opened!='True': 32 | opened=False 33 | count1=0 34 | if u=='False': 35 | if os.getcwd()[0] == 'C': 36 | db = sqlite3.connect('ticks.db') 37 | else: 38 | db = sqlite3.connect('ticks.db') 39 | c = db.cursor() 40 | try: 41 | with open('databasestart.txt', 'r') as f: 42 | u=f.read() 43 | except: 44 | u='False' 45 | 46 | token=ticker.upper() 47 | ticker=name_to_script(token) 48 | token = ticker.split('-')[0].split(':')[1] 49 | data = pd.read_sql('''SELECT * FROM TOKEN%s WHERE ts >= date() - '12 day';''' % token, con=db) 50 | data = data.set_index(['ts']) 51 | data.index = pd.to_datetime(data.index) 52 | ticks = data.loc[:, ['price']] 53 | df = ticks['price'].resample(timeframe).ohlc().dropna() 54 | return df 55 | 56 | #from common.indicator import SuperTrend 57 | #SuperTrend(data,80,3.6) -------------------------------------------------------------------------------- /fyers/history.py: -------------------------------------------------------------------------------- 1 | from fyers.script import name_to_script 2 | from datetime import * 3 | from datetime import datetime 4 | import re 5 | #cache={} 6 | class history: 7 | '''name,fyers,days=5,resolution="1m",date_format="0",range_from=None,range_to=None,cont_flag="1"''' 8 | def __init__(self,fyers): 9 | self.fyers=fyers.fyers 10 | self.cache={} 11 | #self.days=days 12 | #self.resolution=resolution 13 | #self.date_format=date_format 14 | #self.range_from=range_from 15 | #self.range_to=range_to 16 | #self.cont_flag=cont_flag 17 | def history(self,name,days=50,resolution="1",date_format="1",range_from=None,range_to=None,cont_flag="1"): 18 | name=name_to_script(name) 19 | if range_from == None: 20 | range_from = (datetime.now() - timedelta((days))).strftime('%Y-%m-%d') 21 | if range_to == None: 22 | range_to=str((datetime.now() + timedelta((1))).strftime('%Y-%m-%d')) 23 | #range_to = str(date.today()) 24 | try: 25 | #print('Returning value in cache ') 26 | #print(self.cache) 27 | ttt=re.sub(':|-', '', str(str(name)+str(resolution)+str(date_format)+str(range_from)+str(range_to)+str(cont_flag))) 28 | return self.cache[ttt] 29 | except: 30 | print('not able to return value in cache ') 31 | try: 32 | data = {"symbol":name,"resolution":resolution,"date_format":date_format,"range_from":range_from,"range_to":range_to,"cont_flag":cont_flag} 33 | uuu=self.fyers.history(data) 34 | self.cache.update({re.sub(':|-', '', str(str(name)+str(resolution)+str(date_format)+str(range_from)+str(range_to)+str(cont_flag))):uuu}) 35 | #print(self.cache.keys()) 36 | return uuu 37 | except Exception as error: 38 | print(f'There is an error while fetching Historical data from fyers : {error}') 39 | 40 | -------------------------------------------------------------------------------- /fyers/database.py: -------------------------------------------------------------------------------- 1 | import time 2 | import os 3 | import pandas as pd 4 | import sqlite3 5 | from datetime import datetime 6 | import sys 7 | if os.getcwd()[0] == 'C': 8 | db = sqlite3.connect('ticks.db') 9 | else: 10 | db = sqlite3.connect('ticks.db',check_same_thread=False) 11 | def create_tables(tokens): 12 | c = db.cursor() 13 | print(" i am in creating table ") 14 | for i in tokens: 15 | print("CREATE TABLE IF NOT EXISTS TOKEN{} (ts datetime primary key,price real(15,5), volume integer)".format(i)) 16 | c.execute("CREATE TABLE IF NOT EXISTS TOKEN{} (ts datetime primary key,price real(15,5), volume integer)".format(i)) 17 | try: 18 | db.commit() 19 | except: 20 | db.rollback() 21 | 22 | def insert_ticks(ticks): 23 | 24 | c = db.cursor() 25 | #print(' I am in insert_ticks') 26 | #print('i am in insert ticks bro ') 27 | for tick in ticks: 28 | try: 29 | #print() 30 | #print(tick) 31 | #print() 32 | tok = str(tick['symbol']) 33 | #print(tok) 34 | tok= tok.split('-')[0].split(':')[1] 35 | #print(tok) 36 | vals = [datetime.now(), tick['ltp'], tick['min_volume']] 37 | #print(vals) 38 | query = "INSERT INTO TOKEN{}(ts,price,volume) VALUES (?,?,?)".format(tok) 39 | #print(query) 40 | c.execute(query, vals) 41 | except Exception as error: 42 | try: 43 | tok = str(tick['symbol']) 44 | tok = tok.split('-')[0].split(':')[1] 45 | create_tables([tok]) 46 | print(error) 47 | except Exception as error: 48 | print(error) 49 | print('same value entered twice to the database table ') 50 | 51 | try: 52 | db.commit() 53 | except Exception as error: 54 | print(error) 55 | db.rollback() 56 | print('Same timestamp tried to added !!!') 57 | 58 | -------------------------------------------------------------------------------- /common/__pycache__/stock_selection_features_volume.py: -------------------------------------------------------------------------------- 1 | import urllib.parse as urlparse 2 | from time import sleep 3 | from selenium import webdriver 4 | from selenium.webdriver.firefox.options import Options 5 | from selenium.webdriver.common.by import By 6 | from selenium.webdriver.support import expected_conditions as EC 7 | from selenium.webdriver.support.ui import WebDriverWait 8 | from webdriver_manager.utils import ChromeType 9 | from webdriver_manager.chrome import ChromeDriverManager 10 | import pickle 11 | from common import message as m 12 | options = Options() 13 | #options.add_argument('--headless') 14 | #options.add_argument('—disable-gpu') 15 | options.headless=True 16 | from selenium import webdriver 17 | from webdriver_manager.firefox import GeckoDriverManager 18 | driver = webdriver.Firefox(options=options,executable_path=GeckoDriverManager().install()) 19 | #driver = webdriver.Chrome(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM 20 | #).install(), options=options) 21 | #driver.get('https://chartink.com/screener/copy-high-volatile-stocks-day-trade-or-btst-338') 22 | #driver.get('https://chartink.com/screener/copy-high-volume-stocks-3207') 23 | #driver.get('https://chartink.com/screener/copy-high-volume-stocks1-1')#driver.get('https://chartink.com/screener/relative-high-volume-stocks') 24 | driver.get('https://chartink.com/screener/relative-high-volume-stocks-with-volume-shockers') 25 | sleep(10) 26 | stock=[] 27 | count=0 28 | while count<25 : 29 | count+=1 30 | try: 31 | stock.append(WebDriverWait(driver,2).until(EC.presence_of_element_located((By.XPATH,f'//*[@id="DataTables_Table_0"]/tbody/tr[{count}]/td[3]/a'))).text) 32 | except: 33 | print("There is no stock to trade tomorrow !!!") 34 | #stock=driver.find_element_by_xpath('//*[@id="DataTables_Table_0"]/tbody/tr[1]/td[3]/a').text 35 | write=open('stock_selection.txt','w') 36 | for i in stock: 37 | write.write(i) 38 | write.write('\n') 39 | write.close() 40 | m.message(f'Selected the following stock to trade tomorrow is {stock}') 41 | driver.close() 42 | -------------------------------------------------------------------------------- /fyers/live.py: -------------------------------------------------------------------------------- 1 | import time 2 | """I need to check the time of the database data and fyers data before concatinating , if not same or time is repeated then i needed 3 | to do certain things to over come the problem """ 4 | import os 5 | import pandas as pd 6 | import sqlite3 7 | from datetime import datetime 8 | import sys 9 | if os.getcwd()[0] == 'C': 10 | db = sqlite3.connect('ticks.db') 11 | else: 12 | db = sqlite3.connect('ticks.db') 13 | c = db.cursor() 14 | try: 15 | os.system('sudo chown root ticks.db') 16 | os.system('sudo chown ubuntu ticks.db') 17 | except: 18 | pass 19 | from fyers.history import history 20 | from fyers.look_database import get_hist 21 | #data=get_hist('reliance') 22 | #db.execute('select * from TOKENNIFTY50') 23 | class full_data: 24 | def __init__(self,fyers): 25 | self.fyers=fyers 26 | self.a = history(self.fyers) 27 | def full_data(self,name,days=5,resolution="1",date_format="1",range_from=None,range_to=None,cont_flag="1"): 28 | try: 29 | y=True 30 | data=get_hist(name,timeframe=str(resolution)+'min') 31 | except: 32 | y=False 33 | print('The given stock is not there in database ! ') 34 | 35 | data1=self.a.history(name,days,resolution,date_format,range_from,range_to,cont_flag) 36 | data1=pd.DataFrame(data1['candles'], columns=['ts', 'open', 'high', 'low', 'close', 'volume']).set_index('ts').drop(['volume'], axis=1) 37 | data1.index = pd.to_datetime(data1.index, unit='s').tz_localize('Africa/Abidjan').tz_convert('Asia/Kolkata') 38 | if y: 39 | #import pdb 40 | #pdb.set_trace() 41 | #data=pd.DataFrame(data['candles'], columns=['ts', 'open', 'high', 'low', 'close', 'volume']).set_index('ts').drop(['volume'], axis=1) 42 | data.index=pd.to_datetime(data.index, unit='s').tz_localize('Asia/Kolkata').tz_convert('Asia/Kolkata') 43 | final=pd.concat([data1,data]) 44 | final=final.reset_index().drop_duplicates(subset='ts').set_index('ts') 45 | else: 46 | final=data1 47 | return final 48 | 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Seeking Investors for My AI-Driven, Trading Project 2 | 3 | I want to make a Deep Learning (Artificial Intelligence) model that will change how we do options selling. If this works, I also want to try it with stocks, other options, foreign markets, and more. For this, I need investors who can support me. Your investment will let me work on this project full time. 4 | As the sole developer of this system, I will have the flexibility to dedicate my full efforts towards this project. With proper funding and support, I aim to create an innovative trading platform and grow it into a successful business. 5 | 6 | ## Want To Join? 7 | 8 | If you're interested in this project, I would love to talk more. You can contact me at: 9 | 10 | - Email: kodakandlasrikar99@gmail.com 11 | - Phone no: (+91) 9176462946 12 | - LinkedIn: [https://www.linkedin.com/in/srikar-kodakandla/] 13 | 14 | Let's work together to change trading. 15 | 16 | ## About Me 17 | 18 | I have extensive experience building algorithmic trading strategies and systems, including 4+ years of active trading experience across stocks, options, currencies, and commodities. In addition to trading system development, I have a strong background in cutting-edge deep learning techniques. 19 | 20 | ## About this project : algo-trading-using-fyers-broker-api 21 | 22 | This program trades in stock market using fyers api . It buys when supertrend gives buy signal and sells if supertrend gives sell signal , if adx is below 30 it won't trade. 23 | it selects supertrend values by bruteforcing all the possible combinations with past data of given stock . It selects stock day before the market opens.It selects the stocks to trade by checking list of stocks in chartink script , then it bruteforces best combination of supertrend combinations and trades with that supertrend combinations on the next day , it also messages you live alerts in telegram. 24 | 25 | To start trading , run ipython3 fyers/strategy.py 26 | To store live stock data in sql run ipython3 fyers/accounts_database.py 27 | 28 | This code is kept publicly in github for educational purpose only .I am not responsible with your profit and losses. 29 | 30 | -------------------------------------------------------------------------------- /common/backtestingmacd.py: -------------------------------------------------------------------------------- 1 | from backtesting import Backtest, Strategy 2 | from backtesting import Backtest, Strategy 3 | from backtesting.lib import crossover 4 | import pandas as pd 5 | data=pd.read_csv('/home/ubuntu/Downloads/5min_N50_10yr.csv',parse_dates=True) 6 | data=data.dropna() 7 | data=data.set_index('Date') 8 | data.index=pd.to_datetime(data.index) 9 | #data=data[-10000:] 10 | import pandas as pd 11 | from ta.trend import MACD 12 | from tqdm import tqdm 13 | 14 | bar=tqdm(total=868725/4) 15 | 16 | def SMA(values, n): 17 | """ 18 | Return simple moving average of `values`, at 19 | each step taking into account `n` previous values. 20 | """ 21 | print(n) 22 | return pd.Series(values).rolling(n).mean() 23 | def ma(close,fast,slow,sig): 24 | global bar 25 | bar.update(1) 26 | close=pd.Series(close) 27 | return MACD(close=close,window_fast=fast,window_slow=slow,window_sign=sig).macd() 28 | def ma1(close,fast,slow,sig): 29 | close=pd.Series(close) 30 | return MACD(close=close,window_fast=fast,window_slow=slow,window_sign=sig).macd_signal() 31 | #SMA(data['Close'],10) 32 | class SmaCross(Strategy): 33 | fast=76 34 | slow=99 35 | sig=183 36 | def init(self): 37 | price = self.data.Close 38 | #self.ma1 = self.I(SMA, price, 50) 39 | #self.ma2 = self.I(SMA, price, 200) 40 | self.macd=self.I(ma,price,fast=self.fast,slow=self.slow,sig=self.sig) 41 | self.macd_sig=macd=self.I(ma1,price,fast=self.fast,slow=self.slow,sig=self.sig) 42 | 43 | def next(self): 44 | if crossover(self.macd, self.macd_sig): 45 | self.position.close() 46 | self.buy() 47 | elif crossover(self.macd_sig, self.macd): 48 | self.position.close() 49 | self.sell() 50 | 51 | 52 | bt = Backtest(data, SmaCross, commission=0.002,trade_on_close=True,cash=1000000000000) 53 | stats = bt.run() 54 | bt.plot() 55 | 56 | stats = bt.optimize(fast=range(5, 100, 1), 57 | slow=range(10, 100,1), 58 | sig=range(5,200,1), 59 | maximize='Win Rate [%]', 60 | constraint=lambda param: param.fast < param.slow) 61 | -------------------------------------------------------------------------------- /common/backtestingrsi.py: -------------------------------------------------------------------------------- 1 | from backtesting import Backtest, Strategy 2 | from backtesting import Backtest, Strategy 3 | from backtesting.lib import crossover 4 | import pandas as pd 5 | data=pd.read_csv('/home/ubuntu/Download/nifty_10min_data.csv',parse_dates=True) 6 | data=data.dropna() 7 | data=data[-20000:] 8 | import pandas as pd 9 | from ta.momentum import RSIIndicator 10 | import bt 11 | #RSIIndicator(data['Close']).rsi() 12 | def rs(data): 13 | print(data) 14 | return RSIIndicator(pd.Series(data)).rsi() 15 | class SmaCross(Strategy): 16 | l=20 17 | h=80 18 | def init(self): 19 | self.rsi = self.I(rs,self.data.Close) 20 | 21 | def next(self): 22 | if not self.position: 23 | if self.rsi < self.l: 24 | self.buy(size=1) 25 | else: 26 | self.sell(size=1) 27 | 28 | if (self.rsi > self.h) and not self.position.is_short: 29 | 30 | self.sell(size=1) 31 | if (self.rsi < self.h) and not self.position.is_long: 32 | self.buy(size=1) 33 | 34 | bt = Backtest(data, SmaCross, commission=.002,trade_on_close=True,cash=1000000,exclusive_orders=True) 35 | stats = bt.run() 36 | bt.plot() 37 | 38 | stats = bt.optimize(fast=range(5, 100, 1), 39 | slow=range(10, 100,1), 40 | sig=range(5,200,1), 41 | maximize='Equity Final [$]', 42 | constraint=lambda param: param.fast < param.slow) 43 | 44 | def rs(data): 45 | print(data) 46 | return RSIIndicator(pd.Series(data)).rsi() 47 | class SmaCross(Strategy): 48 | l=20 49 | h=80 50 | def init(self): 51 | self.rsi = self.I(rs,self.data.Close) 52 | 53 | def next(self): 54 | if not self.position: 55 | if self.rsi < self.l: 56 | self.buy(size=1) 57 | else: 58 | self.sell(size=1) 59 | 60 | if (self.rsi > self.h) and not self.position.is_short: 61 | 62 | self.sell(size=1) 63 | if (self.rsi < self.h) and not self.position.is_long: 64 | self.buy(size=1) 65 | 66 | bt = Backtest(data, SmaCross, commission=.002,trade_on_close=True,cash=1000000,exclusive_orders=True) 67 | stats = bt.run() 68 | bt.plot(plot_return=True,plot_equity=True) -------------------------------------------------------------------------------- /common/backtestsupertrendrsi.py: -------------------------------------------------------------------------------- 1 | from backtesting import Backtest, Strategy 2 | from backtesting import Backtest, Strategy 3 | from backtesting.lib import crossover 4 | import pandas as pd 5 | data=pd.read_csv('/home/ubuntu/Downloads/5min_N50_10yr.csv',parse_dates=True) 6 | data=data.dropna() 7 | data=data[-8000:] 8 | import pandas as pd 9 | from ta.momentum import RSIIndicator 10 | from common.indicator import SuperTrend 11 | import numpy as np 12 | def rs(data): 13 | #print(data) 14 | return RSIIndicator(pd.Series(data)).rsi() 15 | def st(period,multiplier,data): 16 | p=SuperTrend(data,period,multiplier,ohlc=['Open', 'High', 'Low', 'Close']) 17 | #trend=p['STX_80_3.6'] 18 | #trend[trend=='down']=0 19 | #trend[trend=='up']=1 20 | #trend[trend=='nan']=np.nan 21 | return p[f'ST_{period}_{multiplier}'] 22 | 23 | class SmaCross(Strategy): 24 | period=80 25 | multiplier=3.6 26 | h=80 27 | l=30 28 | def init(self): 29 | price = self.data.Close 30 | #self.ma1 = self.I(SMA, price, 50) 31 | #self.ma2 = self.I(SMA, price, 200) 32 | self.trend=self.I(st,self.period,self.multiplier,self.data.df) 33 | self.rsi = self.I(rs,self.data.Close) 34 | #self.macd=self.I(ma,price,fast=self.fast,slow=self.slow,sig=self.sig) 35 | #self.macd_sig=macd=self.I(ma1,price,fast=self.fast,slow=self.slow,sig=self.sig) 36 | def next(self): 37 | if self.trend<=self.data.Close and not self.position.is_long: 38 | self.position.close() 39 | if self.rsi>self.h: 40 | self.buy() 41 | elif self.trend>=self.data.Close and not self.position.is_short: 42 | self.position.close() 43 | if self.rsiself.h: 52 | self.sell() 53 | elif self.trend>=self.data.Close and not self.position.is_short: 54 | self.position.close() 55 | if self.rsi= self.data.Close and self.trend1 <= self.data.Close and not self.position.is_short: 62 | #self.position.close() 63 | self.sell() 64 | if self.trend <= self.data.Close and self.trend1 <= self.data.Close and not self.position.is_short: 65 | self.position.close() 66 | #self.buy() 67 | if self.trend <= self.data.Close and self.trend1 >= self.data.Close and not self.position.is_long: 68 | #self.position.close() 69 | self.buy() 70 | if self.trend >= self.data.Close and self.trend1 >= self.data.Close and not self.position.is_long: 71 | self.position.close() 72 | #self.sell() 73 | 74 | 75 | bt = Backtest(data, SmaCross, commission=0.002, trade_on_close=True, cash=1000000000000, exclusive_orders=True) 76 | stats = bt.run() 77 | bt.plot() 78 | import numpy as np 79 | 80 | stats = bt.optimize(period=range(5, 100, 10), 81 | multiplier=np.arange(2,10,0.5).tolist(), 82 | period1=range(5, 100, 10), 83 | multiplier1=np.arange(2,10,0.5).tolist(), 84 | #h=range(1, 100, 5), 85 | maximize='Return [%]', return_heatmap=True) 86 | 87 | -------------------------------------------------------------------------------- /common/stock_selection_features_volume.py: -------------------------------------------------------------------------------- 1 | import urllib.parse as urlparse 2 | from time import sleep 3 | from selenium import webdriver 4 | from selenium.webdriver.firefox.options import Options 5 | from selenium.webdriver.common.by import By 6 | from selenium.webdriver.support import expected_conditions as EC 7 | from selenium.webdriver.support.ui import WebDriverWait 8 | from webdriver_manager.utils import ChromeType 9 | from webdriver_manager.chrome import ChromeDriverManager 10 | import pickle 11 | from common import message as m 12 | options = Options() 13 | #options.add_argument('--headless') 14 | #options.add_argument('—disable-gpu') 15 | options.headless=True 16 | from selenium import webdriver 17 | from webdriver_manager.firefox import GeckoDriverManager 18 | driver = webdriver.Firefox(options=options,executable_path=GeckoDriverManager().install()) 19 | from selenium.webdriver.common.keys import Keys 20 | #driver = webdriver.Chrome(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM 21 | #).install(), options=options) 22 | #driver.get('https://chartink.com/screener/copy-high-volatile-stocks-day-trade-or-btst-338') 23 | #driver.get('https://chartink.com/screener/copy-high-volume-stocks-3207') 24 | #driver.get('https://chartink.com/screener/copy-high-volume-stocks1-1')#driver.get('https://chartink.com/screener/relative-high-volume-stocks') 25 | driver.get('https://chartink.com/screener/relative-high-volume-stocks-with-volume-shockers') 26 | stock=[] 27 | for k in range(20,0,-1): 28 | print(k) 29 | driver.get('https://chartink.com/screener/relative-high-volume-stocks-with-volume-shockers') 30 | WebDriverWait(driver,2).until(EC.presence_of_element_located((By.XPATH,'/html/body/div[2]/div[2]/div[2]/div/div/div/div[2]/div/div[2]/div[1]/div/ul/li[4]/span/span[4]/span[5]/span[2]/span/span/span'))).click() 31 | for i in range(10): 32 | WebDriverWait(driver,2).until(EC.presence_of_element_located((By.XPATH,'/html/body/div[2]/div[2]/div[2]/div/div/div/div[2]/div/div[2]/div[1]/div/ul/li[4]/span/span[4]/span[5]/span[2]/span/span/input'))).send_keys(Keys.BACKSPACE) 33 | WebDriverWait(driver,2).until(EC.presence_of_element_located((By.XPATH,'/html/body/div[2]/div[2]/div[2]/div/div/div/div[2]/div/div[2]/div[1]/div/ul/li[4]/span/span[4]/span[5]/span[2]/span/span/input'))).send_keys(k) 34 | WebDriverWait(driver,2).until(EC.presence_of_element_located((By.XPATH,'/html/body/div[2]/div[2]/div[2]/div/div/div/div[2]/div/div[2]/div[2]/div[1]/button[1]'))).click() 35 | count=0 36 | while count<25 : 37 | count+=1 38 | try: 39 | stock.append(WebDriverWait(driver,0.1).until(EC.presence_of_element_located((By.XPATH,f'//*[@id="DataTables_Table_0"]/tbody/tr[{count}]/td[3]/a'))).text) 40 | print(stock[-1]) 41 | except: 42 | pass 43 | #print("There is no stock in the given XPATH...") 44 | 45 | res = [] 46 | for i in stock: 47 | if i not in res: 48 | res.append(i) 49 | stock=res 50 | #stock=driver.find_element_by_xpath('//*[@id="DataTables_Table_0"]/tbody/tr[1]/td[3]/a').text 51 | write=open('stock_selection.txt','w') 52 | for i in stock: 53 | write.write(i) 54 | write.write('\n') 55 | write.close() 56 | m.message(f'Selected the following stock to trade tomorrow is {stock}') 57 | driver.close() 58 | -------------------------------------------------------------------------------- /common/find_supertrend_thread.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pandas as pd 3 | from time import gmtime, strftime 4 | try: 5 | read=open('stock_selection.txt','r') 6 | except: 7 | read = open('fyers/stock_selection.txt', 'r') 8 | stock_name=read.read().split('\n') 9 | read.close() 10 | stock_name=stock_name[0] 11 | from fyers.accounts_login import login_accounts 12 | from fyers.script import name_to_script 13 | name_script=name_to_script(stock_name) 14 | accounts=login_accounts() 15 | from fyers.live import full_data 16 | a=full_data(accounts[0]) 17 | data=a.full_data(name_script,days=90) 18 | realdata = data.copy() 19 | from common.indicator import * 20 | import numpy as np 21 | d = pd.DataFrame(columns=('period', 'multiplier', 'buy', 'sell', 'total')) 22 | def calculate(a, b, data1): 23 | # data1=realdata.copy() 24 | #for b in np.arange(1, 5, 0.1): 25 | global d 26 | t = SuperTrend(data1, a, b) 27 | (close, trend) = ((t['close'], t[f'STX_{a}_{b}'])) 28 | close = close.to_numpy() 29 | trend = trend.to_numpy() 30 | buyposition = 0 31 | sellposition = 0 32 | buyprofit = 0 33 | sellprofit = 0 34 | sell = [] 35 | buy = [] 36 | for i in range(len(trend)): 37 | if sellposition == 0: 38 | if trend[i] == 'down' and trend[i - 1] == 'up': 39 | sellposition = close[i] 40 | if buyposition == 0: 41 | if trend[i] == 'up' and trend[i - 1] == 'down': 42 | buyposition = close[i] 43 | if trend[i] == 'down' and trend[i - 1] == 'up' and buyposition != 0: 44 | buyprofit = close[i] - buyposition + buyprofit 45 | # print(buyprofit) 46 | sellposition = close[i] 47 | sell.append(sellprofit) 48 | if trend[i] == 'up' and trend[i - 1] == 'down' and sellposition != 0: 49 | sellprofit = sellposition - close[i] + sellprofit 50 | # print(sellprofit) 51 | buyposition = close[i] 52 | buy.append(buyprofit) 53 | # plt.plot(sell) 54 | # plt.plot(buy) 55 | d = d.append( 56 | {'period': a, 'multiplier': b, 'buy': buyprofit, 'sell': sellprofit, 'total': buyprofit + sellprofit}, 57 | ignore_index=True) 58 | print([a, b, buyprofit, sellprofit, buyprofit + sellprofit]) 59 | return d 60 | ''' 61 | from joblib import Parallel, delayed 62 | import multiprocessing 63 | 64 | num_cores = multiprocessing.cpu_count() 65 | 66 | print(strftime("%Y-%m-%d %H:%M:%S", gmtime())) 67 | results = Parallel(n_jobs=num_cores)(delayed(calculate)(j, 0, data) for j in range(5, 500)) 68 | ''' 69 | 70 | 71 | from time import sleep 72 | 73 | import threading 74 | t=(calculate(80,3.6,data)) 75 | count=0 76 | u=[] 77 | for i in range(5,100): 78 | for j in np.arange(1, 5, 0.1): 79 | x=threading.Thread(target=calculate,args=(i, j, data)) 80 | u.append(x) 81 | #x.start() 82 | count+=1 83 | print(count) 84 | #x.join() 85 | 86 | print('threads completed') 87 | sleep(1) 88 | 89 | count=0 90 | for i in u: 91 | count+=1 92 | print(count) 93 | print(d) 94 | i.start() 95 | count=0 96 | print('start completed') 97 | sleep(1) 98 | for i in u: 99 | count+=1 100 | print(count) 101 | i.join() 102 | print('join completed') 103 | #threading.Thread(target=calculate,args=(80,3.6, data)).start() 104 | #t=(calculate(80,3.6,data)) 105 | o=d 106 | ''' 107 | o = pd.DataFrame() 108 | for i in results: 109 | o = o.append(i)''' 110 | o=o.sort_values(['total'],ascending=[0]) 111 | 112 | pd.DataFrame(o).to_csv('supertrend_selection.csv') 113 | 114 | print(strftime("%Y-%m-%d %H:%M:%S", gmtime())) 115 | -------------------------------------------------------------------------------- /common/stock_selection_nifty200_volume.py: -------------------------------------------------------------------------------- 1 | import urllib.parse as urlparse 2 | from time import sleep 3 | from selenium import webdriver 4 | from selenium.webdriver.firefox.options import Options 5 | from selenium.webdriver.common.by import By 6 | from selenium.webdriver.support import expected_conditions as EC 7 | from selenium.webdriver.support.ui import WebDriverWait 8 | from webdriver_manager.utils import ChromeType 9 | from webdriver_manager.chrome import ChromeDriverManager 10 | import pickle 11 | from common import message as m 12 | options = Options() 13 | #options.add_argument('--headless') 14 | #options.add_argument('—disable-gpu') 15 | options.headless=True 16 | from selenium import webdriver 17 | from webdriver_manager.firefox import GeckoDriverManager 18 | driver = webdriver.Firefox(options=options,executable_path=GeckoDriverManager().install()) 19 | from selenium.webdriver.common.keys import Keys 20 | #driver = webdriver.Chrome(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM 21 | #).install(), options=options) 22 | #driver.get('https://chartink.com/screener/copy-high-volatile-stocks-day-trade-or-btst-338') 23 | #driver.get('https://chartink.com/screener/copy-high-volume-stocks-3207') 24 | #driver.get('https://chartink.com/screener/copy-high-volume-stocks1-1')#driver.get('https://chartink.com/screener/relative-high-volume-stocks') 25 | driver.get('https://chartink.com/screener/relative-high-volume-stocks-with-volume-shockers') 26 | stock=[] 27 | for k in range(20,0,-1): 28 | print(k) 29 | driver.get('https://chartink.com/screener/relative-high-volume-stocks-with-volume-shockers') 30 | sleep(10) 31 | WebDriverWait(driver,2).until(EC.presence_of_element_located((By.XPATH,'/html/body/div[2]/div[2]/div[2]/div/div/div/div[2]/div/div[2]/div[1]/div/ul/li[4]/span/span[4]/span[5]/span[2]/span/span/span'))).click() 32 | for i in range(10): 33 | WebDriverWait(driver,2).until(EC.presence_of_element_located((By.XPATH,'/html/body/div[2]/div[2]/div[2]/div/div/div/div[2]/div/div[2]/div[1]/div/ul/li[4]/span/span[4]/span[5]/span[2]/span/span/input'))).send_keys(Keys.BACKSPACE) 34 | WebDriverWait(driver,2).until(EC.presence_of_element_located((By.XPATH,'/html/body/div[2]/div[2]/div[2]/div/div/div/div[2]/div/div[2]/div[1]/div/ul/li[4]/span/span[4]/span[5]/span[2]/span/span/input'))).send_keys(k) 35 | WebDriverWait(driver,2).until(EC.presence_of_element_located((By.XPATH,'/html/body/div[2]/div[2]/div[2]/div/div/div/div[2]/div/div[2]/div[2]/div[1]/button[1]'))).click() 36 | sleep(10) 37 | try: 38 | sentiment=WebDriverWait(driver,0.1).until(EC.presence_of_element_located((By.XPATH,f'//*[@id="DataTables_Table_0"]/tbody/tr[1]/td[5]/span/b'))).text[:-1] 39 | sentiment=float(sentiment) 40 | if sentiment<0: 41 | print('clicked ... ') 42 | 43 | for i in range(1): 44 | WebDriverWait(driver,10).until(EC.presence_of_element_located((By.XPATH,f'/html/body/div[2]/div[2]/div[2]/div/div/div/div[2]/div/div[2]/div[6]/div[1]/div/table/thead/tr/th[5]'))).click() 45 | except Exception as error: 46 | print(error) 47 | count=0 48 | 49 | while count<25 : 50 | count+=1 51 | try: 52 | stock.append(WebDriverWait(driver,0.1).until(EC.presence_of_element_located((By.XPATH,f'//*[@id="DataTables_Table_0"]/tbody/tr[{count}]/td[3]/a'))).text) 53 | print(stock[-1]) 54 | except: 55 | print("There is no stock in the given XPATH...") 56 | break 57 | 58 | 59 | res = [] 60 | for i in stock: 61 | if i not in res: 62 | res.append(i) 63 | stock=res 64 | #stock=driver.find_element_by_xpath('//*[@id="DataTables_Table_0"]/tbody/tr[1]/td[3]/a').text 65 | write=open('stock_selection.txt','w') 66 | for i in stock: 67 | write.write(i) 68 | write.write('\n') 69 | write.close() 70 | m.message(f'Selected the following stock to trade tomorrow is {stock}') 71 | driver.close() 72 | -------------------------------------------------------------------------------- /fyers/insert_database.py: -------------------------------------------------------------------------------- 1 | from fyers_api.Websocket import ws 2 | from fyers.database import * 3 | import time 4 | import datetime 5 | from fyers.script import name_to_script 6 | import websocket 7 | import logging 8 | import pdb 9 | from common import message as m 10 | emergency_start=False 11 | import time 12 | emergency_do_not_stop=False 13 | writing=False 14 | c=0 15 | with open('databasestart.txt', 'w') as f: 16 | f.write('False') 17 | class database_ticks:#(name,fyers,token,cred_dict): 18 | def __init__(self, symbol, fyers): 19 | self.fyers=fyers 20 | self.symbol1=[] 21 | for i in symbol: 22 | self.symbol1.append(name_to_script(i)) 23 | self.symbol=self.symbol1 24 | print(self.symbol) 25 | self.user_id = fyers.user_id 26 | self.password = fyers.password 27 | self.two_fa = fyers.two_fa 28 | self.redirect_url = fyers.redirect_url 29 | # redirect_url = 'http://127.0.0.1/ 30 | self.app_id = fyers.app_id 31 | self.app_secret = fyers.app_secret 32 | self.access_token = fyers.app_id + ':' + fyers.token 33 | print(fyers.fyers.funds()) 34 | # ["NSE:SBIN-EQ"] 35 | self.stock_name=self.symbol[0].split('-')[0].split(':')[1] 36 | create_tables([self.stock_name]) 37 | 38 | 39 | def database(self): 40 | def custom_message(msg): 41 | #print(self.response) 42 | #print ("Custom " + str(self.response)) 43 | #try: 44 | #print('hello bro ') 45 | global writing 46 | global c 47 | if writing==False and c>5: 48 | if c<10: 49 | open('databasestart.txt','w').write('True') 50 | writing=True 51 | if c<20: 52 | c+=1 53 | #print(c) 54 | print(msg) 55 | insert_ticks(msg) 56 | #print(msg) 57 | #except Exception as error: 58 | # print(error) 59 | data_type = "symbolData" 60 | #ws.FyersSocket.websocket_data = custom_message 61 | #ws.websocket_data=custom_message 62 | #ws.websocket_data = custom_message 63 | fyersSocket = ws.FyersSocket(access_token=self.access_token,run_background=False,log_path="/home/ubuntu/pycharmprojects/tradeautomation/fyers") 64 | fyersSocket.websocket_data=custom_message 65 | waiting = True 66 | while 1==1: 67 | if datetime.datetime.strptime(datetime.datetime.strftime(datetime.datetime.now(), "%d-%m-%Y") + " 09:15:00","%d-%m-%Y %H:%M:%S") <= datetime.datetime.now() or emergency_start: 68 | print('subscribe') 69 | #pdb.set_trace() 70 | time.sleep(5) 71 | fyersSocket.subscribe(data_type=data_type,symbol=self.symbol) 72 | time.sleep(5) 73 | fyersSocket.keep_running() 74 | #break 75 | while True: 76 | if datetime.datetime.strptime(datetime.datetime.strftime(datetime.datetime.now(), "%d-%m-%Y") + " 09:30:00","%d-%m-%Y %H:%M:%S") <= datetime.datetime.now() : 77 | import sys 78 | sys.exit() 79 | print('hello') 80 | # if (now.hour >= 15 and now.minute >= 30): 81 | #if ((0 <= time.localtime().tm_wday <= 4) and (datetime.datetime.strptime( 82 | # datetime.datetime.strftime(datetime.datetime.now(), "%d-%m-%Y") + " 15:30:00", 83 | # "%d-%m-%Y %H:%M:%S") <= datetime.datetime.now() <= datetime.datetime.strptime( 84 | # datetime.datetime.strftime(datetime.datetime.now(), "%d-%m-%Y") + " 15:35:00", 85 | # "%d-%m-%Y %H:%M:%S"))) or emergency_do_not_stop: 86 | # #alice.unsubscribe(alice.get_instrument_by_symbol('NSE', name), LiveFeedType.COMPACT) 87 | # import sys 88 | # sys.exit() 89 | #db.close() 90 | #m.message('database closed ') 91 | #database_ticks('ONGC') 92 | -------------------------------------------------------------------------------- /common/stock_selection_features_atr.py: -------------------------------------------------------------------------------- 1 | import urllib.parse as urlparse 2 | from time import sleep 3 | from selenium import webdriver 4 | from selenium.webdriver.firefox.options import Options 5 | from selenium.webdriver.common.by import By 6 | from selenium.webdriver.support import expected_conditions as EC 7 | from selenium.webdriver.support.ui import WebDriverWait 8 | from webdriver_manager.utils import ChromeType 9 | from webdriver_manager.chrome import ChromeDriverManager 10 | import pickle 11 | from common import message as m 12 | options = Options() 13 | #options.add_argument('--headless') 14 | #options.add_argument('—disable-gpu') 15 | options.headless=True 16 | from selenium import webdriver 17 | from webdriver_manager.firefox import GeckoDriverManager 18 | driver = webdriver.Firefox(options=options,executable_path=GeckoDriverManager().install()) 19 | #driver = webdriver.Chrome(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM 20 | #).install(), options=options) 21 | #driver.get('https://chartink.com/screener/copy-high-volatile-stocks-day-trade-or-btst-338') 22 | #driver.get('https://chartink.com/screener/copy-high-volume-stocks-3207') 23 | #driver.get('https://chartink.com/screener/copy-high-volume-stocks1-1')#driver.get('https://chartink.com/screener/relative-high-volume-stocks') 24 | #driver.get('https://chartink.com/screener/adx-indicator-stocks') 25 | #driver.get('https://chartink.com/screener/copy-three-week-green-fut') 26 | #driver.get('https://chartink.com/screener/three-week-red-or-green') 27 | #driver.get('https://chartink.com/screener/copy-positive-price-volume-movement-weekly-negative') 28 | #driver.get('https://chartink.com/screener/copy-positive-price-volume-movement-weekly') 29 | #driver.get('https://chartink.com/screener/copy-positive-price-volume-movement-weekly-cash') 30 | driver.get('https://chartink.com/screener/copy-positive-price-volume-movement-weekly-negative-or-positive-nifty500-and-red-or-green-fut') 31 | sleep(10) 32 | stock=[] 33 | count=0 34 | driver.find_element_by_xpath('//*[@id="DataTables_Table_0"]/thead/tr/th[7]').click() 35 | driver.find_element_by_xpath('//*[@id="DataTables_Table_0"]/thead/tr/th[7]').click() 36 | while count<25 : 37 | count+=1 38 | try: 39 | stock.append(WebDriverWait(driver,2).until(EC.presence_of_element_located((By.XPATH,f'//*[@id="DataTables_Table_0"]/tbody/tr[{count}]/td[3]/a'))).text) 40 | except: 41 | print("There is no stock to trade tomorrow !!!") 42 | break 43 | #stock=driver.find_element_by_xpath('//*[@id="DataTables_Table_0"]/tbody/tr[1]/td[3]/a').text 44 | write=open('stock_selection.txt','w') 45 | for i in stock: 46 | write.write(i) 47 | write.write('\n') 48 | write.close() 49 | m.message(f'Selected the following stock to trade tomorrow is {stock}') 50 | if len(stock)==0: 51 | #driver.get('https://chartink.com/screener/copy-monthly-volume-gainer-in-last-5-years-1') 52 | #driver.get('https://chartink.com/screener/copy-positive-price-volume-movement-weekly') 53 | driver.get('https://chartink.com/screener/three-week-red-or-green') 54 | sleep(10) 55 | stock=[] 56 | count=0 57 | driver.find_element_by_xpath('//*[@id="DataTables_Table_0"]/thead/tr/th[7]').click() 58 | driver.find_element_by_xpath('//*[@id="DataTables_Table_0"]/thead/tr/th[7]').click() 59 | while count<25 : 60 | count+=1 61 | try: 62 | stock.append(WebDriverWait(driver,2).until(EC.presence_of_element_located((By.XPATH,f'//*[@id="DataTables_Table_0"]/tbody/tr[{count}]/td[3]/a'))).text) 63 | except: 64 | print("There is no stock to trade tomorrow !!!") 65 | break 66 | #stock=driver.find_element_by_xpath('//*[@id="DataTables_Table_0"]/tbody/tr[1]/td[3]/a').text 67 | write=open('stock_selection.txt','w') 68 | for i in stock: 69 | write.write(i) 70 | write.write('\n') 71 | write.close() 72 | m.message(f'Selected the following stock to trade tomorrow is {stock}') 73 | driver.close() 74 | import os 75 | os.system('screen -dms fyersallowstock ipython3 fyers/intraday_allow_check.py') -------------------------------------------------------------------------------- /fyers/order.py: -------------------------------------------------------------------------------- 1 | from fyers.login import login 2 | from common import message as m 3 | from fyers.script import name_to_script 4 | from fyers.quote import quote 5 | from fyers.stoploss_percentage import percentage 6 | from math import floor 7 | class order: 8 | def __init__(self,fyers): 9 | self.q = quote(fyers) 10 | self.fyers=fyers.fyers 11 | self.tokens_list = [] 12 | def position_symbol(self): 13 | sym={} 14 | id={} 15 | for i in self.fyers.positions()['netPositions']: 16 | if i['netQty']!=0 : 17 | sym.update({i['symbol']:i['side']}) 18 | id.update({i['symbol']:i['id']}) 19 | return sym,id 20 | 21 | def position_id(self): 22 | pos=[] 23 | sym=self.position_symbol() 24 | for i in self.fyers.orderbook()['orderBook']: 25 | for j in sym: 26 | if i['symbol']==j: 27 | pos.append(i['orderNumStatus']) 28 | return pos 29 | 30 | def predict_order_id(self): 31 | posi=[] 32 | for i in self.position_id(): 33 | a=i.split(':') 34 | b=a[0].split('-') 35 | c[-1]=b[-1] 36 | posi.append(''.join(c)) 37 | return posi 38 | 39 | def buy_co(self,name,stoploss=0,buy_sell=1): 40 | name=name_to_script(name) 41 | data = { 42 | "symbol" : name, 43 | "qty" : 1, 44 | "type" : 2, 45 | "side" : buy_sell, 46 | "productType" : "CO", 47 | "limitPrice" : 0, 48 | "stopPrice" : 0, 49 | "disclosedQty" : 0, 50 | "validity" : "DAY", 51 | "offlineOrder" : "False", 52 | "stopLoss" : stoploss, 53 | "takeProfit" : 0 54 | } 55 | value=self.tokens_list.append(self.fyers.place_order(data)) 56 | print(self.tokens_list[-1]) 57 | trade_message=self.tokens_list[-1]['message'] 58 | if buy_sell ==-1: 59 | m.message(f'Traded (sold) {name} :{trade_message}') 60 | if buy_sell==1: 61 | m.message(f'Traded (Brought) {name} : {trade_message}') 62 | return value 63 | 64 | def sell_co(self,name): 65 | id=self.position_id()[2] 66 | ii=self.fyers.cancel_order( 67 | data = { 68 | "id" : id, 69 | "type" : "2" 70 | } 71 | ) 72 | m.message(f"{name}order tried to exit : {ii['message']}") 73 | def sell(self,name): 74 | name_script=name_to_script(name) 75 | symbol=self.position_symbol()[1][name_script] 76 | data = { 77 | "id": symbol 78 | } 79 | ii=self.fyers.exit_positions(data) 80 | m.message(f"{name} order tried to exit : {ii['message']}") 81 | def buy(self,name,qty=1,buy_sell=1): 82 | name_script=name_to_script(name) 83 | data = { 84 | "symbol": name_script, 85 | "qty": qty, 86 | "type": 2, 87 | "side": buy_sell, 88 | "productType": "INTRADAY", 89 | "limitPrice": 0, 90 | "stopPrice": 0, 91 | "validity": "DAY", 92 | "disclosedQty": 0, 93 | "offlineOrder": "False", 94 | "stopLoss":0, 95 | "takeProfit": 0 96 | } 97 | ii=self.fyers.place_order(data) 98 | value = self.tokens_list.append(ii) 99 | print(self.tokens_list[-1]) 100 | trade_message = self.tokens_list[-1]['message'] 101 | if buy_sell == -1: 102 | m.message(f'Traded (sold) {name} ,quantity : {qty} : {trade_message}') 103 | if buy_sell == 1: 104 | m.message(f'Traded (Brought) {name} , quantity : {qty} : {trade_message}') 105 | 106 | def no_of_stocks(self,name,percent=100,margin=5): 107 | name=name_to_script(name) 108 | ltp=self.q.quote(name) 109 | f=(self.fyers.funds()['fund_limit'][0]['equityAmount']) 110 | p=percentage(f, percent) 111 | return floor((p*margin)/ltp) 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /common/backtest_macd.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | 3 | import backtrader as bt 4 | from tqdm.auto import tqdm 5 | 6 | pbar = tqdm(desc='Opt runs', leave=True, position=1, unit='run', colour='violet') 7 | from tabnanny import verbose 8 | import pandas as pd 9 | data=pd.read_csv('/home/ubuntu/Downloads/nifty_10min_data.csv',parse_dates=True) 10 | data=data.dropna() 11 | from datetime import datetime 12 | import backtrader as bt 13 | import backtrader as bt 14 | import numpy as np 15 | from pandas import DataFrame 16 | 17 | 18 | 19 | class MACD(bt.Strategy): 20 | params = (('fast_LBP', 12), ('slow_LBP', 26), ('max_position', 1), ('signal_LBP', 9)) 21 | 22 | def log(self, txt, dt=None): 23 | ''' Logging function for this strategy''' 24 | dt = dt or self.datas[0].datetime.date(0) 25 | print('%s, %s' % (dt.isoformat(), txt)) 26 | 27 | def __init__(self): 28 | from backtrader.indicators import SMA,EMA 29 | self.fast_EMA = EMA(self.data, period=self.params.fast_LBP) 30 | self.slow_EMA = EMA(self.data, period=self.params.slow_LBP) 31 | 32 | self.MACD = self.fast_EMA - self.slow_EMA 33 | self.Signal = EMA(self.MACD, period=self.params.signal_LBP) 34 | self.Crossing = bt.indicators.CrossOver(self.MACD, self.Signal, plotname='Buy_Sell_Line') 35 | self.Hist = self.MACD - self.Signal 36 | 37 | def notify_order(self, order): 38 | if order.status in [order.Submitted, order.Accepted]: 39 | # Buy/Sell order submitted/accepted to/by broker - Nothing to do 40 | return 41 | 42 | # Check if an order has been completed 43 | # Attention: broker could reject order if not enough cash 44 | if order.status in [order.Completed]: 45 | if order.isbuy(): 46 | #self.log('BUY EXECUTED, %.2f' % order.executed.price) 47 | pass 48 | elif order.issell(): 49 | #self.log('SELL EXECUTED, %.2f' % order.executed.price) 50 | pass 51 | 52 | self.bar_executed = len(self) 53 | 54 | elif order.status in [order.Canceled, order.Margin, order.Rejected]: 55 | self.log('Order Canceled/Margin/Rejected') 56 | 57 | # Write down: no pending order 58 | self.order = None 59 | 60 | def next(self): 61 | 62 | # If MACD is above Signal line 63 | if self.Crossing > 0: 64 | if self.position.size < self.params.max_position: 65 | #self.close() 66 | self.buy() 67 | 68 | # If MACD is below Signal line 69 | elif self.Crossing < 0: 70 | if self.position.size > 0: 71 | self.close() 72 | #self.sell() 73 | 74 | 75 | def bt_opt_callback(cb): 76 | pbar.update() 77 | 78 | 79 | cerebro = bt.Cerebro() 80 | #cerebro.addstrategy(MACD) 81 | strats = cerebro.optstrategy( 82 | MACD, 83 | fast_LBP = range(10, 12), 84 | slow_LBP = range(10,12), 85 | #signal_LBP=range(1,100) 86 | ) 87 | #cerebro.addstrategy(strats) 88 | df=data.copy() 89 | #f['dt'] = pd.to_datetime(df['dt']).dt.tz_convert(None) 90 | df['date'] = pd.to_datetime(df['date']).dt.tz_convert('Asia/Kolkata') 91 | df.set_index('date', inplace=True) 92 | df=df.dropna() 93 | feed = bt.feeds.PandasData(dataname=df.dropna()) 94 | cerebro.adddata(feed) 95 | import backtrader.analyzers as btanalyzers 96 | cerebro.broker.setcommission(commission=0.000945) 97 | #cerebro.addsizer(bt.sizers.PercentSizer, percents=10) 98 | #cerebro.addanalyzer(btanalyzers.SharpeRatio, _name="sharpe") 99 | #cerebro.addanalyzer(btanalyzers.DrawDown, _name="drawdown") 100 | #cerebro.addanalyzer(btanalyzers.Returns, _name="returns") 101 | #cerebro.addanalyzer(btanalyzers.PyFolio,_name='portifolo') 102 | cerebro.optcallback(cb=bt_opt_callback) 103 | back=cerebro.run(stdstats=False,optreturn=True,optdatas=True) 104 | print('Final Portfolio Value: %.2f' % cerebro.broker.getvalue()) 105 | #cerebro.plot() 106 | results =back 107 | strats = [x[0] for x in results] # flatten the result 108 | for i, strat in enumerate(strats): 109 | rets = strat.analyzers.returns.get_analysis() 110 | print('Strat {} Name {}:\n - analyzer: {}\n'.format( 111 | i, strat.__class__.__name__, rets)) 112 | 113 | 114 | -------------------------------------------------------------------------------- /common/backtestsuperrsi.py: -------------------------------------------------------------------------------- 1 | 2 | from common.indicator import SuperTrend 3 | 4 | 5 | 6 | from backtesting import Backtest, Strategy 7 | from backtesting import Backtest, Strategy 8 | from backtesting.lib import crossover 9 | import pandas as pd 10 | 11 | data = pd.read_csv('/home/ubuntu/Downloads/5min_N50_10yr.csv', parse_dates=True) 12 | data = data.dropna() 13 | #data = data[-20000:] 14 | import pandas as pd 15 | from ta.momentum import RSIIndicator 16 | import bt 17 | data = data.dropna() 18 | #data.columns=['Open', 'High', 'Low', 'Close'] 19 | data=data.set_index('Date') 20 | #data=data.set_index('ts') 21 | data.index=pd.to_datetime(data.index) 22 | rr=0 23 | # RSIIndicator(data['Close']).rsi() 24 | def rs(data): 25 | #print(data) 26 | global rr 27 | if type(rr)==int: 28 | rr= RSIIndicator(data['Close']).rsi() 29 | return rr 30 | from backtesting import Backtest, Strategy 31 | from backtesting import Backtest, Strategy 32 | from backtesting.lib import crossover 33 | import pandas as pd 34 | 35 | import pandas as pd 36 | # data=data[-8000:] 37 | import pandas as pd 38 | from ta.momentum import RSIIndicator 39 | from ta.trend import ADXIndicator 40 | #from common.indicator import SuperTrend 41 | import numpy as np 42 | from tqdm import tqdm 43 | 44 | bar=tqdm(total=100*100/4) 45 | 46 | hhh = pd.DataFrame() 47 | it = 0 48 | 49 | 50 | '''def rs(data): 51 | global hhh 52 | global it 53 | if len(hhh) == 0: 54 | hhh = ADXIndicator(low=data['Low'], close=data['Close'], high=data['High']).adx() 55 | # hhh=RSIIndicator(data['Close']).rsi() 56 | # print(data) 57 | # print(data) 58 | it += 1 59 | print(it) 60 | return hhh 61 | ''' 62 | # return ADXIndicator(low=data['Low'],close=data['Close'],high=data['High']).adx() 63 | 64 | p=0 65 | def st(period, multiplier, data): 66 | global bar 67 | global p 68 | bar.update(1) 69 | if type(p)==int: 70 | p = SuperTrend(data, period, multiplier, ohlc=['Open', 'High', 'Low', 'Close']) 71 | # trend=p['STX_80_3.6'] 72 | # trend[trend=='down']=0 73 | # trend[trend=='up']=1 74 | # trend[trend=='nan']=np.nan 75 | return p[f'ST_{period}_{multiplier}'] 76 | i=0 77 | p=0 78 | def st1(period, multiplier, data): 79 | global bar 80 | global p 81 | global i 82 | bar.update(1) 83 | if type(p)==int or type(i)==int: 84 | p = SuperTrend(data, period, multiplier, ohlc=['Open', 'High', 'Low', 'Close']) 85 | i=p[f'STX_{period}_{multiplier}'] 86 | i[i=='down']=0 87 | i[i=='up']=1 88 | # trend=p['STX_80_3.6'] 89 | # trend[trend=='down']=0 90 | # trend[trend=='up']=1 91 | # trend[trend=='nan']=np.nan 92 | return i 93 | 94 | class SmaCross(Strategy): 95 | period = 38 96 | multiplier = 12.5 97 | buyrsi=45 98 | sellrsi=15 99 | def init(self): 100 | price = self.data.Close 101 | # self.ma1 = self.I(SMA, price, 50) 102 | # self.ma2 = self.I(SMA, price, 200) 103 | self.trend = self.I(st, self.period, self.multiplier, self.data.df,plot=False) 104 | self.rsi = self.I(rs, self.data.df,plot=False) 105 | self.trend1=self.I(st1,self.period,self.multiplier,self.data.df,plot=False) 106 | # self.macd=self.I(ma,price,fast=self.fast,slow=self.slow,sig=self.sig) 107 | # self.macd_sig=macd=self.I(ma1,price,fast=self.fast,slow=self.slow,sig=self.sig) 108 | 109 | def next(self): 110 | if self.trend <= self.data.Close and not self.position.is_long: 111 | self.position.close() 112 | #if self.rsi > self.h: 113 | if self.buyrsi= self.data.Close and not self.position.is_short: 116 | self.position.close() 117 | if self.sellrsi>self.rsi and self.trend1[-2]==1: 118 | self.sell() 119 | bt = Backtest(data, SmaCross, commission=0.002, trade_on_close=False, cash=1000000000000, exclusive_orders=True) 120 | 121 | stats1 = bt.run() 122 | bt.plot(resample=False) 123 | import numpy as np 124 | 125 | 126 | stats = bt.optimize(#period=range(5, 1000, 5), 127 | #multiplier=np.arange(5,50,0.5).tolist(), 128 | #h=range(1, 100, 5), 129 | buyrsi=range(1,100), 130 | sellrsi=range(1,100), 131 | maximize='Win Rate [%]', return_heatmap=True) 132 | -------------------------------------------------------------------------------- /common/backtestsupersma.py: -------------------------------------------------------------------------------- 1 | from backtesting import Backtest, Strategy 2 | from backtesting import Backtest, Strategy 3 | from backtesting.lib import crossover 4 | import pandas as pd 5 | from common.indicator import SuperTrend 6 | 7 | 8 | from fyers.accounts_login import login_accounts 9 | from common.indicator import SuperTrend 10 | from time import sleep 11 | import time 12 | from common import message as m 13 | import sys 14 | from fyers.order import order 15 | import datetime 16 | from fyers.script import name_to_script 17 | from fyers.quote import quote 18 | from fyers.stoploss_percentage import percentage 19 | from fyers.live import full_data 20 | import pandas as pd 21 | import os 22 | from time import sleep 23 | import ta 24 | stock_name='NSE:NIFTY50-INDEX' 25 | name_script=name_to_script(stock_name) 26 | accounts=login_accounts() 27 | l=full_data(accounts[0]) 28 | #data=l.full_data(stock_name) 29 | data=l.full_data(stock_name,resolution=5,days=98) 30 | data = pd.read_csv('/home/ubuntu/Downloads/5min_N50_10yr.csv', parse_dates=True) 31 | #data=data[-30000:] 32 | data = data.dropna() 33 | #data.columns=['Open', 'High', 'Low', 'Close'] 34 | data=data.set_index('Date') 35 | #data=data.set_index('ts') 36 | data.index=pd.to_datetime(data.index) 37 | #data=data[-8000:] 38 | import pandas as pd 39 | from ta.momentum import RSIIndicator 40 | from ta.trend import ADXIndicator 41 | #from common.indicator import SuperTrend 42 | import numpy as np 43 | from tqdm import tqdm 44 | 45 | from backtesting.test import SMA 46 | 47 | bar=tqdm(total=7600*10/4) 48 | 49 | hhh = pd.DataFrame() 50 | it = 0 51 | 52 | 53 | def rs(data): 54 | #global hhh 55 | #global it 56 | if len(hhh) == 0: 57 | hhh = ADXIndicator(low=data['Low'], close=data['Close'], high=data['High']).adx() 58 | # hhh=RSIIndicator(data['Close']).rsi() 59 | # print(data) 60 | # print(data) 61 | #it += 1 62 | #print(it) 63 | return hhh 64 | 65 | # return ADXIndicator(low=data['Low'],close=data['Close'],high=data['High']).adx() 66 | 67 | 68 | def st(period, multiplier, data): 69 | global bar 70 | bar.update(1) 71 | p = SuperTrend(data, period, multiplier, ohlc=['Open', 'High', 'Low', 'Close']) 72 | # trend=p['STX_80_3.6'] 73 | # trend[trend=='down']=0 74 | # trend[trend=='up']=1 75 | # trend[trend=='nan']=np.nan 76 | return p[f'ST_{period}_{multiplier}'] 77 | 78 | 79 | def SMA(values, n): 80 | """ 81 | Return simple moving average of `values`, at 82 | each step taking into account `n` previous values. 83 | """ 84 | #print(n) 85 | return pd.Series(values).rolling(n).mean() 86 | class SmaCross(Strategy): 87 | period = 480 88 | multiplier = 16.4 89 | n1=200 90 | n2=200 91 | def init(self): 92 | price = self.data.Close 93 | # self.ma1 = self.I(SMA, price, 50) 94 | # self.ma2 = self.I(SMA, price, 200) 95 | close = self.data.Close 96 | self.sma1 = self.I(SMA, close, self.n1) 97 | self.sma2 = self.I(SMA, close, self.n2) 98 | self.trend = self.I(st, self.period, self.multiplier, self.data.df) 99 | #self.rsi = self.I(rs, self.data.df) 100 | # self.macd=self.I(ma,price,fast=self.fast,slow=self.slow,sig=self.sig) 101 | # self.macd_sig=macd=self.I(ma1,price,fast=self.fast,slow=self.slow,sig=self.sig) 102 | 103 | def next(self): 104 | if self.trend <= self.data.Close and not self.position.is_long: 105 | self.position.close() 106 | #if self.rsi > self.h: 107 | if self.sma1>self.data.Close: 108 | self.buy() 109 | elif self.trend >= self.data.Close and not self.position.is_short: 110 | self.position.close() 111 | #if self.rsi < self.h: 112 | if self.sma1self.v: 113 | self.sell() 114 | if (self.trend[-2]==0 and self.trend[-1]==1) and not self.position.is_long: 115 | self.position.close() 116 | class SmaCross1(Strategy): 117 | period =252 118 | multiplier = 13 119 | v=30 120 | def init(self): 121 | price = self.data.Close 122 | # self.ma1 = self.I(SMA, price, 50) 123 | # self.ma2 = self.I(SMA, price, 200) 124 | self.trend =self.I( st, self.period, self.multiplier, self.data.df,plot=False) 125 | #self.trend1 =self.I(st, self.period1, self.multiplier1, self.data.df,plot=False) 126 | self.tren =self.I( st1, self.period, self.multiplier, self.data.df) 127 | self.tre =self.I(st1, self.period1, self.multiplier1, self.data.df) 128 | #self.vix=self.I(vix) 129 | #self.rsi = self.I(rs, self.data.df) 130 | # self.macd=self.I(ma,price,fast=self.fast,slow=self.slow,sig=self.sig) 131 | # self.macd_sig=macd=self.I(ma1,price,fast=self.fast,slow=self.slow,sig=self.sig) 132 | 133 | def next(self): 134 | #print(self.trend) 135 | #pdb.set_trace() 136 | if (self.trend[-2]==0 and self.trend[-1]==1) and not self.position.is_long: 137 | #self.position.close() 138 | #if self.rsi > self.h: 139 | #if self.vix>self.v: 140 | self.buy() 141 | if (self.trend[-2]==1 and self.trend[-1]==0) and not self.position.is_short: 142 | self.position.close() 143 | 144 | data=pd.read_csv('https://drive.google.com/drive/folders/1TrRY8Al91F-xuWA7j2FQZWWfxRNNK1Mf') 145 | bt = Backtest(data, SmaCross, commission=0.002, trade_on_close=False, cash=1000000000000, exclusive_orders=True) 146 | import numpy as np 147 | def test(): 148 | stats1 = bt.run() 149 | #bt.plot() 150 | stats1 = bt.optimize(period=range(2, 500, 10), 151 | multiplier=np.arange(3,20,1).tolist(), 152 | #period1=range(2, 500, 10), 153 | #multiplier1=np.arange(3,20,1).tolist(), 154 | maximize='Win Rate [%]', return_heatmap=True,max_tries=400) 155 | print(stats1) 156 | try: 157 | bt.plot() 158 | except : 159 | pass 160 | return stats1[0]._strategy.period,round(stats1[0]._strategy.multiplier,3) 161 | 162 | 163 | 164 | 165 | ''' 166 | def next(self): 167 | if self.trend == 0 and not self.position.is_long: 168 | self.position.close() 169 | self.buy() 170 | elif self.trend == 1 and not self.position.is_short: 171 | self.position.close() 172 | self.sell()''' -------------------------------------------------------------------------------- /common/find_supertrend_reverse.py: -------------------------------------------------------------------------------- 1 | import os 2 | from common import message as m 3 | import pandas as pd 4 | from time import gmtime, strftime 5 | import time 6 | from datetime import timedelta 7 | from tqdm import tqdm 8 | from pandas.io.parsers import read_csv 9 | start_time = time.monotonic() 10 | try: 11 | read=open('stock_selection.txt','r') 12 | except: 13 | read = open('fyers/stock_selection.txt', 'r') 14 | stock_name=read.read().split('\n') 15 | read.close() 16 | stock_name=stock_name[0] 17 | from fyers.accounts_login import login_accounts 18 | from fyers.script import name_to_script 19 | name_script=name_to_script(stock_name) 20 | accounts=login_accounts() 21 | print(name_script) 22 | m.message(f'searching for supertrend value for {name_script} stock , It takes approximately 15 to 20 hours to find optimized value of supertrend for any stock , you will get message after searching is completed') 23 | from fyers.live import full_data 24 | a=full_data(accounts[0]) 25 | try: 26 | data=a.full_data(name_script,days=10) 27 | except Exception as error: 28 | m.message("Data is not availible from fyers server to search optimized value for given stock {name_script} , Trying to request for less data ... ") 29 | try: 30 | data=a.full_data(name_script,days=90) 31 | except: 32 | m.message("Final Call , it won't try again ... , Data is not availible from fyers server to search optimized value for given stock {name_script} ") 33 | 34 | realdata = data.copy() 35 | from common.indicator import * 36 | import numpy as np 37 | d = pd.DataFrame(columns=('period', 'multiplier', 'buy', 'sell', 'total')) 38 | 39 | def calculate(a, b, data1, d=d): 40 | b = 0 41 | # data1=realdata.copy() 42 | for b in (np.arange(5,8, 0.1)): 43 | t = SuperTrend(data1, a, b).iloc[2000:] 44 | (close, trend) = ((t['close'], t[f'STX_{a}_{b}'])) 45 | close = close.to_numpy() 46 | trend = trend.to_numpy() 47 | buyposition = 0 48 | sellposition = 0 49 | buyprofit = 0 50 | sellprofit = 0 51 | sell = [] 52 | buy = [] 53 | for i in range(len(trend)): 54 | if sellposition == 0: 55 | if trend[i] == 'down' and trend[i - 1] == 'up': 56 | #sellposition = close[i] 57 | buyposition = close[i] 58 | if buyposition == 0: 59 | if trend[i] == 'up' and trend[i - 1] == 'down': 60 | 61 | sellposition = close[i] 62 | if trend[i] == 'down' and trend[i - 1] == 'up' and sellposition != 0: 63 | 64 | sellprofit = sellposition - close[i] + sellprofit 65 | # print(sellprofit) 66 | buyposition = close[i] 67 | buy.append(buyprofit) 68 | if trend[i] == 'up' and trend[i - 1] == 'down' and buyposition != 0: 69 | buyprofit = close[i] - buyposition + buyprofit 70 | # print(buyprofit) 71 | sellposition = close[i] 72 | sell.append(sellprofit) 73 | # plt.plot(sell) 74 | # plt.plot(buy) 75 | d = d.append( 76 | {'period': a, 'multiplier': b, 'buy': buyprofit, 'sell': sellprofit, 'total': buyprofit + sellprofit}, 77 | ignore_index=True) 78 | #print([a, b, buyprofit, sellprofit, buyprofit + sellprofit]) 79 | return d 80 | 81 | from joblib import Parallel, delayed 82 | 83 | import multiprocessing 84 | 85 | num_cores = multiprocessing.cpu_count() 86 | print(strftime("%Y-%m-%d %H:%M:%S", gmtime())) 87 | results = Parallel(n_jobs=num_cores)(delayed(calculate)(j, 0, data) for j in tqdm(range(40, 1000),desc='main :')) 88 | o = pd.DataFrame() 89 | for i in results: 90 | o = o.append(i) 91 | o=o.sort_values(['total'],ascending=[0]) 92 | pd.DataFrame(o).to_csv('supertrend_selection.csv') 93 | pd.DataFrame(o).to_csv(f"supertrend_csv/{name_script.split(':')[1].split('-')[0]}.csv") 94 | a=pd.read_csv('supertrend_selection.csv') 95 | period=round(a['period'][100]) 96 | multiplier=round(a['multiplier'][100],1) 97 | m.message(f"supertrend values are {period},{multiplier} for the stock {name_script} with the data of past one month") 98 | writ=open('supertrend_values.txt','w') 99 | writ.write(str(period)) 100 | writ.write('\n') 101 | writ.write(str(multiplier)) 102 | writ.close() 103 | jjj=open(f"supertrend_txt/{name_script.split(':')[1].split('-')[0]}.txt",'w') 104 | jjj.write(str(period)) 105 | jjj.write('\n') 106 | jjj.write(str(multiplier)) 107 | jjj.close() 108 | end_time = time.monotonic() 109 | print(timedelta(seconds=end_time - start_time)) 110 | timetook=str(timedelta(seconds=end_time - start_time)) 111 | a=a[['period','multiplier','buy','sell','total']] 112 | #with pd.option_context('display.max_rows', None, 'display.max_columns', None): # more options can be specified also 113 | # m.message(str(a.head(91))) 114 | # 115 | #with pd.option_context('display.max_rows', None, 'display.max_columns', None): # more options can be specified also 116 | # m.message(str(a.iloc[91:90+91])) 117 | 118 | #m.message(f"Time took to run the supertrend searching algorithm for {name_script.split(':')[1].split('-')[0]} stock is {timetook}") 119 | print(strftime("%Y-%m-%d %H:%M:%S", gmtime())) 120 | import sys 121 | sys.exit() 122 | d = pd.DataFrame(columns=('period', 'multiplier', 'buy', 'sell', 'total')) 123 | def calculate1(a, b, data1): 124 | # data1=realdata.copy() 125 | global d 126 | t = SuperTrend(data1, a, b).iloc[2000:] 127 | (close, trend) = ((t['close'], t[f'STX_{a}_{b}'])) 128 | close = close.to_numpy() 129 | trend = trend.to_numpy() 130 | buyposition = 0 131 | sellposition = 0 132 | buyprofit = 0 133 | sellprofit = 0 134 | sell = [] 135 | buy = [] 136 | for i in range(len(trend)): 137 | if sellposition == 0: 138 | if trend[i] == 'down' and trend[i - 1] == 'up': 139 | sellposition = close[i] 140 | if buyposition == 0: 141 | if trend[i] == 'up' and trend[i - 1] == 'down': 142 | buyposition = close[i] 143 | if trend[i] == 'down' and trend[i - 1] == 'up' and buyposition != 0: 144 | buyprofit = close[i] - buyposition + buyprofit 145 | # print(buyprofit) 146 | sellposition = close[i] 147 | sell.append(sellprofit) 148 | if trend[i] == 'up' and trend[i - 1] == 'down' and sellposition != 0: 149 | sellprofit = sellposition - close[i] + sellprofit 150 | # print(sellprofit) 151 | buyposition = close[i] 152 | buy.append(buyprofit) 153 | # plt.plot(sell) 154 | # plt.plot(buy) 155 | d = d.append( 156 | {'period': a, 'multiplier': b, 'buy': buyprofit, 'sell': sellprofit, 'total': buyprofit + sellprofit}, 157 | ignore_index=True) 158 | #print([a, b, buyprofit, sellprofit, buyprofit + sellprofit]) 159 | return d 160 | per=list(a['period'])[:10000] 161 | mul=list(a['multiplier'])[:10000] 162 | num_cores = multiprocessing.cpu_count() 163 | print(strftime("%Y-%m-%d %H:%M:%S", gmtime())) 164 | results = Parallel(n_jobs=num_cores)(delayed(calculate1)(int(per[j]),mul[j], data.iloc[-3500:]) for j in tqdm(range(len(per)),desc='last_main :')) 165 | v=results 166 | v = pd.DataFrame() 167 | for i in results: 168 | v = v.append(i) 169 | v=v.sort_values(['total'],ascending=[0]) 170 | v.to_csv('filtered.csv') 171 | a=pd.read_csv('filtered.csv') 172 | period=round(a['period'][0]) 173 | multiplier=round(a['multiplier'][0],1) 174 | m.message(f"supertrend values are {period},{multiplier} for the stock {name_script} with the data of past 8 days") 175 | writ=open('supertrend_values.txt','w') 176 | writ.write(str(period)) 177 | writ.write('\n') 178 | writ.write(str(multiplier)) 179 | writ.close() 180 | jjj=open(f"supertrend_txt/{name_script.split(':')[1].split('-')[0]}.txt",'w') 181 | jjj.write(str(period)) 182 | jjj.write('\n') 183 | jjj.write(str(multiplier)) 184 | jjj.close() 185 | '''from threading import Thread 186 | th=[] 187 | for i in range(len(per)): 188 | th.append(Thread(target=calculate1,args=(int(per[i]),mul[i],data.iloc[-5000:])))#.start() 189 | 190 | for i in th: 191 | i.start()''' 192 | -------------------------------------------------------------------------------- /common/find_stock_supertrend_values.py: -------------------------------------------------------------------------------- 1 | import os 2 | from common import message as m 3 | import pandas as pd 4 | from time import gmtime, strftime 5 | import time 6 | from datetime import timedelta 7 | from tqdm import tqdm 8 | from pandas.io.parsers import read_csv 9 | start_time = time.monotonic() 10 | try: 11 | read=open('stock_selection.txt','r') 12 | except: 13 | read = open('fyers/stock_selection.txt', 'r') 14 | stock_name=read.read().split('\n') 15 | read.close() 16 | stock_name=stock_name[0] 17 | from fyers.accounts_login import login_accounts 18 | from fyers.script import name_to_script 19 | name_script=name_to_script(stock_name) 20 | accounts=login_accounts() 21 | print(name_script) 22 | m.message(f'searching for supertrend value for {name_script} stock , It takes approximately 15 to 20 hours to find optimized value of supertrend for any stock , you will get message after searching is completed') 23 | from fyers.live import full_data 24 | a=full_data(accounts[0]) 25 | try: 26 | data=a.full_data(name_script,days=10) 27 | except Exception as error: 28 | m.message("Data is not availible from fyers server to search optimized value for given stock {name_script} , Trying to request for less data ... ") 29 | try: 30 | data=a.full_data(name_script,days=90) 31 | except: 32 | m.message("Final Call , it won't try again ... , Data is not availible from fyers server to search optimized value for given stock {name_script} ") 33 | 34 | realdata = data.copy() 35 | from common.indicator import * 36 | import numpy as np 37 | d = pd.DataFrame(columns=('period', 'multiplier', 'buy', 'sell', 'total')) 38 | 39 | def calculate(a, b, data1, d=d): 40 | b = 0 41 | # data1=realdata.copy() 42 | for b in (np.arange(5,8, 0.1)): 43 | t = SuperTrend(data1, a, b).iloc[2000:] 44 | (close, trend) = ((t['close'], t[f'STX_{a}_{b}'])) 45 | close = close.to_numpy() 46 | trend = trend.to_numpy() 47 | buyposition = 0 48 | sellposition = 0 49 | buyprofit = 0 50 | sellprofit = 0 51 | sell = [] 52 | buy = [] 53 | for i in range(len(trend)): 54 | if sellposition == 0: 55 | if trend[i] == 'down' and trend[i - 1] == 'up': 56 | sellposition = close[i] 57 | if buyposition == 0: 58 | if trend[i] == 'up' and trend[i - 1] == 'down': 59 | buyposition = close[i] 60 | if trend[i] == 'down' and trend[i - 1] == 'up' and buyposition != 0: 61 | buyprofit = close[i] - buyposition + buyprofit 62 | # print(buyprofit) 63 | sellposition = close[i] 64 | sell.append(sellprofit) 65 | if trend[i] == 'up' and trend[i - 1] == 'down' and sellposition != 0: 66 | sellprofit = sellposition - close[i] + sellprofit 67 | # print(sellprofit) 68 | buyposition = close[i] 69 | buy.append(buyprofit) 70 | # plt.plot(sell) 71 | # plt.plot(buy) 72 | d = d.append( 73 | {'period': a, 'multiplier': b, 'buy': buyprofit, 'sell': sellprofit, 'total': buyprofit + sellprofit}, 74 | ignore_index=True) 75 | #print([a, b, buyprofit, sellprofit, buyprofit + sellprofit]) 76 | return d 77 | 78 | from joblib import Parallel, delayed 79 | 80 | import multiprocessing 81 | 82 | num_cores = multiprocessing.cpu_count() 83 | print(strftime("%Y-%m-%d %H:%M:%S", gmtime())) 84 | results = Parallel(n_jobs=num_cores)(delayed(calculate)(j, 0, data) for j in tqdm(range(40, 1000),desc='main :')) 85 | o = pd.DataFrame() 86 | for i in results: 87 | o = o.append(i) 88 | o=o.sort_values(['total'],ascending=[0]) 89 | pd.DataFrame(o).to_csv('supertrend_selection.csv') 90 | pd.DataFrame(o).to_csv(f"supertrend_csv/{name_script.split(':')[1].split('-')[0]}.csv") 91 | a=pd.read_csv('supertrend_selection.csv') 92 | period=round(a['period'][100]) 93 | multiplier=round(a['multiplier'][100],1) 94 | m.message(f"supertrend values are {period},{multiplier} for the stock {name_script} with the data of past one month") 95 | writ=open('supertrend_values.txt','w') 96 | writ.write(str(period)) 97 | writ.write('\n') 98 | writ.write(str(multiplier)) 99 | writ.close() 100 | jjj=open(f"supertrend_txt/{name_script.split(':')[1].split('-')[0]}.txt",'w') 101 | jjj.write(str(period)) 102 | jjj.write('\n') 103 | jjj.write(str(multiplier)) 104 | jjj.close() 105 | end_time = time.monotonic() 106 | print(timedelta(seconds=end_time - start_time)) 107 | timetook=str(timedelta(seconds=end_time - start_time)) 108 | a=a[['period','multiplier','buy','sell','total']] 109 | #with pd.option_context('display.max_rows', None, 'display.max_columns', None): # more options can be specified also 110 | # m.message(str(a.head(91))) 111 | # 112 | #with pd.option_context('display.max_rows', None, 'display.max_columns', None): # more options can be specified also 113 | # m.message(str(a.iloc[91:90+91])) 114 | 115 | #m.message(f"Time took to run the supertrend searching algorithm for {name_script.split(':')[1].split('-')[0]} stock is {timetook}") 116 | print(strftime("%Y-%m-%d %H:%M:%S", gmtime())) 117 | import sys 118 | sys.exit() 119 | d = pd.DataFrame(columns=('period', 'multiplier', 'buy', 'sell', 'total')) 120 | def calculate1(a, b, data1): 121 | # data1=realdata.copy() 122 | global d 123 | t = SuperTrend(data1, a, b).iloc[2000:] 124 | (close, trend) = ((t['close'], t[f'STX_{a}_{b}'])) 125 | close = close.to_numpy() 126 | trend = trend.to_numpy() 127 | buyposition = 0 128 | sellposition = 0 129 | buyprofit = 0 130 | sellprofit = 0 131 | sell = [] 132 | buy = [] 133 | for i in range(len(trend)): 134 | if sellposition == 0: 135 | if trend[i] == 'down' and trend[i - 1] == 'up': 136 | sellposition = close[i] 137 | if buyposition == 0: 138 | if trend[i] == 'up' and trend[i - 1] == 'down': 139 | buyposition = close[i] 140 | if trend[i] == 'down' and trend[i - 1] == 'up' and buyposition != 0: 141 | buyprofit = close[i] - buyposition + buyprofit 142 | # print(buyprofit) 143 | sellposition = close[i] 144 | sell.append(sellprofit) 145 | if trend[i] == 'up' and trend[i - 1] == 'down' and sellposition != 0: 146 | sellprofit = sellposition - close[i] + sellprofit 147 | # print(sellprofit) 148 | buyposition = close[i] 149 | buy.append(buyprofit) 150 | # plt.plot(sell) 151 | # plt.plot(buy) 152 | d = d.append( 153 | {'period': a, 'multiplier': b, 'buy': buyprofit, 'sell': sellprofit, 'total': buyprofit + sellprofit}, 154 | ignore_index=True) 155 | #print([a, b, buyprofit, sellprofit, buyprofit + sellprofit]) 156 | return d 157 | per=list(a['period'])[:10000] 158 | mul=list(a['multiplier'])[:10000] 159 | num_cores = multiprocessing.cpu_count() 160 | print(strftime("%Y-%m-%d %H:%M:%S", gmtime())) 161 | results = Parallel(n_jobs=num_cores)(delayed(calculate1)(int(per[j]),mul[j], data.iloc[-3500:]) for j in tqdm(range(len(per)),desc='last_main :')) 162 | v=results 163 | v = pd.DataFrame() 164 | for i in results: 165 | v = v.append(i) 166 | v=v.sort_values(['total'],ascending=[0]) 167 | v.to_csv('filtered.csv') 168 | a=pd.read_csv('filtered.csv') 169 | period=round(a['period'][0]) 170 | multiplier=round(a['multiplier'][0],1) 171 | m.message(f"supertrend values are {period},{multiplier} for the stock {name_script} with the data of past 8 days") 172 | writ=open('supertrend_values.txt','w') 173 | writ.write(str(period)) 174 | writ.write('\n') 175 | writ.write(str(multiplier)) 176 | writ.close() 177 | jjj=open(f"supertrend_txt/{name_script.split(':')[1].split('-')[0]}.txt",'w') 178 | jjj.write(str(period)) 179 | jjj.write('\n') 180 | jjj.write(str(multiplier)) 181 | jjj.close() 182 | '''from threading import Thread 183 | th=[] 184 | for i in range(len(per)): 185 | th.append(Thread(target=calculate1,args=(int(per[i]),mul[i],data.iloc[-5000:])))#.start() 186 | 187 | for i in th: 188 | i.start()''' 189 | -------------------------------------------------------------------------------- /fyers/strategy.py: -------------------------------------------------------------------------------- 1 | import os 2 | try: 3 | os.system('rm intimate.txt') 4 | os.system('rm ticks.db') 5 | except: 6 | print('There is an error in removing cache files ...') 7 | count=0 8 | while count<60: 9 | count+=1 10 | try: 11 | stoploss=1 # percentage 12 | percent=100 # percentage of funds to be used to trade 13 | margin=3 14 | adx_limit=2 15 | emergency_start=False 16 | emergency_do_not_stop=False 17 | first_order=True 18 | try: 19 | read=open('stock_selection.txt','r') 20 | except: 21 | read = open('fyers/stock_selection.txt', 'r') 22 | stock_name=read.read().split('\n') 23 | read.close() 24 | stock_name=stock_name[0] 25 | #from fyers.broker_allow_stocks import allow 26 | #allowed_stocks=allow(stock_name) 27 | #stock_name=allowed_stocks[1] 28 | from fyers.accounts_login import login_accounts 29 | from common.indicator import SuperTrend 30 | from time import sleep 31 | import time 32 | from common import message as m 33 | import sys 34 | from fyers.order import order 35 | import datetime 36 | from fyers.script import name_to_script 37 | from fyers.quote import quote 38 | from fyers.stoploss_percentage import percentage 39 | from fyers.live import full_data 40 | import pandas as pd 41 | import os 42 | from time import sleep 43 | import ta 44 | name_script=name_to_script(stock_name) 45 | try: 46 | ddd=open('supertrend_values.txt','r').read().split('\n') 47 | except: 48 | try: 49 | ddd=open(f"supertrend_txt/{name_script.split(':')[1].split('-')[0]}.txt") 50 | except: 51 | ddd=open('supertrend_values_default.txt','r').read().split('\n') 52 | period=int(ddd[0]) 53 | multiplier=float(ddd[1]) 54 | accounts=login_accounts() 55 | m.message(f'{name_script} is selected and supertrend values {period} and {multiplier} are selected for today trading') 56 | intimate=open('intimate.txt','w') 57 | intimate.write('False') 58 | intimate.close() 59 | sleep(7) 60 | l=full_data(accounts[0]) 61 | #data=l.full_data(stock_name) 62 | #data5=l.full_data(stock_name,resolution=5) 63 | fyers=accounts[0].fyers 64 | print(fyers.funds()) 65 | q=quote(accounts[0]) 66 | o=order(accounts[0]) 67 | data = l.full_data(stock_name,days=5) 68 | data5=l.full_data(stock_name,resolution=5,days=5) 69 | wait=False 70 | while not wait: 71 | wait=((0 <= time.localtime().tm_wday <= 4) and (datetime.datetime.strptime( 72 | datetime.datetime.strftime(datetime.datetime.now(), "%d-%m-%Y") + " 09:16:00", 73 | "%d-%m-%Y %H:%M:%S") <= datetime.datetime.now())) 74 | print('waiting market to open (strategy)') 75 | if wait: 76 | break 77 | if emergency_start: 78 | break 79 | #print('waiting') 80 | sleep(1) 81 | 82 | while True: 83 | sleep(4) 84 | data = l.full_data(stock_name,days=5) 85 | data5=l.full_data(stock_name,resolution=5,days=5) 86 | old_trend=SuperTrend(data,period,multiplier)[f'STX_{period}_{multiplier}'][-2] 87 | new_trend=SuperTrend(data,period,multiplier)[f'STX_{period}_{multiplier}'][-1] 88 | pl=fyers.positions()['overall']['pl_total'] 89 | print("P and L is ",pl) 90 | if pl<-50: 91 | o.sell(stock_name) 92 | m.message('Loss is more , so trading stopped !!!') 93 | import sys 94 | sys.exit() 95 | if pl>300: 96 | o.sell(stock_name) 97 | m.message('profit is more , so trading stopped !!!') 98 | import sys 99 | sys.exit() 100 | 101 | print('supertrend value :',SuperTrend(data,period,multiplier)) 102 | #print(data[-1]) 103 | adx_value=ta.trend.ADXIndicator(data5['high'],data5['low'], data5['close'], 14, False).adx()[-1] 104 | print(new_trend) 105 | try: 106 | current_order=o.position_symbol()[0][name_script] 107 | except: 108 | current_order=None 109 | if ((0 <= time.localtime().tm_wday <= 4) and (datetime.datetime.strptime( 110 | datetime.datetime.strftime(datetime.datetime.now(), "%d-%m-%Y") + " 09:16:00", 111 | "%d-%m-%Y %H:%M:%S") <= datetime.datetime.now() <= datetime.datetime.strptime( 112 | datetime.datetime.strftime(datetime.datetime.now(), "%d-%m-%Y") + " 09:17:00", 113 | "%d-%m-%Y %H:%M:%S"))) and first_order: 114 | first_order=False 115 | if new_trend=='up': #buy_sell=1 116 | o.buy(stock_name,buy_sell=-1, qty=o.no_of_stocks(stock_name, percent, margin)) 117 | if new_trend=='down':#buy_sell=-1 118 | o.buy(stock_name, buy_sell=1, qty=o.no_of_stocks(stock_name, percent, margin)) 119 | if (old_trend=='down' and new_trend=='up' ) or (new_trend=='up' and (current_order==1)): #change it to 1 #or current_order==None)): 120 | if current_order!=-1: #change to -1 121 | try: 122 | o.sell(stock_name) 123 | except: 124 | print(' No order to sell now ') 125 | if adx_value>=adx_limit: 126 | o.buy(stock_name,buy_sell=-1,qty=o.no_of_stocks(stock_name,percent,margin)) 127 | sleep(30) 128 | if (old_trend=='up' and new_trend=='down') or (new_trend=='down' and (current_order==-1)): #chnge it to 1 # or current_order==None)): 129 | if current_order!=1: #change it to -1 130 | try: 131 | o.sell(stock_name) 132 | except: 133 | print("No order to sell now ") 134 | 135 | if adx_value>=adx_limit: 136 | o.buy(stock_name,buy_sell=1,qty=o.no_of_stocks(stock_name,percent,margin)) 137 | sleep(30) 138 | if ((0 <= time.localtime().tm_wday <= 4) and (datetime.datetime.strptime( 139 | datetime.datetime.strftime(datetime.datetime.now(), "%d-%m-%Y") + " 15:14:50", 140 | "%d-%m-%Y %H:%M:%S") <= datetime.datetime.now() <= datetime.datetime.strptime( 141 | datetime.datetime.strftime(datetime.datetime.now(), "%d-%m-%Y") + " 15:30:00", 142 | "%d-%m-%Y %H:%M:%S"))) or emergency_do_not_stop: 143 | try: 144 | for i in o.position_symbol()[1].keys(): 145 | o.sell(i) 146 | except: 147 | m.message("There are no positions to sell ") 148 | try: 149 | m.message('Today Trading stopped ! ') 150 | m.message(f"Today P and L is {fyers.positions()['overall']['pl_realized']}") 151 | try: 152 | os.system('rm intimate.txt') 153 | os.system('rm stock_selection.txt') 154 | os.system,('rm ticks.db') 155 | import sys 156 | sys.exit() 157 | except Exception as error: 158 | print(error) 159 | import sys 160 | sys.exit() 161 | except: 162 | print('unable to fetch P and L ') 163 | import sys 164 | sys.exit() 165 | sys.exit() 166 | break 167 | #except Exception as error : 168 | # m.message(f'There is an error in strategy , This is the error {error}') 169 | 170 | m.message('came outside loop , this should not happen during market hours , please check the error occured ') 171 | except Exception as error: 172 | if str(error)=="[Errno 2] No such file or directory: 'fyers/stock_selection.txt'": 173 | print('error stopped') 174 | break 175 | m.message(f"There is an error in trading strategy , Trying again... , The error is : {error}") 176 | sleep(10) 177 | 178 | m.message("Final Call , it won't try again There is an error in trading strategy , please check or please contact srikar , Trading stopped for today .") 179 | 180 | -------------------------------------------------------------------------------- /common/indicator.py: -------------------------------------------------------------------------------- 1 | """ 2 | Usage : 3 | data = { 4 | "data": { 5 | "candles": [ 6 | ["05-09-2013", 5553.75, 5625.75, 5552.700195, 5592.950195, 274900], 7 | ["06-09-2013", 5617.450195, 5688.600098, 5566.149902, 5680.399902, 253000], 8 | ["10-09-2013", 5738.5, 5904.850098, 5738.200195, 5896.75, 275200], 9 | ["11-09-2013", 5887.25, 5924.350098, 5832.700195, 5913.149902, 265000], 10 | ["12-09-2013", 5931.149902, 5932, 5815.799805, 5850.700195, 273000], 11 | ... 12 | ["27-01-2014", 6186.299805, 6188.549805, 6130.25, 6135.850098, 190400], 13 | ["28-01-2014", 6131.850098, 6163.600098, 6085.950195, 6126.25, 184100], 14 | ["29-01-2014", 6161, 6170.450195, 6109.799805, 6120.25, 146700], 15 | ["30-01-2014", 6067, 6082.850098, 6027.25, 6073.700195, 208100], 16 | ["31-01-2014", 6082.75, 6097.850098, 6067.350098, 6089.5, 146700] 17 | ] 18 | } 19 | } 20 | 21 | # Date must be present as a Pandas DataFrame with ['date', 'open', 'high', 'low', 'close', 'volume'] as columns 22 | df = pd.DataFrame(data["data"]["candles"], columns=['date', 'open', 'high', 'low', 'close', 'volume']) 23 | 24 | # Columns as added by each function specific to their computations 25 | EMA(df, 'close', 'ema_5', 5) 26 | ATR(df, 14) 27 | SuperTrend(df, 10, 3) 28 | MACD(df) 29 | """ 30 | 31 | import pandas as pd 32 | import time 33 | import os 34 | import pandas as pd 35 | import datetime 36 | import math 37 | import sys 38 | import numpy as np 39 | import sys 40 | import warnings 41 | 42 | def HA(df, ohlc=['Open', 'High', 'Low', 'Close']): 43 | """ 44 | Function to compute Heiken Ashi Candles (HA) 45 | 46 | Args : 47 | df : Pandas DataFrame which contains ['date', 'open', 'high', 'low', 'close', 'volume'] columns 48 | ohlc: List defining OHLC Column names (default ['Open', 'High', 'Low', 'Close']) 49 | 50 | Returns : 51 | df : Pandas DataFrame with new columns added for 52 | Heiken Ashi Close (HA_$ohlc[3]) 53 | Heiken Ashi Open (HA_$ohlc[0]) 54 | Heiken Ashi High (HA_$ohlc[1]) 55 | Heiken Ashi Low (HA_$ohlc[2]) 56 | """ 57 | 58 | ha_open = 'HA_' + ohlc[0] 59 | ha_high = 'HA_' + ohlc[1] 60 | ha_low = 'HA_' + ohlc[2] 61 | ha_close = 'HA_' + ohlc[3] 62 | 63 | df[ha_close] = (df[ohlc[0]] + df[ohlc[1]] + df[ohlc[2]] + df[ohlc[3]]) / 4 64 | 65 | df[ha_open] = 0.00 66 | for i in range(0, len(df)): 67 | if i == 0: 68 | df[ha_open].iat[i] = (df[ohlc[0]].iat[i] + df[ohlc[3]].iat[i]) / 2 69 | else: 70 | df[ha_open].iat[i] = (df[ha_open].iat[i - 1] + df[ha_close].iat[i - 1]) / 2 71 | 72 | df[ha_high] = df[[ha_open, ha_close, ohlc[1]]].max(axis=1) 73 | df[ha_low] = df[[ha_open, ha_close, ohlc[2]]].min(axis=1) 74 | 75 | return df 76 | 77 | 78 | def SMA(df, base, target, period): 79 | """ 80 | Function to compute Simple Moving Average (SMA) 81 | 82 | Args : 83 | df : Pandas DataFrame which contains ['date', 'open', 'high', 'low', 'close', 'volume'] columns 84 | base : String indicating the column name from which the SMA needs to be computed from 85 | target : String indicates the column name to which the computed data needs to be stored 86 | period : Integer indicates the period of computation in terms of number of candles 87 | 88 | Returns : 89 | df : Pandas DataFrame with new column added with name 'target' 90 | """ 91 | 92 | df[target] = df[base].rolling(window=period).mean() 93 | df[target].fillna(0, inplace=True) 94 | 95 | return df 96 | 97 | 98 | def STDDEV(df, base, target, period): 99 | """ 100 | Function to compute Standard Deviation (STDDEV) 101 | 102 | Args : 103 | df : Pandas DataFrame which contains ['date', 'open', 'high', 'low', 'close', 'volume'] columns 104 | base : String indicating the column name from which the SMA needs to be computed from 105 | target : String indicates the column name to which the computed data needs to be stored 106 | period : Integer indicates the period of computation in terms of number of candles 107 | 108 | Returns : 109 | df : Pandas DataFrame with new column added with name 'target' 110 | """ 111 | 112 | df[target] = df[base].rolling(window=period).std() 113 | df[target].fillna(0, inplace=True) 114 | 115 | return df 116 | 117 | 118 | def EMA(df, base, target, period, alpha=False): 119 | """ 120 | Function to compute Exponential Moving Average (EMA) 121 | 122 | Args : 123 | df : Pandas DataFrame which contains ['date', 'open', 'high', 'low', 'close', 'volume'] columns 124 | base : String indicating the column name from which the EMA needs to be computed from 125 | target : String indicates the column name to which the computed data needs to be stored 126 | period : Integer indicates the period of computation in terms of number of candles 127 | alpha : Boolean if True indicates to use the formula for computing EMA using alpha (default is False) 128 | 129 | Returns : 130 | df : Pandas DataFrame with new column added with name 'target' 131 | """ 132 | 133 | con = pd.concat([df[:period][base].rolling(window=period).mean(), df[period:][base]]) 134 | 135 | if (alpha == True): 136 | # (1 - alpha) * previous_val + alpha * current_val where alpha = 1 / period 137 | df[target] = con.ewm(alpha=1 / period, adjust=False).mean() 138 | else: 139 | # ((current_val - previous_val) * coeff) + previous_val where coeff = 2 / (period + 1) 140 | df[target] = con.ewm(span=period, adjust=False).mean() 141 | 142 | df[target].fillna(0, inplace=True) 143 | return df 144 | 145 | 146 | def ATR(df, period, ohlc=['Open', 'High', 'Low', 'Close']): 147 | """ 148 | Function to compute Average True Range (ATR) 149 | 150 | Args : 151 | df : Pandas DataFrame which contains ['date', 'open', 'high', 'low', 'close', 'volume'] columns 152 | period : Integer indicates the period of computation in terms of number of candles 153 | ohlc: List defining OHLC Column names (default ['Open', 'High', 'Low', 'Close']) 154 | 155 | Returns : 156 | df : Pandas DataFrame with new columns added for 157 | True Range (TR) 158 | ATR (ATR_$period) 159 | """ 160 | atr = 'ATR_' + str(period) 161 | 162 | # Compute true range only if it is not computed and stored earlier in the df 163 | if not 'TR' in df.columns: 164 | df['h-l'] = df[ohlc[1]] - df[ohlc[2]] 165 | df['h-yc'] = abs(df[ohlc[1]] - df[ohlc[3]].shift()) 166 | df['l-yc'] = abs(df[ohlc[2]] - df[ohlc[3]].shift()) 167 | 168 | df['TR'] = df[['h-l', 'h-yc', 'l-yc']].max(axis=1) 169 | 170 | df.drop(['h-l', 'h-yc', 'l-yc'], inplace=True, axis=1) 171 | 172 | # Compute EMA of true range using ATR formula after ignoring first row 173 | EMA(df, 'TR', atr, period, alpha=True) 174 | 175 | return df 176 | 177 | 178 | def SuperTrend(df, period, multiplier, ohlc=['open', 'high', 'low', 'close']): 179 | """ 180 | Function to compute SuperTrend 181 | 182 | Args : 183 | df : Pandas DataFrame which contains ['date', 'open', 'high', 'low', 'close', 'volume'] columns 184 | period : Integer indicates the period of computation in terms of number of candles 185 | multiplier : Integer indicates value to multiply the ATR 186 | ohlc: List defining OHLC Column names (default ['Open', 'High', 'Low', 'Close']) 187 | 188 | Returns : 189 | df : Pandas DataFrame with new columns added for 190 | True Range (TR), ATR (ATR_$period) 191 | SuperTrend (ST_$period_$multiplier) 192 | SuperTrend Direction (STX_$period_$multiplier) 193 | """ 194 | 195 | ATR(df, period, ohlc=ohlc) 196 | atr = 'ATR_' + str(period) 197 | st = 'ST_' + str(period) + '_' + str(multiplier) 198 | stx = 'STX_' + str(period) + '_' + str(multiplier) 199 | 200 | """ 201 | SuperTrend Algorithm : 202 | 203 | BASIC UPPERBAND = (HIGH + LOW) / 2 + Multiplier * ATR 204 | BASIC LOWERBAND = (HIGH + LOW) / 2 - Multiplier * ATR 205 | 206 | FINAL UPPERBAND = IF( (Current BASICUPPERBAND < Previous FINAL UPPERBAND) or (Previous Close > Previous FINAL UPPERBAND)) 207 | THEN (Current BASIC UPPERBAND) ELSE Previous FINALUPPERBAND) 208 | FINAL LOWERBAND = IF( (Current BASIC LOWERBAND > Previous FINAL LOWERBAND) or (Previous Close < Previous FINAL LOWERBAND)) 209 | THEN (Current BASIC LOWERBAND) ELSE Previous FINAL LOWERBAND) 210 | 211 | SUPERTREND = IF((Previous SUPERTREND = Previous FINAL UPPERBAND) and (Current Close <= Current FINAL UPPERBAND)) THEN 212 | Current FINAL UPPERBAND 213 | ELSE 214 | IF((Previous SUPERTREND = Previous FINAL UPPERBAND) and (Current Close > Current FINAL UPPERBAND)) THEN 215 | Current FINAL LOWERBAND 216 | ELSE 217 | IF((Previous SUPERTREND = Previous FINAL LOWERBAND) and (Current Close >= Current FINAL LOWERBAND)) THEN 218 | Current FINAL LOWERBAND 219 | ELSE 220 | IF((Previous SUPERTREND = Previous FINAL LOWERBAND) and (Current Close < Current FINAL LOWERBAND)) THEN 221 | Current FINAL UPPERBAND 222 | """ 223 | 224 | # Compute basic upper and lower bands 225 | df['basic_ub'] = (df[ohlc[1]] + df[ohlc[2]]) / 2 + multiplier * df[atr] 226 | df['basic_lb'] = (df[ohlc[1]] + df[ohlc[2]]) / 2 - multiplier * df[atr] 227 | 228 | # Compute final upper and lower bands 229 | df['final_ub'] = 0.00 230 | df['final_lb'] = 0.00 231 | for i in range(period, len(df)): 232 | df['final_ub'].iat[i] = df['basic_ub'].iat[i] if df['basic_ub'].iat[i] < df['final_ub'].iat[i - 1] or \ 233 | df[ohlc[3]].iat[i - 1] > df['final_ub'].iat[i - 1] else \ 234 | df['final_ub'].iat[i - 1] 235 | df['final_lb'].iat[i] = df['basic_lb'].iat[i] if df['basic_lb'].iat[i] > df['final_lb'].iat[i - 1] or \ 236 | df[ohlc[3]].iat[i - 1] < df['final_lb'].iat[i - 1] else \ 237 | df['final_lb'].iat[i - 1] 238 | 239 | # Set the Supertrend value 240 | df[st] = 0.00 241 | for i in range(period, len(df)): 242 | df[st].iat[i] = df['final_ub'].iat[i] if df[st].iat[i - 1] == df['final_ub'].iat[i - 1] and df[ohlc[3]].iat[ 243 | i] <= df['final_ub'].iat[i] else \ 244 | df['final_lb'].iat[i] if df[st].iat[i - 1] == df['final_ub'].iat[i - 1] and df[ohlc[3]].iat[i] > \ 245 | df['final_ub'].iat[i] else \ 246 | df['final_lb'].iat[i] if df[st].iat[i - 1] == df['final_lb'].iat[i - 1] and df[ohlc[3]].iat[i] >= \ 247 | df['final_lb'].iat[i] else \ 248 | df['final_ub'].iat[i] if df[st].iat[i - 1] == df['final_lb'].iat[i - 1] and df[ohlc[3]].iat[i] < \ 249 | df['final_lb'].iat[i] else 0.00 250 | 251 | # Mark the trend direction up/down 252 | df[stx] = np.where((df[st] > 0.00), np.where((df[ohlc[3]] < df[st]), 'down', 'up'), np.NaN) 253 | 254 | # Remove basic and final bands from the columns 255 | df.drop(['basic_ub', 'basic_lb', 'final_ub', 'final_lb'], inplace=True, axis=1) 256 | 257 | df.fillna(0, inplace=True) 258 | 259 | return df 260 | 261 | 262 | def MACD(df, fastEMA=12, slowEMA=26, signal=9, base='Close'): 263 | """ 264 | Function to compute Moving Average Convergence Divergence (MACD) 265 | 266 | Args : 267 | df : Pandas DataFrame which contains ['date', 'open', 'high', 'low', 'close', 'volume'] columns 268 | fastEMA : Integer indicates faster EMA 269 | slowEMA : Integer indicates slower EMA 270 | signal : Integer indicates the signal generator for MACD 271 | base : String indicating the column name from which the MACD needs to be computed from (Default Close) 272 | 273 | Returns : 274 | df : Pandas DataFrame with new columns added for 275 | Fast EMA (ema_$fastEMA) 276 | Slow EMA (ema_$slowEMA) 277 | MACD (macd_$fastEMA_$slowEMA_$signal) 278 | MACD Signal (signal_$fastEMA_$slowEMA_$signal) 279 | MACD Histogram (MACD (hist_$fastEMA_$slowEMA_$signal)) 280 | """ 281 | 282 | fE = "ema_" + str(fastEMA) 283 | sE = "ema_" + str(slowEMA) 284 | macd = "macd_" + str(fastEMA) + "_" + str(slowEMA) + "_" + str(signal) 285 | sig = "signal_" + str(fastEMA) + "_" + str(slowEMA) + "_" + str(signal) 286 | hist = "hist_" + str(fastEMA) + "_" + str(slowEMA) + "_" + str(signal) 287 | 288 | # Compute fast and slow EMA 289 | EMA(df, base, fE, fastEMA) 290 | EMA(df, base, sE, slowEMA) 291 | 292 | # Compute MACD 293 | df[macd] = np.where(np.logical_and(np.logical_not(df[fE] == 0), np.logical_not(df[sE] == 0)), df[fE] - df[sE], 0) 294 | 295 | # Compute MACD Signal 296 | EMA(df, macd, sig, signal) 297 | 298 | # Compute MACD Histogram 299 | df[hist] = np.where(np.logical_and(np.logical_not(df[macd] == 0), np.logical_not(df[sig] == 0)), df[macd] - df[sig], 300 | 0) 301 | 302 | return df 303 | 304 | 305 | def BBand(df, base='Close', period=20, multiplier=2): 306 | """ 307 | Function to compute Bollinger Band (BBand) 308 | 309 | Args : 310 | df : Pandas DataFrame which contains ['date', 'open', 'high', 'low', 'close', 'volume'] columns 311 | base : String indicating the column name from which the MACD needs to be computed from (Default Close) 312 | period : Integer indicates the period of computation in terms of number of candles 313 | multiplier : Integer indicates value to multiply the SD 314 | 315 | Returns : 316 | df : Pandas DataFrame with new columns added for 317 | Upper Band (UpperBB_$period_$multiplier) 318 | Lower Band (LowerBB_$period_$multiplier) 319 | """ 320 | 321 | upper = 'UpperBB_' + str(period) + '_' + str(multiplier) 322 | lower = 'LowerBB_' + str(period) + '_' + str(multiplier) 323 | 324 | sma = df[base].rolling(window=period, min_periods=period - 1).mean() 325 | sd = df[base].rolling(window=period).std() 326 | df[upper] = sma + (multiplier * sd) 327 | df[lower] = sma - (multiplier * sd) 328 | 329 | df[upper].fillna(0, inplace=True) 330 | df[lower].fillna(0, inplace=True) 331 | 332 | return df 333 | 334 | 335 | def RSI(df, base="Close", period=21): 336 | """ 337 | Function to compute Relative Strength Index (RSI) 338 | 339 | Args : 340 | df : Pandas DataFrame which contains ['date', 'open', 'high', 'low', 'close', 'volume'] columns 341 | base : String indicating the column name from which the MACD needs to be computed from (Default Close) 342 | period : Integer indicates the period of computation in terms of number of candles 343 | 344 | Returns : 345 | df : Pandas DataFrame with new columns added for 346 | Relative Strength Index (RSI_$period) 347 | """ 348 | 349 | delta = df[base].diff() 350 | up, down = delta.copy(), delta.copy() 351 | 352 | up[up < 0] = 0 353 | down[down > 0] = 0 354 | 355 | rUp = up.ewm(com=period - 1, adjust=False).mean() 356 | rDown = down.ewm(com=period - 1, adjust=False).mean().abs() 357 | 358 | df['RSI_' + str(period)] = 100 - 100 / (1 + rUp / rDown) 359 | df['RSI_' + str(period)].fillna(0, inplace=True) 360 | 361 | return df 362 | 363 | 364 | def Ichimoku(df, ohlc=['Open', 'High', 'Low', 'Close'], param=[9, 26, 52, 26]): 365 | """ 366 | Function to compute Ichimoku Cloud parameter (Ichimoku) 367 | 368 | Args : 369 | df : Pandas DataFrame which contains ['date', 'open', 'high', 'low', 'close', 'volume'] columns 370 | ohlc: List defining OHLC Column names (default ['Open', 'High', 'Low', 'Close']) 371 | param: Periods to be used in computation (default [tenkan_sen_period, kijun_sen_period, senkou_span_period, chikou_span_period] = [9, 26, 52, 26]) 372 | 373 | Returns : 374 | df : Pandas DataFrame with new columns added for ['Tenkan Sen', 'Kijun Sen', 'Senkou Span A', 'Senkou Span B', 'Chikou Span'] 375 | """ 376 | 377 | high = df[ohlc[1]] 378 | low = df[ohlc[2]] 379 | close = df[ohlc[3]] 380 | 381 | tenkan_sen_period = param[0] 382 | kijun_sen_period = param[1] 383 | senkou_span_period = param[2] 384 | chikou_span_period = param[3] 385 | 386 | tenkan_sen_column = 'Tenkan Sen' 387 | kijun_sen_column = 'Kijun Sen' 388 | senkou_span_a_column = 'Senkou Span A' 389 | senkou_span_b_column = 'Senkou Span B' 390 | chikou_span_column = 'Chikou Span' 391 | 392 | # Tenkan-sen (Conversion Line) 393 | tenkan_sen_high = high.rolling(window=tenkan_sen_period).max() 394 | tenkan_sen_low = low.rolling(window=tenkan_sen_period).min() 395 | df[tenkan_sen_column] = (tenkan_sen_high + tenkan_sen_low) / 2 396 | 397 | # Kijun-sen (Base Line) 398 | kijun_sen_high = high.rolling(window=kijun_sen_period).max() 399 | kijun_sen_low = low.rolling(window=kijun_sen_period).min() 400 | df[kijun_sen_column] = (kijun_sen_high + kijun_sen_low) / 2 401 | 402 | # Senkou Span A (Leading Span A) 403 | df[senkou_span_a_column] = ((df[tenkan_sen_column] + df[kijun_sen_column]) / 2).shift(kijun_sen_period) 404 | 405 | # Senkou Span B (Leading Span B) 406 | senkou_span_high = high.rolling(window=senkou_span_period).max() 407 | senkou_span_low = low.rolling(window=senkou_span_period).min() 408 | df[senkou_span_b_column] = ((senkou_span_high + senkou_span_low) / 2).shift(kijun_sen_period) 409 | 410 | # The most current closing price plotted chikou_span_period time periods behind 411 | df[chikou_span_column] = close.shift(-1 * chikou_span_period) 412 | 413 | return df 414 | -------------------------------------------------------------------------------- /Fyers - Scrips blocked for Intraday trading - Equity.csv: -------------------------------------------------------------------------------- 1 | List of Scrips blocked for Intraday trading, 2 | SYMBOL,Last Updated 3 | 3IINFOTECH,2018-02-01 4 | 5PAISA,2018-02-01 5 | 63MOONS,2018-02-01 6 | 8KMILES,2018-02-01 7 | A2ZINFRA,2018-02-01 8 | AARVEEDEN,2018-02-01 9 | AARTIIND,2020-09-19 10 | ABGSHIP,2018-02-01 11 | ACE,2018-02-01 12 | ADANITRANS,2018-02-01 13 | ADHUNIK,2018-02-01 14 | ADHUNIKIND,2018-02-01 15 | ADLABS,2018-02-01 16 | ADORWELD,2018-02-01 17 | ADSL,2018-02-01 18 | AGARIND,2018-02-01 19 | AGCNET,2018-02-01 20 | AGRITECH,2018-02-01 21 | AHLWEST,2018-02-01 22 | AIAENG,2018-02-01 23 | AIMCOPEST,2018-02-01 24 | AKSHOPTFBR,2018-02-01 25 | ALANKIT,2018-02-01 26 | ALBERTDAVD,2018-02-01 27 | ALCHEM,2018-02-01 28 | ALKALI,2018-02-01 29 | ALLSEC,2018-02-01 30 | ALMONDZ,2018-02-01 31 | ALOKTEXT,2018-02-01 32 | ALPA,2018-02-01 33 | ALPHAGEO,2018-02-01 34 | ALPSINDUS,2018-02-01 35 | AMBIKCO,2018-02-01 36 | AMDIND,2018-02-01 37 | AMTEKAUTO,2018-02-01 38 | ANANTRAJ,2018-02-01 39 | ANDHRACEMT,2018-02-01 40 | ANDHRAPET,2018-02-01 41 | ANGIND,2018-02-01 42 | ANIKINDS,2018-02-01 43 | ANKITMETAL,2018-02-01 44 | ANSALAPI,2018-02-01 45 | ANSALHSG,2018-02-01 46 | ANTGRAPHIC,2018-02-01 47 | APCL,2018-02-01 48 | APEX,2018-02-01 49 | APOLSINHOT,2018-02-01 50 | APTECHT,2018-02-01 51 | ARCHIDPLY,2018-02-01 52 | ARCHIES,2018-02-01 53 | ARCOTECH,2018-02-01 54 | ARIES,2018-02-01 55 | ARIHANT,2018-02-01 56 | ARROWTEX,2018-02-01 57 | ARSHIYA,2018-02-01 58 | ARSSINFRA,2018-02-01 59 | ARVINDREM,2018-02-01 60 | ASAHISONG,2018-02-01 61 | ASAL,2018-02-01 62 | ASHAPURMIN,2018-02-01 63 | ASHIANA,2018-02-01 64 | ASSAMCO,2018-02-01 65 | ATLANTA,2018-02-01 66 | ATLASCYCLE,2018-02-01 67 | ATNINTER,2018-02-01 68 | AURIONPRO,2018-02-01 69 | AUSOMENT,2018-02-01 70 | AUSTRAL,2018-02-01 71 | AUTOLITIND,2018-02-01 72 | AVADHSUGAR,2018-02-01 73 | AVANTIFEED,2018-02-01 74 | AXISCADES,2018-02-01 75 | BAFNAPHARM,2018-02-01 76 | BAGFILMS,2018-02-01 77 | BALPHARMA,2018-02-01 78 | BANG,2018-02-01 79 | BARTRONICS,2018-02-01 80 | BASF,2018-02-01 81 | BBL,2018-02-01 82 | BBTC,2018-02-01 83 | BEARDSELL,2018-02-01 84 | BEPL,2018-02-01 85 | BFINVEST,2018-02-01 86 | BFUTILITIE,2018-02-01 87 | BHAGERIA,2018-02-01 88 | BHANDARI,2018-02-01 89 | BHARATGEAR,2018-02-01 90 | BHARATIDIL,2018-02-01 91 | BHARATRAS,2018-02-01 92 | BHARATWIRE,2018-02-01 93 | BHUSANSTL,2018-02-01 94 | BILENERGY,2018-02-01 95 | BINANIIND,2018-02-01 96 | BIRLAMONEY,2018-02-01 97 | BLISSGVS,2018-02-01 98 | BLKASHYAP,2018-02-01 99 | BLS,2018-02-01 100 | BLUEBLENDS,2018-02-01 101 | BLUECHIP,2018-02-01 102 | BLUECOAST,2018-02-01 103 | BOMDYEING,2018-02-01 104 | BPL,2018-02-01 105 | BRFL,2018-02-01 106 | BROOKS,2018-02-01 107 | BSELINFRA,2018-02-01 108 | BSL,2018-02-01 109 | BSLIMITED,2018-02-01 110 | BURNPUR,2018-02-01 111 | BUTTERFLY,2018-02-01 112 | BVCL,2018-02-01 113 | CALSOFT,2018-02-01 114 | CAMLINFINE,2018-02-01 115 | CANDC,2018-02-01 116 | CANTABIL,2018-02-01 117 | CAPLIPOINT,2018-02-01 118 | CAREERP,2018-02-01 119 | CASTEXTECH,2018-02-01 120 | CCCL,2018-02-01 121 | CCHHL,2018-02-01 122 | CEBBCO,2018-02-01 123 | CELEBRITY,2018-02-01 124 | CENTEXT,2018-02-01 125 | CEREBRAINT,2018-02-01 126 | CGCL,2018-02-01 127 | CHROMATIC,2018-02-01 128 | CIGNITITEC,2018-02-01 129 | CIMMCO,2018-02-01 130 | CINELINE,2018-02-01 131 | CINEVISTA,2018-02-01 132 | CMAHENDRA,2018-02-01 133 | CNOVAPETRO,2018-02-01 134 | COFFEEDAY,2018-02-01 135 | COMPINFO,2018-02-01 136 | COMPUSOFT,2018-02-01 137 | CORALFINAC,2018-02-01 138 | CORDSCABLE,2018-02-01 139 | CRANESSOFT,2018-02-01 140 | CREST,2018-02-01 141 | CTE,2018-02-01 142 | CUPID,2018-02-01 143 | CYBERMEDIA,2018-02-01 144 | CYBERTECH,2018-02-01 145 | DAAWAT,2018-02-01 146 | DALMIASUG,2018-02-01 147 | DBREALTY,2018-02-01 148 | DCM,2018-02-01 149 | DELTACORP,2018-02-01 150 | DEN,2018-02-01 151 | DENORA,2018-02-01 152 | DFMFOODS,2018-02-01 153 | DHARSUGAR,2018-02-01 154 | DHUNINV,2018-02-01 155 | DIAPOWER,2018-02-01 156 | DICIND,2018-02-01 157 | DICIND,2018-02-01 158 | DIGJAMLTD,2018-02-01 159 | DNAMEDIA,2018-02-01 160 | DOLPHINOFF,2018-02-01 161 | DONEAR,2018-02-01 162 | DQE,2018-02-01 163 | DREDGECORP,2018-02-01 164 | DSKULKARNI,2018-02-01 165 | DSSL,2018-02-01 166 | DUCON,2018-02-01 167 | DWARKESH,2018-02-01 168 | EASTSILK,2018-02-01 169 | EASUNREYRL,2018-02-01 170 | ECEIND,2018-02-01 171 | EDL,2018-02-01 172 | EDUCOMP,2018-02-01 173 | EIHAHOTELS,2018-02-01 174 | EIHOTEL,2018-02-01 175 | EIMCOELECO,2018-02-01 176 | EKC,2018-02-01 177 | ELDERPHARM,2018-02-01 178 | ELECTHERM,2018-02-01 179 | EMAMIINFRA,2018-02-01 180 | EMCO,2018-02-01 181 | EMKAY,2018-02-01 182 | EMMBI,2018-02-01 183 | ENERGYDEV,2018-02-01 184 | EON,2018-02-01 185 | EROSMEDIA,2018-02-01 186 | ESABINDIA,2018-02-01 187 | ESL,2018-02-01 188 | ESSARSHPNG,2018-02-01 189 | ESTER,2018-02-01 190 | EUROCERA,2018-02-01 191 | EUROTEXIND,2018-02-01 192 | EVERESTIND,2018-02-01 193 | EVERONN,2018-02-01 194 | EXCEL,2018-02-01 195 | EXCELINDUS,2018-02-01 196 | FACT,2018-02-01 197 | FAIRCHEM,2018-02-01 198 | FARMAXIND,2018-02-01 199 | FCL,2018-02-01 200 | FEDDERELEC,2018-02-01 201 | FILATEX,2018-02-01 202 | FLEXITUFF,2018-02-01 203 | FMGOETZE,2018-02-01 204 | FMNL,2018-02-01 205 | FOSECOIND,2018-02-01 206 | FRETAIL,2020-09-04 207 | GAL,2018-02-01 208 | GALLANTT,2018-02-01 209 | GALLISPAT,2018-02-01 210 | GAMMNINFRA,2018-02-01 211 | GAMMONIND,2018-02-01 212 | GEECEE,2018-02-01 213 | GEMINI,2018-02-01 214 | GENESYS,2018-02-01 215 | GENUSPAPER,2018-02-01 216 | GET&D,2018-02-01 217 | GHCL,2018-02-01 218 | GILLANDERS,2018-02-01 219 | GINNIFILA,2018-02-01 220 | GITANJALI,2018-02-01 221 | GKWLIMITED,2018-02-01 222 | GLOBALVECT,2018-02-01 223 | GLOBOFFS,2018-02-01 224 | GLOBUSSPR,2018-02-01 225 | GMBREW,2018-02-01 226 | GMBREW,2018-02-01 227 | GOACARBON,2018-02-01 228 | GOKEX,2018-02-01 229 | GOKUL,2018-02-01 230 | GOKULAGRO,2018-02-01 231 | GOLDENTOBC,2018-02-01 232 | GOLDIAM,2018-02-01 233 | GOLDINFRA,2018-02-01 234 | GOLDTECH,2018-02-01 235 | GPIL,2018-02-01 236 | GPTINFRA,2018-02-01 237 | GRAPHITE,2018-02-01 238 | GRAVITA,2018-02-01 239 | GREENPOWER,2018-02-01 240 | GROBTEA,2018-02-01 241 | GSS,2018-02-01 242 | GTLINFRA,2018-02-01 243 | GTNIND,2018-02-01 244 | GTNTEX,2018-02-01 245 | GTOFFSHORE,2018-02-01 246 | GUFICBIO,2018-02-01 247 | GUJAPOLLO,2018-02-01 248 | GUJNRECOKE,2018-02-01 249 | GUJNREDVR,2018-02-01 250 | GVKPIL,2018-02-01 251 | HANUNG,2018-02-01 252 | HARITASEAT,2018-02-01 253 | HARRMALAYA,2018-02-01 254 | HATHWAY,2018-02-01 255 | HATSUN,2018-02-01 256 | HBLPOWER,2018-02-01 257 | HBSTOCK,2018-02-01 258 | HCL-INSYS,2018-02-01 259 | HEG,2018-02-01 260 | HELIOSMATH,2018-02-01 261 | HESTERBIO,2018-02-01 262 | HEXATRADEX,2018-02-01 263 | HFCL,2018-02-01 264 | HIGHGROUND,2018-02-01 265 | HIGHGROUND,2018-02-01 266 | HILTON,2018-02-01 267 | HINDCOPPER,2018-02-01 268 | HINDDORROL,2018-02-01 269 | HINDNATGLS,2018-02-01 270 | HIRECT,2018-02-01 271 | HISARMETAL,2018-02-01 272 | HITECHGEAR,2018-02-01 273 | HMT,2018-02-01 274 | HOVS,2018-02-01 275 | HUBTOWN,2018-02-01 276 | IBVENTURES,2018-02-01 277 | ICSA,2018-02-01 278 | IGARASHI,2018-02-01 279 | IITL,2018-02-01 280 | IL&FSENGG,2018-02-01 281 | IMFA,2018-02-01 282 | IMPEXFERRO,2018-02-01 283 | INDBANK,2018-02-01 284 | INDIAGLYCO,2018-02-01 285 | INDIANHUME,2018-02-01 286 | INDLMETER,2018-02-01 287 | INDNIPPON,2018-02-01 288 | INDORAMA,2018-02-01 289 | INDOSOLAR,2018-02-01 290 | INDOTECH,2018-02-01 291 | INDOTHAI,2018-02-01 292 | INDOWIND,2018-02-01 293 | INDSWFTLTD,2018-02-01 294 | INFINITE,2018-02-01 295 | INFOMEDIA,2018-02-01 296 | INTENTECH,2018-02-01 297 | INTENTECH,2018-02-01 298 | IOLCP,2018-02-01 299 | IRCTC,2020-03-27 300 | ISMTLTD,2018-02-01 301 | ITDC,2018-02-01 302 | ITDCEM,2018-02-01 303 | ITI,2018-02-01 304 | IVC,2018-02-01 305 | IVP,2018-02-01 306 | IVRCLINFRA,2018-02-01 307 | IZMO,2018-02-01 308 | JAIBALAJI,2018-02-01 309 | JAICORPLTD,2018-02-01 310 | JAIHINDPRO,2018-02-01 311 | JAYAGROGN,2018-02-01 312 | JAYBARMARU,2018-02-01 313 | JBFIND,2018-02-01 314 | JBMA,2018-02-01 315 | JCHAC,2018-02-01 316 | JENSONICOL,2018-02-01 317 | JETAIRWAYS,2019-06-18 318 | JHS,2018-02-01 319 | JIKIND,2018-02-01 320 | JINDALPHOT,2018-02-01 321 | JINDCOT,2018-02-01 322 | JINDRILL,2018-02-01 323 | JINDWORLD,2018-02-01 324 | JMA,2018-02-01 325 | JMFINANCIL,2018-02-01 326 | JMTAUTOLTD,2018-02-01 327 | JPINFRATEC,2018-02-01 328 | JPOLYINVST,2018-02-01 329 | JPPOWER,2018-02-01 330 | JUBLINDS,2018-02-01 331 | JVLAGRO,2018-02-01 332 | JYOTISTRUC,2018-02-01 333 | KAJARIACER,2019-01-28 334 | KABRAEXTRU,2018-02-01 335 | KAKATCEM,2018-02-01 336 | KAMATHOTEL,2018-02-01 337 | KANANIIND,2018-02-01 338 | KANORICHEM,2018-02-01 339 | KARMAENG,2018-02-01 340 | KAUSHALYA,2018-02-01 341 | KAVVERITEL,2018-02-01 342 | KCPSUGIND,2018-02-01 343 | KDDL,2018-02-01 344 | KECL,2018-02-01 345 | KELLTONTEC,2018-02-01 346 | KEMROCK,2018-02-01 347 | KESARENT,2018-02-01 348 | KEYCORPSER,2018-02-01 349 | KGL,2018-02-01 350 | KHAITANELE,2018-02-01 351 | KHAITANLTD,2018-02-01 352 | KHANDSE,2018-02-01 353 | KILITCH,2018-02-01 354 | KINETICENG,2018-02-01 355 | KINGFA,2018-02-01 356 | KIOCL,2018-02-01 357 | KIRIINDUS,2018-02-01 358 | KIRLOSIND,2018-02-01 359 | KITEX,2018-02-01 360 | KMSUGAR,2018-02-01 361 | KOHINOOR,2018-02-01 362 | KOKUYOCMLN,2018-02-01 363 | KOLTEPATIL,2018-02-01 364 | KOTHARIPET,2018-02-01 365 | KOTHARIPRO,2018-02-01 366 | KRIDHANINF,2018-02-01 367 | KSERASERA,2018-02-01 368 | KSK,2018-02-01 369 | KTIL,2018-02-01 370 | LAKPRE,2018-02-01 371 | LAKSHMIEFL,2018-02-01 372 | LAMBODHARA,2018-02-01 373 | LCCINFOTEC,2018-02-01 374 | LIBERTSHOE,2018-02-01 375 | LINCOLN,2018-02-01 376 | LITL,2018-02-01 377 | LML,2018-02-01 378 | LOKESHMACH,2018-02-01 379 | LOTUSEYE,2018-02-01 380 | LPDC,2018-02-01 381 | LTI,2020-09-18 382 | LTTS,2018-02-01 383 | LUMAXAUTO,2018-02-01 384 | LUXIND,2018-02-01 385 | LYCOS,2018-02-01 386 | LYKALABS,2018-02-01 387 | LYPSAGEMS,2018-02-01 388 | MAANALU,2018-02-01 389 | MADHAV,2018-02-01 390 | MADHUCON,2018-02-01 391 | MADRASFERT,2018-02-01 392 | MAGNUM,2018-02-01 393 | MAHASTEEL,2018-02-01 394 | MAHSEAMLES,2018-02-01 395 | MAITHANALL,2018-02-01 396 | MALUPAPER,2018-02-01 397 | MANAKALUCO,2018-02-01 398 | MANAKCOAT,2018-02-01 399 | MANDHANA,2018-02-01 400 | MANGTIMBER,2018-02-01 401 | MANINDS,2018-02-01 402 | MANUGRAPH,2018-02-01 403 | MARALOVER,2018-02-01 404 | MARATHON,2018-02-01 405 | MASTEK,2018-02-01 406 | MAWANASUG,2018-02-01 407 | MAZDA,2018-02-01 408 | MBECL,2018-02-01 409 | MBLINFRA,2018-02-01 410 | MCDHOLDING,2018-02-01 411 | MEGASOFT,2018-02-01 412 | MENONBE,2018-02-01 413 | METALFORGE,2018-02-01 414 | MIC,2018-02-01 415 | MINDACORP,2018-02-01 416 | MIRCELECTR,2018-02-01 417 | MMTC,2018-02-01 418 | MODIRUBBER,2018-02-01 419 | MOHITIND,2018-02-01 420 | MOLDTECH,2018-02-01 421 | MONNETISPA,2018-02-01 422 | MOREPENLAB,2018-02-01 423 | MOSERBAER,2018-02-01 424 | MOTOGENFIN,2018-02-01 425 | MRO-TEK,2018-02-01 426 | MSPL,2018-02-01 427 | MTEDUCARE,2018-02-01 428 | MTNL,2018-02-01 429 | MUKTAARTS,2018-02-01 430 | MUNJALAU,2018-02-01 431 | MURUDCERA,2018-02-01 432 | MUTHOOTCAP,2018-02-01 433 | MVL,2018-02-01 434 | MYSOREBANK,2018-02-01 435 | NACLIND,2018-02-01 436 | NAGAFERT,2018-02-01 437 | NAGREEKCAP,2018-02-01 438 | NAGREEKEXP,2018-02-01 439 | NAHARCAP,2018-02-01 440 | NAHARINDUS,2018-02-01 441 | NAHARPOLY,2018-02-01 442 | NAKODA,2018-02-01 443 | NATCOPHARM,2018-02-01 444 | NATHBIOGEN,2018-02-01 445 | NATNLSTEEL,2018-02-01 446 | NAVINFLUOR,2018-02-01 447 | NAVNETEDUL,2018-02-01 448 | NBIFIN,2018-02-01 449 | NDTV,2018-02-01 450 | NELCAST,2018-02-01 451 | NELCO,2018-02-01 452 | NEULANDLAB,2018-02-01 453 | NEXTMEDIA,2018-02-01 454 | NILKAMAL,2018-02-01 455 | NIPPOBATRY,2018-02-01 456 | NITCO,2018-02-01 457 | NITESHEST,2018-02-01 458 | NITINFIRE,2018-02-01 459 | NKIND,2018-02-01 460 | NRAIL,2018-02-01 461 | NTL,2018-02-01 462 | OILCOUNTUB,2018-02-01 463 | OISL,2018-02-01 464 | OMAXAUTO,2018-02-01 465 | ONELIFECAP,2018-02-01 466 | ONMOBILE,2018-02-01 467 | ONWARDTEC,2018-02-01 468 | OPTIEMUS,2018-02-01 469 | OPTOCIRCUI,2018-02-01 470 | ORBITCORP,2018-02-01 471 | ORBTEXP,2018-02-01 472 | ORCHIDPHAR,2018-02-01 473 | ORIENTABRA,2018-02-01 474 | ORIENTALTL,2018-02-01 475 | ORIENTBELL,2018-02-01 476 | ORIENTHOT,2018-02-01 477 | ORIENTLTD,2018-02-01 478 | ORTEL,2018-02-01 479 | PALREDTEC,2018-02-01 480 | PANACEABIO,2018-02-01 481 | PANORAMUNI,2018-02-01 482 | PAPERPROD,2018-02-01 483 | PARABDRUGS,2018-02-01 484 | PARACABLES,2018-02-01 485 | PARSVNATH,2018-02-01 486 | PATELENG,2018-02-01 487 | PATSPINLTD,2018-02-01 488 | PBAINFRA,2018-02-01 489 | PDUMJEIND,2018-02-01 490 | PEARLPOLY,2018-02-01 491 | PETRONENGG,2018-02-01 492 | PFOCUS,2018-02-01 493 | PGEL,2018-02-01 494 | PHILIPCARB,2018-02-01 495 | PINCON,2018-02-01 496 | PIONDIST,2018-02-01 497 | PIRPHYTO,2018-02-01 498 | PITTILAM,2018-02-01 499 | PKTEA,2018-02-01 500 | PNBGILTS,2018-02-01 501 | POCHIRAJU,2018-02-01 502 | POLARIS,2018-02-01 503 | POLYMED,2018-02-01 504 | PONNIERODE,2018-02-01 505 | POWERMECH,2018-02-01 506 | PRABHAT,2018-02-01 507 | PRADIP,2018-02-01 508 | PRAENG,2018-02-01 509 | PRAJIND,2018-02-01 510 | PRAKASHCON,2018-02-01 511 | PRAKASHSTL,2018-02-01 512 | PRATIBHA,2018-02-01 513 | PRECOT,2018-02-01 514 | PRECWIRE,2018-02-01 515 | PREMIER,2018-02-01 516 | PREMIERPOL,2018-02-01 517 | PRIMESECU,2018-02-01 518 | PROVOGE,2018-02-01 519 | PSL,2018-02-01 520 | PUNJABCHEM,2018-02-01 521 | PURVA,2018-02-01 522 | PVP,2018-02-01 523 | RAIN,2018-02-01 524 | RAINBOWPAP,2018-02-01 525 | RAJOIL,2018-02-01 526 | RAJRAYON,2018-02-01 527 | RAJSREESUG,2018-02-01 528 | RAJTV,2018-02-01 529 | RAMANEWS,2018-02-01 530 | RAMCOSYS,2018-02-01 531 | RAMKY,2018-02-01 532 | RANASUG,2018-02-01 533 | RANEENGINE,2018-02-01 534 | RBL,2018-02-01 535 | REFEX,2018-02-01 536 | REIAGROLTD,2018-02-01 537 | RELIGARE,2018-02-01 538 | REMSONSIND,2018-02-01 539 | RENUKA,2018-02-01 540 | REPRO,2018-02-01 541 | REVATHI,2018-02-01 542 | RIIL,2018-02-01 543 | RJL,2018-02-01 544 | RKDL,2018-02-01 545 | RML,2018-02-01 546 | ROHLTD,2018-02-01 547 | ROLLT,2018-02-01 548 | ROSSELLIND,2018-02-01 549 | RPGLIFE,2018-02-01 550 | RPPINFRA,2018-02-01 551 | RSSOFTWARE,2018-02-01 552 | RTNINFRA,2018-02-01 553 | RTNPOWER,2018-02-01 554 | RUBYMILLS,2018-02-01 555 | RUCHISOYA,2018-02-01 556 | RUSHIL,2018-02-01 557 | SABEVENTS,2018-02-01 558 | SABTN,2018-02-01 559 | SAGCEM,2018-02-01 560 | SAKHTISUG,2018-02-01 561 | SAKSOFT,2018-02-01 562 | SAKTHIFIN,2018-02-01 563 | SAKUMA,2018-02-01 564 | SALONA,2018-02-01 565 | SALORAINTL,2018-02-01 566 | SALSTEEL,2018-02-01 567 | SAMBHAAV,2018-02-01 568 | SAMTEL,2018-02-01 569 | SANDESH,2018-02-01 570 | SANGHVIFOR,2018-02-01 571 | SANGHVIMOV,2018-02-01 572 | SANWARIA,2018-02-01 573 | SASKEN,2018-02-01 574 | SATHAISPAT,2018-02-01 575 | SATIN,2018-02-01 576 | SCAPDVR,2018-02-01 577 | SDBL,2018-02-01 578 | SELMCL,2018-02-01 579 | SEPOWER,2018-02-01 580 | SEQUENT,2018-02-01 581 | SERVALL,2018-02-01 582 | SESHAPAPER,2018-02-01 583 | SHAHALLOYS,2018-02-01 584 | SHARDACROP,2018-02-01 585 | SHARONBIO,2018-02-01 586 | SHEMAROO,2018-02-01 587 | SHIVAMAUTO,2018-02-01 588 | SHIVTEX,2018-02-01 589 | SHOPERSTOP,2018-02-01 590 | SHREDIGCEM,2018-02-01 591 | SHREEPUSHK,2018-02-01 592 | SHREERAMA,2018-02-01 593 | SHRENUJ,2018-02-01 594 | SHREYAS,2018-02-01 595 | SHYAMCENT,2018-02-01 596 | SHYAMTEL,2018-02-01 597 | SICAGEN,2018-02-01 598 | SIGNET,2018-02-01 599 | SILINV,2018-02-01 600 | SIMPLEX,2018-02-01 601 | SITASHREE,2018-02-01 602 | SKIL,2018-02-01 603 | SKMEGGPROD,2018-02-01 604 | SMARTLINK,2018-02-01 605 | SMPL,2018-02-01 606 | SMSLIFE,2018-02-01 607 | SMSPHARMA,2018-02-01 608 | SOMATEX,2018-02-01 609 | SORILHOLD,2018-02-01 610 | SORILINFRA,2018-02-01 611 | SPECIALITY,2018-02-01 612 | SPENTEX,2018-02-01 613 | SPHEREGSL,2018-02-01 614 | SPICEMOBI,2018-02-01 615 | SPLIL,2018-02-01 616 | SPMLINFRA,2018-02-01 617 | SPYL,2018-02-01 618 | SREEL,2018-02-01 619 | SRHHYPOLTD,2018-02-01 620 | SRSLTD,2018-02-01 621 | STAMPEDE,2018-02-01 622 | STARPAPER,2018-02-01 623 | STCINDIA,2018-02-01 624 | STEELXIND,2018-02-01 625 | STEL,2018-02-01 626 | STERLINBIO,2018-02-01 627 | STERTOOLS,2018-02-01 628 | STINDIA,2018-02-01 629 | STRTECH,2018-02-01 630 | SUBROS,2018-02-01 631 | SUDAR,2018-02-01 632 | SUDARSCHEM,2018-02-01 633 | SUJANAUNI,2018-02-01 634 | SUMEETINDS,2018-02-01 635 | SUNDARAM,2018-02-01 636 | SUNDRMBRAK,2018-02-01 637 | SUNILHITEC,2018-02-01 638 | SUPPETRO,2018-02-01 639 | SUPREMEINF,2018-02-01 640 | SUPREMETEX,2018-02-01 641 | SURANAIND,2018-02-01 642 | SURANASOL,2018-02-01 643 | SUVEN,2018-02-01 644 | SWANENERGY,2018-02-01 645 | SYNCOM,2018-02-01 646 | TAINWALCHM,2018-02-01 647 | TAKE,2018-02-01 648 | TALBROAUTO,2018-02-01 649 | TANLA,2018-02-01 650 | TANTIACONS,2018-02-01 651 | TARAPUR,2018-02-01 652 | TARMAT,2018-02-01 653 | TASTYBITE,2018-02-01 654 | TATAMETALI,2018-02-01 655 | TATAYODOGA,2018-02-01 656 | TCIDEVELOP,2018-02-01 657 | TCIEXP,2018-02-01 658 | TECHNOFAB,2018-02-01 659 | TERASOFT,2018-02-01 660 | TEXINFRA,2018-02-01 661 | TEXMOPIPES,2018-02-01 662 | TEXRAIL,2018-02-01 663 | TFL,2018-02-01 664 | THANGAMAYL,2018-02-01 665 | THEMISMED,2018-02-01 666 | THIRUSUGAR,2018-02-01 667 | TI,2018-02-01 668 | TIJARIA,2018-02-01 669 | TIL,2018-02-01 670 | TIMESGTY,2018-02-01 671 | TIMETECHNO,2018-02-01 672 | TINPLATE,2018-02-01 673 | TIPSINDLTD,2018-02-01 674 | TREEHOUSE,2018-02-01 675 | TRF,2018-02-01 676 | TRICOM,2018-02-01 677 | TRIGYN,2018-02-01 678 | TTL,2018-02-01 679 | TTML,2018-02-01 680 | TULSI,2018-02-01 681 | TVSELECT,2018-02-01 682 | TVVISION,2018-02-01 683 | UBHOLDINGS,2018-02-01 684 | UCALFUEL,2018-02-01 685 | UCALFUEL,2018-02-01 686 | UGARSUGAR,2018-02-01 687 | UJAAS,2018-02-01 688 | UMANGDAIRY,2018-02-01 689 | UNITECH,2018-02-01 690 | UNITEDTEA,2018-02-01 691 | UNITY,2018-02-01 692 | UNIVCABLES,2018-02-01 693 | URJA,2018-02-01 694 | USHAMART,2018-02-01 695 | USHERAGRO,2018-02-01 696 | UTTAMSTL,2018-02-01 697 | UTTAMSUGAR,2018-02-01 698 | UTTAMVALUE,2018-02-01 699 | UVSL,2018-02-01 700 | V2RETAIL,2018-02-01 701 | VADILALIND,2018-02-01 702 | VAIBHAVGBL,2018-02-01 703 | VALECHAENG,2018-02-01 704 | VALUEIND,2018-02-01 705 | VAKRANGEE,2018-12-10 706 | VARDMNPOLY,2018-02-01 707 | VENKEYS,2018-02-01 708 | VENUSREM,2018-02-01 709 | VESUVIUS,2018-02-01 710 | VHL,2018-02-01 711 | VICEROY,2018-02-01 712 | VIDHIING,2018-02-01 713 | VIJIFIN,2018-02-01 714 | VIJSHAN,2018-02-01 715 | VIKASECO,2018-02-01 716 | VIKASWSP,2018-02-01 717 | VIMTALABS,2018-02-01 718 | VIPCLOTHNG,2018-02-01 719 | VIPIND,2018-02-01 720 | VISASTEEL,2018-02-01 721 | VISESHINFO,2018-02-01 722 | VIVIDHA,2018-02-01 723 | VIVIMEDLAB,2018-02-01 724 | VLSFINANCE,2018-02-01 725 | VMART,2018-02-01 726 | VSSL,2018-02-01 727 | WALCHANNAG,2018-02-01 728 | WEBELSOLAR,2018-02-01 729 | WEIZFOREX,2018-02-01 730 | WEIZMANIND,2018-02-01 731 | WELCORP,2018-02-01 732 | WELINV,2018-02-01 733 | WELSPUNIND,2018-02-01 734 | WENDT,2018-02-01 735 | WINDMACHIN,2018-02-01 736 | WSI,2018-02-01 737 | XCHANGING,2018-02-01 738 | XPROINDIA,2018-02-01 739 | YesBank,2020-03-06 740 | ZANDUREALT,2018-02-01 741 | CANBANK,2021-02-01 742 | ZENITHEXPO,2018-02-01 743 | ZENTEC,2018-02-01 744 | ZICOM,2018-02-01 745 | ZUARI,2018-02-01 746 | ZUARIGLOB,2018-02-01 747 | ZYLOG,2018-02-01 748 | GOKUL,2021-06-02 749 | PNBHSNG,2021-06-02 750 | RPOWER,2021-06-02 751 | RELINFRA,2021-06-02 752 | JSWISPL,2021-06-02 753 | MAZDOCK,2021-06-08 754 | ADANI POWER,2021-06-14 755 | ADANI TRANS,2021-06-14 756 | ATGL,2021-06-14 757 | ADANI GREEN,2021-06-14 758 | ADANI ENT,2021-06-14 759 | ADANI PORTS,2021-06-14 760 | FRETAIL,2021-06-15 761 | JISLJALEQS,2021-07-02 762 | SUZLON,2021-07-02 763 | HFCL,2021-07-05 764 | EQUITAS,2021-07-12 765 | UJJIVAN,2021-07-12 766 | EDELWEISS,2021-07-12 767 | IDEA,2021-08-06 768 | ZOMATO,2021-08-13 769 | VIPIND,2021-08-13 770 | NELCO,2021-08-16 771 | SHRENIK,2021-08-16 772 | APEX,2021-08-16 773 | HCL-INSYS,2021-08-16 774 | JPPOWER,2021-08-20 775 | ALPHAGEO,2021-09-06 776 | MCXHOLDING,2021-09-06 777 | SHREYAS,2021-09-06 778 | LIBERTY,2021-09-06 779 | SERVOTECH,2021-09-06 --------------------------------------------------------------------------------