Code Monkey home page Code Monkey logo

zerodha-algo-trading's People

Contributors

anandaanv avatar dheemantech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zerodha-algo-trading's Issues

create configurator..

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.

Add strategy tuning configuration

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.

Provide relative Options data in Strategy computation as Indicator

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.

Consider creating a PWA

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.

Fix data fetch issue

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.

facility to put trade from the live running server.

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?

  1. Fetch the live quotes from the provider. may be all candles for the day.
  2. Merge the live data with the latest available data in the databse.
  3. Create a Bar series from both.
  4. Run the strategy verifier.
  5. Put the trade when it satisfied as an Intraday basket order for now... Reminning configurations will follow.

Document

Could you add documents to use in real time

merge historical data for same series

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.

Fully configurable strategy building and backtesting..

Take the library to the desired level of abstraction.

Following things in the strategy building should come from configurations -

  1. What data to load, Exchange, Inetrval, Correlation(Future, options) etc.
  2. What timeperiod to look at? 1 min, 3 min, both one min and three min etc
  3. Strategy parameters

Based on these details, strategy builders can build all the details.

Addition of new intervals

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.

Issues with live stratege runner

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.

Move the timerange configs to database.

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.

multi-series strategy

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.