anandaanv / zerodha-algo-trading Goto Github PK
View Code? Open in Web Editor NEWA codebase to connect zerodha connect along with algo trading library to use power of algo trading with zerodha
A codebase to connect zerodha connect along with algo trading library to use power of algo trading with zerodha
When a strategy is backtested, it usually works on some configuration about date range or number of avegare like SAM20 or SMA 10 or etc..
We need to break this dependency. User should be able to tell that, I want to test my strategy in two average ranges, say from 10SMA to 12SMA and 20SMA to 25SMA, based on this data, we should be able to find out best working combination for the given script.
Its a little ambitious feature, and might need significant time in design, too.
When a strategy is created, there are bunch of parameters created, like If it SMA, then it can be either 10 SMA or 20 SMA.. of if you want to setup profit booking or stoploss, then that are certain values.
These values are different for every scrip.. like the value that applies for SBI might now apply for ICICI or reliance.. The volatile script can have higher targets, while some other relatively statble scripts can have lesser targers.
The idea is to extract these parameters to a configuration, may be key-value that will be used by strategy builders in order to create strategy.
Ability to provide the option scripts as PEITM1, PEITM2, PEITM3 where PEITM1 is PutInTheMoneyNearest1, PEITM2 is PutInTheMoneyNearest2 and so on. This will make the strategy builders not to rely on extracting the names form scripts, but they can build a strategy based on standard variables. This can actually help us to write our own scripting language in future.
This appears to be a challenging task. And a design change is Must.
Just a suggestion.
One codebase for web, android, ios.
People will mostly use such a service over a large screen on desktop/laptop browser, so webapp is a must.
Mobile apps should have minimal functionality like viewing trades, stop or start.
Much easier to find web devs to contribute.
Data fetch appears to have some issue. For 15 mins candle, its not fetching data beyond 2 months, and may be the same case if for others, too. we need to check whats going wrong in this.
Now that backtest is working fine, its time to put live trades in production with the system and take it to the production
What should it do?
Could you add documents to use in real time
Current DataLoader loads NFO data for only current month. say e.g. If you take INFY, there can be many option series expring every month say current price is 700, then there will be series like INFYOCT19700CE, INFYSEP19700CE, INFYNOV19700CE, all those series should be counted as single series. How to do that? Create a separate relationship table, that scans the instruments and finds out the relationships in Base script and derivatives and their Instruments. Upon data requestm we can fetch all derivatives from same script, and merge the hostorical data based on expiry. This will make it very easier to backtest the data for any script.
Take the library to the desired level of abstraction.
Following things in the strategy building should come from configurations -
Based on these details, strategy builders can build all the details.
Currently the code has too many hardcodings that makes it veru difficult to add a new interval.
Following tasks are done while adding new interval -
Because its an informed decision, we still want to separate the data based on tables. So we are going to create new repositories for every new interval. However, it will be hidden from the above layers. Business layers will look at them as a single CandleRepository.
Two issues observed while running the stragety today -
The trades were triggered based on high / low instead of close, which increased the probability of entering into false breakouts.
Today stoplosses triggeded immediately after I entered the trade, it triggered when price returned into opening range, and it was random..
Possible rootcause - There is proabbly some issue in the logic we use to merge the historical data and current data.
While currently we have all the data fetched for 2 years, its really difficult to read it and run a strategy for even a small change.
Take it to some config, so that we can fetch only selected data based on trading symbol and exchange.
Ta4j strategy is actually a set of multiple indicators and rules.
In the larger trading systems, we actually have lot of different scripts to look at, like Future, options etc.. Thus,
Create an interface for creating a strategy that will accept all such symbols, may not be actual series, but its derivatives, like Open INterest, or theta value etc, and help strategy developers make decisions based on that.
Create a nightky job to pull the data for all stocks in the watchlist.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.