How to Backtest Positional Strategies
Indices are divided according to two expiry dates:β
If you trade in indices with weekly and monthly expiry, these two indices are available.
If you trade in indices with monthly expiry, these four indices are available.
When you trade in monthly expiry, you also get the option to get weekly expiries from the previous regime.
Toggle Options:β
- Toggle ON includes:
Previous Regime Weekly Data & New Regime Monthly Data - Toggle OFF includes:
Previous Regime Monthly Data & New Regime Monthly Data
Once you have selected the index, you can choose which market you want to trade in. We have cash and a future market.
Letβs say we are trading in Nifty in the cash market. Now the next step is to make our strategy.β
Here we are talking about Positional Strategies.
Positionalβ
- Entry Time: The time we want to enter our strategy.
- Exit Time: The time we want to exit our positions.
- Trading days before expiry: The number of market days remaining until the expiration.
If the expiry for a monthly option is the last Thursday of the month:
- If today is Monday, December 18, 2024, and the expiry date is Thursday, December 26, 2024, there are 5 trading days remaining (excluding weekends and holidays).
You can also select the day when you want to enter and exit the market.
Average Trading Days to Expiry:β
Expiry periods usually have 15β16 average trading days, though in rare cases, there may be up to 24 trading days.
Example: Counting 15β16 Trading Days for Monthly Expiryβ
Assume the monthly expiry is on Thursday, January 25, 2024 (the last Thursday of January). Here's how to count backward:
-
Mark the expiry day:
Expiry date: Thursday, January 25, 2024. -
Exclude weekends (Saturday & Sunday):
Trading days are only Monday to Friday. -
Count backward from the expiry date:
Start counting trading days from Thursday, January 25.
Date | Day of Week | Trading Day? | Trading Days Count |
---|---|---|---|
January 25, 2024 | Thursday | Yes | 0 |
January 24, 2024 | Wednesday | Yes | 1 |
January 23, 2024 | Tuesday | Yes | 2 |
January 22, 2024 | Monday | Yes | 3 |
January 19, 2024 | Friday | Yes | 4 |
January 18, 2024 | Thursday | Yes | 5 |
... | ... | ... | ... |
January 01, 2024 | Thursday | Yes | 20 |
In this example, there are 20 trading days.
Positional Expiry (Weekly vs. Monthly):β
- Weekly Expiry: The position will expire every week, i.e., the Thursday of that specific week.
- Monthly Expiry: The position will expire monthly, typically the last Thursday of the month.
Strategy Settingsβ
Legwise Settings:β
Once you have selected the strategy type, you can choose to square off partially or completely.
Leg Builder Settings:β
To fine-tune your strategy, you can choose different settings in the Leg Builder:
- Segment: Future or Options
- Lot: Number of Lots
- Position: Buy or Sell
- Option Type: Call or Put
- Expiry
- Select Strike Criteria
- Strike Type
Adding a Leg:β
Once you are done with these settings, you can also add a leg. To add a leg, click on Add Leg.
Customizing Strategy Settings:β
Then you can choose to customize settings according to your strategy.
You can add:
- Target Profit
- Stop Loss: Select one option from the dropdown and create the strategy accordingly.
- Trail SL
- Re-entry on Tgt
- Re-entry on SL
- Simple Momentum
- Range Breakout
Overall Strategy Settings:β
Once you are done with these settings, you can move to the overall strategy settings.
These settings are applied to all of your strategies.
Saving and Backtesting the Strategy:β
Click on the save button at the bottom right & save this strategy with any name. Now to backtest this strategy:
- Select the time for which you want to backtest.
- Click on Backtest.
It will give you the backtest results and stats of this strategy.
You will find a toggle as shown in the image. If you turn this OFF, it will exclude backtesting data before the implementation of the latest SEBI changes.