How to do backtesting in Zerodha?

Short Answer

Zerodha is India’s number one broker in terms of active clients and also by trading volume. Zerodha offers many platforms to its clients to trade on. ‘Zerodha Pi’ is one of Zerodha's most advanced platforms that allows you to backtest and create various Algo strategies.

Detailed Answer

Zerodha is India’s largest and most trusted stockbroker with over 6+ million clients. Zerodha offers many platforms for trading such as Zerodha web browser, Zerodha Kite, Zerodha Pi, etc.

All these platforms have unique features. The web browser of Zerodha offers all the features to consumers including access to the back office. At this place, you can get comprehensive reports of your trades and Profit and loss statements.

Kite by Zerodha is the best mobile application in the market as of now. It makes a great platform for traders who want to trade on the go. Similarly, the Pi is a more advanced and complex platform offered by Zerodha. Pi is not for beginners as it runs on a separate platform (NEST). Here you can implement ALGO trading, Backtest and Create strategies, and many more.

How to Backtest in Zerodha Pi?

The Pi is an advanced platform offered by Zerodha to all its clients. Pi has some distinctive features such as advanced charting, Algo trading, Strategies backtesting, etc. Let’s see how to backtest strategies on Pi:

Before backtesting in Pi, you will have to code the transcript on which the trade will take place. The entry and exit criteria have to be coded separately before you start the backtest.

1) Open your Pi terminal. Go to ‘Alerts’ and click on ‘backtesting.’ After you have clicked on ‘Back Test’, a new window will open.

2) In the next window, select the script under ‘Select Symbol’ (Stock/Index) on which you want to run your backtest. After that under ‘Periodicity’, enter the time frame on which you want to test this strategy on. For example min, hours, days, etc.

Then select the candle time frame under the ‘Bar Interval’.For example 1 min, 15 min, etc.

After this, add the total historic time frame on which you want to test your strategy under ‘Days’. Example- 5 days, 2 days.

3) When you have successfully populated all the necessary criteria fields, you need to add the Code that you have made. Select the ‘Buy Script Tab’ and paste the code for the “Entry Strategy”. Paste the exit code in the ‘Exit Long Script tab’. Make sure that this is a long (Buying) strategy or else this would not work.

4) After this click on the ‘backtest’ button to begin the backtesting process. Once the system completes the backtesting process, the result of the same will be displayed on the right side of the same screen.

With this, you can backtest any of your strategies using Zerodha Pi. If you don’t know how to code, then there are many pre-existing templates that you can choose from. Click on this link to find out a range of strategies https://zerodha.com/expert-advisors/ . You can choose any one of these and implement it on your own backtesting strategy.

Tagged With: ZerodhaOptions TradingBacktestingAlgo TradingZerodha PiIntraday trading
Ask your query and our expert community would be happy to help
Discussion (0)
Related FAQs

How can one execute intraday trades on Zerodha?

Intraday trading on Zerodha can be executed with ease by choosing the type of trades you want to engage in. These could be NIFTY, BANK NIFTY, or future options of companies. Once you choose the respective lot, then choose the type of orders and then buy the shares. Trade them when you see a profit or wait till a specific point till you recover your investment.

Is Zerodha Streak free? Algo Trading Platform

Zerodha Streak was launched; it was completely free, but not anymore. Right now, you need to pay a fee for using the Zerodha Streak.

Can I automate my trading with Zerodha Streak?

Streak is an online Options trading platform that helps Derivative traders to, create, backtest and deploy their own option strategies in the live market. Streak also provides Algo trading to its users without the need for any coding. This automates the process of trading to a large extent.

Is Intraday trading good for beginners?

Intraday trading is more risky and challenging when compared to long-term investing. Is it not a preferred option for beginners as it requires considerable capital, expertise, adequate knowledge about trading, and multiple other factors. For beginners, the best way is to deploy the majority of your capital towards long-term investments and use the remaining for hedging or short-term trading.

What trading is better, F&O or intraday?

Intraday is feasible if you have enough capital and are aware of the stock's performance, while F&O helps in the prediction of the price whether it would rise or fall to book profits.

How to use stop loss in Zerodha?

Putting Stop losses for any position is an essential step to ensure that no major losses occur if the view on the underlying goes wrong. You should always place a Stop Loss when trading Intraday or positional. You can use a stop loss in Zerodha by following some easy steps.

Which Options Greeks should you know about before Trading Options?

Options Premiums are primarily made up of two values. Intrinsic Value and Time Value. Whereas the change in the price of the Option premiums is dependent on five factors called Option Greeks. These are Delta, Gamma, Theta, Vega, and Rho. Know more about options greeks and which Greeks should a trader keep an eye on while trading Options.

What is the Best strategy for Options Trading?

There are many complex Option Trading strategies out there but the most profitable are some of the simpler ones. The top 3 of them are Long & Short Straddles, Long & Short Strangles and Bull/Bear spreads.

What is Uncovered or Naked Options Trading?

Naked or Uncovered Option trading is a type of trading/speculating where a Call or Put option is bought or sold by different individuals at the same time expecting different price direction movements. Naked Option trading is a Zero-Sum game which means that the Profit for one is a Loss for the other individual.

Which is the best time frame for Options Trading?

Options Trading is a risky business and options traders have to look at various parameters before taking a trade. Choosing a time frame is one of the factors in options traders. Both option Buyer and Sellers use different time frames to trade. Let's see which time frame is most useful for options buying as well as selling.