This solution shall be hosted on web server (bigrock) with cPanel
• Login to Zerodha
• Place Bracket Orders
• Exit Positions
• Status updates on Telegram bot
• Web Interface
1. Login to Zerodha Account at a defined time, generate access to token and store it in database for next course of action for the day.
2. Page to manage "Primary Settings", "Trade Settings" & "Stock Settings" (check attachments)
3. Manage = Add + Edit + Delete, would be great if I can just upload the csv files at one shot to update/replace all settings
4. Create a bot (1) in my telegram account and push proper error message whenever it encounters
5. Create a bot (2) in my telegram account and push status updates for; Login Status, Advaced Orders Placed, Opening Orders Places, M2M by strategy at frequency set, M2M hit Stop Loss with net loss incurred, M2M hit Target Profit with net profit, final status of positions at 2:55 PM
6. Create a bot (3) in my telegram account and push end of day net M2M by Strategy and Funds available in account, Margin Utilized
7. Log every details and events in mysql database (option to disable once the program is running successfully, should be able to re enabled if any error occurs in future)
8. Access to python script shall be restricted by login id and password
9. At 6PM fetch the Trade Log and update in database for future analysis.
10. Fetch strategy wise settings from "Trade Settings"
11. Schedule to run the program by Strategy defined in “Trade Settings”
12. Fetch the list of stocks “StockSettings” for scheduled strategy where Date column = Daily or Current Date
13. Fetch OHLC for the stocks listed (previous step)
14. If for the list of stocks fetched; Entry_Type, Entry_Price & Quantity is NOT mentioned
a. Check for list of stocks where Open Price = Today High and Open Price = Today Low
b. Shortlist stocks based on % change (stocks whose % change is greater than defined % and less than defined %), if total shortlisted stocks are greater than “Max_Positions” defined in Trade settings, sort the list by absolute % change (ASC Order) to short list again.
15. If for the list of stocks fetched; Entry_Type, Entry_Price & Quantity is mentioned
a. For the list of stocks if Entry_Type = BUY; check Current Market Price is Less than Entry Price and Day High is Less than Entry Price. if Entry_Type = SELL; check Current Market Price is Greater than Entry Price and Day Low is Greater than Entry Price
16. Divide capital to selected stocks
17. Place Bracket Order with entry price, stop loss and target profit, trailing stop loss
a. BUY if Open Price = Today Low : Entry Price = Today High + Trigger_Price_Addon
b. SELL if Open Price = Today High : Entry Price = Today Low - Trigger_Price_Addon
18. Exit all stocks by strategy at defined time or if any of the pre defined conditions met.
19. Check M2M by strategy (net profit or net loss of open positions), exit all positions (including pending) by strategy if M2M is >= target profit or <= stop loss (ex. if M2M <= -1000 rs or M2M >= 2000 rs exit \positions)
20. When exit command is triggered based on Trade Settings, Exiting positions shall happen in two phases
a. Phase 1: update bracket orders exit price to current market price (iteration 1)
b. Phase 2: if the positions does not close per iteration 1, force exit positions.
21. Stop checking once all open/pending positions by strategy are closed
Final Clean up:
22. Check and force exit all open positions and pending orders every 5 minutes starting 2:55 PM to 3:15 PM, this shall execute each time independently and not in loop, to ensure if there is any error to close the positions at first time, it should try to close them on next run
• Primary Settings (like credentials and overall settings)
• Trade Settings (at strategy level)
• Stocks Entry (at scrip level)
• Daily Trade Log
Skills Required: Python, MySQL, Telegram Bot, Proficiency in using Zerodha KITE API
3 freelancers are bidding on average ₹16778 for this job
Hello I have been developing algo trading platforms and modules from many years. I have worked with zerodha API and upstox. Please check [login to view URL] which we have recently developed. Regards