So, there has been some conversation regarding backtesting based on what I had posted few weeks back. I'll use this thread to tell you how I backtest ideas.
1. Depending on which instrument the idea is being tested for, I take the 1 lot quantity of that instrument.
2. I test for the entire in-sample period with just one lot quantity (75 if nifty, 25 if banknifty, and respective stock future unit sizes for stocks).
3. No additional lots will be added as the profits are generated.
For most, I keep 3 lakhs as starting capital with around 1.5 lakhs as the margin amount.
What this gives me is for one lot trading.
I look for the following:
1. Maximum Drawdown 2. CAGR 3. Risk vs Reward ratio 4. Average points per trade
5. Profit factor. 6. Win rate 7. No of trades per year
I would essentially want the maximum drawdown per lot to be less than 20%. If less than 15 or 10% great!
Also, I look for CAGR that's >=2x the max DD %
Now, that's what I am comfortable with, for the CAGR/maxDD to be 2 or more.
Average points per trade (before slippage and costs) that I look for is 10+ in Nifty Futures, 35+ in Banknifty Futures.
I also look at the time drawdown and how long the system was in drawdown. The comfort level varies across individuals, so it's upto you to decide what you're comfortable with.
I usually go for systems with win rate between 40-55%. That's my sweet spot. Anything lesser, I am not comfortable. Anything more, I might possibly be trading a system that's negatively skewed.
Once I have all this info, what I look for is how much leverage I will be comfortable with.
I also take the maximum drawdown in rupees. This number will be able to help me compound the lot size based on my level of aggression, as I accrue profits trading the system.
I'll illustrate this process with an example of a system I recently tested
System is completely intraday, closes at 3:15pm.
1. Starting capital: 2L (1L margin required)
Max DD: 7.5%
CAGR: 19%
RR: 2.1
Max drawdown amount: 75615
WinRate: 48%
Trades per year = ~200
Points per trade = 29-30 on BNF
So, based on this, the CAGR and maxDD are quite decent. CAR is around 2.5 and win rate is 48%.
This MaxDD and CAGR should drive how much leverage you'll take. Futures itself is leveraged, and when you trade with only 2L in your account per lot for BNF, that's like 66% leverage.
So, if you want to take leverage on top of this leveraged instrument, you decide how much.
So, if the max DD on that one lot test was 20%, if you were leveraged 5x, you'd have gotten wiped out in the past.
If say you'd be comfortable with a maximum 40% drawdown, you take only 2x leverage.
(This won't be the accurate actual future drawdown though).
What I do with the system is different though.
If I am very aggressive, I'd start with 2L capital for 1 lot, and for every 75615 rupees profit, I'd add one more lot.
If I am conservative, I'd start with 2L capital for 1 lot, and for every (2*75615) rupees, I'd add 1 lot.
If I am very risk-averse, I'd start with 2L capital for 1 lot, and for every 3*75615 or 4*75615 rupees, I'd add one more lot.
The number is the historical max dd amount. Risk averse works for me, so I'd do (3 x maxDD amount) rupees in this scenario per extra lot.
Based on whatever I decide, I then run the backtest with the specific compounding rule I decide, and get the system performance on how it has worked historically.
This is just so I could understand the system and you shouldn't take this step uber-seriously. Here's why:
When you establish compounding (adding lots) to the system with every x-amount in profit or whatever, you are taking too much liberty with the system's test especially when it is for 10+ years.
Why too much liberty?
You are basically assuming that throughout the 10+ year period, you got filled on every trade, at the specific price your entry is according to the system. If you go even above certain number of lots, you'll have slippages. Above few lots, you won't get filled in the same order.
So, whatever results you get in this step, while it gives an approximate estimation of how much your return would have been, how much your maxDD would have been, etc., take it with a huge jar of salt, margin of error.
On the other hand, the one lot backtest is a relatively more accurate representation of the system's performance in the history, allowing a certain margin of error for fills, slippages, commissions.
I then take the system and live test with one lot for 25 trades. Upon the completion of 25 trades, I see whether it's in line with backtest results for the 25 trades. Although a small sample, it's good to start with. Then, I start trading with the actual rules I have decided.
This has been useful for me personally. Now, this process is not without its errors. Coz, I am not a full blown quant yet.
I am sure most people on Twitter commenting on what I had posted, posing as experts aren't doing it completely right and error free either.
So, as with anything, take the good, leave the bad, and improve the process by simultaneously educating yourself. All I ask of you is, don't take my word for it. Let my threads be an initial initiation of sorts into certain things, and you go do your in-depth research.
If you only listen to what I say or what people who claim to be expert quants (or expert data scientists, expert traders, expert whatever) say on twitter, you're bound to make mistakes that will be costly.
Don't trust, Always verify.
Keep this motto, and always be testing and learning.
That's what I do and I wouldn't expect anything less of you either, whoever you are, reading this.
This is the process I follow, and I am refining it every week. You should too.
As for optimization, I do it on the in-sample data and test with the out of sample data for the effectiveness of optimization.
This backtest process I have given above is a surface/beginner level work I have put together for myself from whatever I have gathered from traders.
These are traders I know and are quite successful trading 200+ lots in the Indian market indices.
When you talk to a Two Sigma or a Citadel quant, he/she would laugh at this process and say "noob stuff!" or even call it "blasphemy".
But this is what I work with based on the level I am at. If I aim to be absolutely perfect, the best, and do it 100% right like the buy-side quants do, I will not be able to trade for another 3-4 years. So, I keep my process open to evolution.
I'll update this thread as and when my backtesting process evolves, to accommodate for better and more rigorous testing, without compromising the ease of understanding the historical performance.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
Whatever systems I trade (I have a couple systems I trade manually now), I trade without using leverage on top of leverage.
I primarily trade 2xATM or synthetic futures directionally, predominantly to avoid futures related slippages and reduce costs.
Banknifty futures spread is around 4 points, and slippage is usually 3-5 points one way. That is like 17-20 points two way. Add to this the commissions and all, worst case you end up looking at 20-22 points as your cost.
Nifty Futures is slightly better with respect to spread and slippage, but neither banknifty futures nor nifty futures have enough depth to scale up with, at least on intraday timeframes.
A week back, the team from TIKR.com reached out and asked me to do a beta testing of their product for feedback.
While the platform is at its nascent stage and has a long way to go, it is very promising and better than SCREENER.IN in few aspects.
This is the platform dashboard page where you have the market news and updates as and when they arrive. I think they are pulling this from Reuters, not sure though.
You have a search bar on top in the platform, where you can search for stocks and get the requisite details. The best part is, the platform has both Indian and US equities. They have data from many exchanges across the globe.
Grab a peanut butter sandwich. I'm gonna teach you the Dividend Arbitrage strategy in @10kdiver's style ;-)
Arbitrage = Free Lunch in market. Free lunches usually don't exist, but they do exist, if you know where to look.
What amateur traders/investors think:
"Oh, this company has announced dividend. Let me buy the stock so that I can receive the dividend. I'll sell the stock just after the requisite date until which I should hold the stock. I'll then pocket the dividend. Free money yay!"
What happens:
The stock price rises leading up to the ex-dividend date, and then falls. You get the dividend, but the stock you hold falls in price equivalently. So, you're left with no profit, and if you're lucky, no loss either.
People who believe Warren Buffett to be a buy and hold investor are not very well informed.
First and foremost, Warren Buffett is a master deal-maker. And he's an expert at using derivatives to protect himself.
If he were only a buy and hold investor, he'd not be this rich.
More often than not, he's used a combination of derivatives, complex instruments in order to create a what's called "heads I win, tails I don't lose much" scenario, like the deal he did with Goldman Sachs during the housing crash.
This superb mastery of the use of right derivative instruments with the most opportune timing backed by his cash holdings has created wealth for him beyond what a simple buy and hold would have.
1. A lot of content on trading that you find on Youtube is utterly and absolutely worthless. More like 99%.
Google's job is to give you the best results - based on likes, comments, interactions, etc.
The people who do the search decide what gets ranked where. New traders searching for terms makes Youtube figure out what terms are searched more.
The Youtubers figure out what terms are searched more and create content based on those terms.
Most of the creators aren't creating content that's super valuable that you should watch, because that content will not be ranked by Google. Coz, Google only ranks the content that people are looking for.
The problem is that people don't know what to look for.