Yash Mehta Profile picture
Jul 30, 2022 18 tweets 5 min read Read on X
Trading Strategies is something which gives an edge to a #Traders.

A Complete #Thread on How to Backtest your Trading Strategies and check whether strategy is good or not?

Like and Retweet so that it helps max people.
For every strategy, there needs to be a hypothesis whether that particular strategy had worked in the past or not.

So you can create a proper rule based strategy like Moving Average Crossover or even discretion based strategy like Price Action.
Now once you create a strategy, it needs to be backtested on historical data.

It's important to do a complete backtest for atleast 5 years, which might include a complete market cycle.
Higher the backtesting duration, the more accurate will be the result.
So there are various modes of backtesting: Manual Checking or coding.

Rule-Based strategies can be coded and backtested on Pinescript in @tradingview if you have coding knowledge. This will save a lot of time.

Manual backtest can take time, but it will be more accurate. Image
You can check out TradingView manual on Pinescript:
tradingview.com/pine-script-do…

Also, there are a couple of courses and free videos available on YouTube that you can check.
Also, in backtesting, you can add slippage, which generally happens in trading, and also add the trading cost: Brokerage, STT, etc.

Trading cost you can find on your broker's brokerage calculator and just subtract the Gross P/L of that trade with the Trading Cost.
Now, after all this, you will get all the required data to compute the final backtesting trading report.

There are two things to look into this: Trading Statistics and Historical Equity Curve.
In Trading Statistics, take out the following data:
No. of Trades
No. of Profitable Trades
No. of Loss Trades
Average Profit
Average Loss
Drawdown

All this data is shown in the sample trade stats report below. Image
With the above report, calculate the following things:

Win Ratio (A) = No. of Profitable Trades/No. of Loss Trades

Reward:Risk (R:R) = Average Profit/Average Loss

Expectancy Ratio = A * (R:R) - (1-A)

Expectancy in Value = A * Average Profit - (1-A)* Average Loss.
Expectancy in Value means that how much money are you expected to win for each trade that you take in future.

Expectancy Ratio if positive and above 0.4 that means strategy is good.
Now, we have taken Max Drawdown in the backtest.

Whenever you trade this strategy, that much is the minimum drawdown that you can expect in the future.

Always add buffer to this drawdown, in the case of the above image, 50% buffer is added above drawdown, which can be expected.
Now coming to the Equity Curve and Calculating Returns.

You will have to take a trading capital that will be used to trade this strategy.

Add all the net profit and loss of all the trade to this capital.

At the end of the bactesting, you will get a final capital value. Image
With this, you can calculate total returns in percentage terms and also the CAGR.

Total Returns = (Final Capital/Starting Capital -1)*100%

CAGR = ((Final Capital/Starting Capital)^(1/Duration) - 1) *100%
If you have created a strategy for trading, then compare this CAGR with the Nifty/Sensex CAGR over the same duration.

If your CAGR is more than the benchmark, then it is a green signal to use this strategy in the future.
Also, you can add a compounding effect in this strategy, like increasing quantities as your profits and capital grow.
Other wise investing in the benchmark will give you better returns than the strategy. And it would be a waste of your time to use this strategy.

After you both the trade statistics report and Equity Curve report are satisfactory, then go ahead with the strategy and use it.
Now that's all about backtesting.

Once you start trading it live or do forward testing, then always start with small capital and test it for 6-12 months. Don't pump in big capital because backtest doesn't prepare you emotionally and that will happen over a period.
That was all about the Backtesting and checking how good the strategy is.

I hope you found this thread helpful.

For more such learning #threads, Follow @YMehta_

Like/Retweet the first tweet below if you can:

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Yash Mehta

Yash Mehta Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @YMehta_

Mar 15
In Mahabharata, Abhimanyu didn't know the exit of the Chakravyuh and got trapped similarly in the stock market, exit in stocks is important.

In this learning thread🧵, sharing some Unique Exit Strategies of Profit Booking or Cutting Losses Early. Image
First Question that would come to your mind is why exit is important?

There are cases in which stocks loses entire gains just because of some negative triggers about the company.

The famous case is of Yes Bank and chart is shared below. Image
In all these cases, stocks are held in the greed of getting more profits or in the hope of recovering the capital. In most of the cases it doesn't work in the favour.

Let's see some of the strategies which can be used to exit stocks and protect your profits and capital, both.
Read 11 tweets
Feb 23
It is said that OPTION SELLING requires very huge capital to generate returns and manage risk.

But it is not TRUE!

A complete guide on how you can start Option Selling to generate active returns with less capital (Rs 1 Lakh) 🧵:
First of all, option selling is a very risky business because you can lose the entire capital if the market goes against you.

So it's important to do technical analysis properly. Read everything about Technical Analysis from Zerodha Varsity.

zerodha.com/varsity/module…
Technical Analysis will give you good knowledge on chart reading, which will help you do in doing analysis and sit in the right direction.

Before starting with F&O trading, it's important to understand how it works and what all things happen?
Read 24 tweets
Jan 28
Screeners helps trader in saving lot of time in filtering best stocks out of 5000+ stocks listed and thus save a lot of time.

Here is the list of top 9 Free Price Action based screeners that will help traders in their analysis 🧵:
1/ Bullish Engulfing:

The bullish engulfing pattern is a two-candle reversal pattern and it is a strong bullish candle that a trader uses to take reversal trades.

chartink.com/screener/bulli…
2/ Bearish Engulfing:

The bearish pattern is a two-candle reversal pattern and it is a strong bearish candle that a trader uses to take reversal trades.

chartink.com/screener/beari…
Read 11 tweets
Jan 26
Investing in stocks is boring, but it has created huge wealth for investors in the long term.

Sharing 4 Simple Investment Strategies to compound your capital.

For guidance, shared screeners of all the strategies.

Checkout a bonus trading strategy at the end.

A thread 🧵:
1/ All Time High Breakout:

Stock that breaks the uptrend are the one that can give massive upmove.
These stocks are considered as strong stocks in the market.

Timeframe should be monthly and if price closes above ATH on any day you can enter.
Example 1:

Bajaj Finance gave a breakout above ATH at around 55 and then it moved up till 5000 levels.

Total returns of 9000% in 10 years.

Simple Strategy, isn't it? Image
Read 19 tweets
Jan 24
This is going to be a big thread that exposes various irregularities that are going on in @HDFC_Bank at various levels of the bank's management.

I opened an account with HDFC Bank 6 years back. Thinking it as a good brand and best service to the customer.

In case you have an account in HDFC Bank then it is a must read thread which highlights the irregularities of the HDFC Bank.

@moneycontrolcom @ndtv @ZeeBusiness @FinMinIndia @RBI @DasShaktikanta
On 24th December 2023, I had got almost 50+ mental harassment calls from the recovery agent of the @HDFC_Bank. After picking up the calling, that lady was demeaning me and my family and abusing as well.

Post that, I have raised this issue on Twitter and took it to the CEO of the HDFC Bank as well by sending him a mail.Image
After complaining of the harassment calls few people from HDFC Bank: Mr. Dilip Das, Mr. Sagar Chaudhari got in touch with me to investigate the issue and we had various telephonic conversation on the same.

I was getting all the updates from Mr. Sagar to identify the root cause of the problem that has happened with the bank.
Read 17 tweets
Jan 19
Google Sheet is a powerful tool, but most people don’t know how to use it to excel in TRADING and INVESTING 📖

Top Google Sheet features every trader and investor should know in this Thread 🧵:
How you can use some secret features of Google Sheet and Google Finance in your trading together?

5 things that a trader should know and implement:
GOOGLEFINANCE(ticker, [attribute], [start_date], [end_date|num_days], [interval])

The above function is a basic one.

Let's decode each parameter in this:
⚡️ Ticker: This is the symbol of the stock.

"NSE: RELIANCE" is the ticker for Reliance Industries Image
Read 14 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(