0% found this document useful (0 votes)
11 views

How to Backtest a system

Uploaded by

VISHNU SEKAR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

How to Backtest a system

Uploaded by

VISHNU SEKAR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Sourabh Sisodiya, CFA

@sourabhsiso19

13 Tweets • 2021-11-18 16:22:37 UTC •  See on Twitter


rattibha.com 

How to build/backtest a strategy ?

1) Idea/Hypothesis
2) Specify entry,exit, SL & position size
3) Generate trade log & Backtest Report
4) Test in diff. market condn.
5)Optimise the strategy
6) Evalute the robustness & stress testing
7) Track Real Time performance
8) Deploy
1) Idea( Eg. Theta Eating Strategy)

Options decay with passage of time.


I look at the theta decay curve & wonder that
some decay is intraday and some is overnight.
Can I capture the intraday theta decay by creating
delta neutral positions ?

#idea #theta
2) Entry, Exit, SL & position size

Can we create intraday straddle to capture theta


decay ?

Initial Logic :

Entry : Create straddle at 9:20 am


Exit : Close the straddle at 3:15 pm
SL : 10% of combined option premium
Position Size : 1 lot (CE & PE) per 2 lakh
3)Generate trade log & basic backtest report

The trade log contains all trades as per your trading


logic.
Also plot the equity curve(cumulative P&L )
& certain backtesting metrics to see if the
results are decent.

If yes then proceed further else discard the strategy.


4) Generate a detailed backtest report & test
across different market conditions.

Look for metrics such as-


Outlier adjusted performance
Max drawdown & Time drawdowm
Profit factor
Model efficiency etc to decide whether the systems
fits your psychology.
5) Optimise :

If the basic results look good, dig deeper.

-What if we exit at pre-defined profit instead of 3:15


pm ?
- Days suitable for the strategy ?
-Days when you should avoid the strategy ?
- High vix or low vix ?

Basically generate more insights.


6) Robustness & Stress Test

Check performance on black swan days


Check performance by removing outliers &
max
Are trades evenly distributed ?
Consistent performance qtr by qtr, year by year,
Even dist. Of PnL ?

Also do walk forward testing.(Advanced topic so


will explain later)
7) Track Real Time Performance

Start live execution with small qty before actualy


deployment to get feel of the strategy.
Try to incorporate the feedback from live execution
to further improve the strategy.
8) Deploy :

if the strategy passes all above steps then it’s fit for
live deployment.

Deploy the strategty and monitor the real time


performance.
The live performance should be similar to the
backtest results.
9) Other important points

Make sure you avoid the following backtesting


pitfalls and clean the data before backtesting.

-survivor ship bias


-look ahead bias
-in sample bias

Also include slippages,brokerage for true picture of


the strategy
10) As a rule if you backtest for n months , you can
trade for n/3 months.

And you need to assess your strategy from time to


time bcz as market conditions keep changing your
strategy may stop working.

How do you know your strategy has stopped


working ? Think over it.

11) Resources :

Trading Systems by Emillo Tomasini is a good book


to get started & learn how to build a trading
system

Also one can start learning basic python for data


analysis & backtesting

https://www.udemy.com/course/python-for-
finance-and-trading-
algorithms/learn/lecture/7155466#content
12) I hope you found the thread insighful.

I truly believe that small data insights can bring


significant improvement in your trading

Start learning basic coding & data analysis


online.
It’s not difficult, trust me. Just get started

End

These pages were created and arranged by Rattibha services


(https://www.rattibha.com)
The contents of these pages, including all images, videos,
attachments and external links published (collectively referred
to as "this publication"), were created at the request of a user
(s) from Twitter. Rattibha provides an automated service,
without human intervention, to copy the contents of tweets from
Twitter and publish them in an article style, and create PDF
pages that can be printed and shared, at the request of Twitter
user (s). Please note that the views and all contents in this
publication are those of the author and do not necessarily
represent the views of Rattibha. Rattibha assumes no
responsibility for any damage or breaches of any law resulting
from the contents of this publication.

You might also like