As discussed in the last chapter, Once a stock pops up in the watchlist of “Double Inside Bar”, “NR7+Inside Bar” and “Index Inside Bar”, We follow this follow the rules of famous Inside Bar strategy –
In case of gap up above the previous day’s high or gap down below the previous day’s low, please avoid buying it or selling it respectively. It means –
Also, the strategy does not demonstrate impressive performance when implemented on Narrow Range Bars. This is why, in the Buddha strategy, we focus on a watchlist comprising stocks that exhibit both “Narrow Range 7 Bars” and single “Inside Bar.” We call it NR7 Inside Bar.
We Shall backtest for types of patterns using the Inside Bar Strategy discussed earlier –
These patterns are also integral to the Time Compression Strategy, which involves scanning stocks for these bars. You can go through this course of Coding Time Compression Scanners that shows how to scan the stocks for these bars from stratch.
Let’s download the dataset for backtesting –
index_ib.csv . It contains all dates when NIFTY and BankNIFTY Index exhibited Inside Bar Pattern since 2015 to today.
double_ib.csv . It contains all the FNO stocks that has exhibited Double Inside Bar Pattern since 2015 to today.
tripple_ib.csv . It contains all the FNO stocks that has exhibited Triple Inside Bar Pattern since 2015 to today.
nr7.csv . It contains all the FNO stocks that has exhibited both Inside Bar Pattern and NR7 Pattern since 2015 to today,
The content of the CSV File looks like this –
date symbol marketcapname sector
0 01-12-2015 NIFTYFINSERVICE Smallcap Indices
1 01-12-2015 BANKNIFTY Smallcap Indices
2 07-12-2015 NIFTYFINSERVICE Smallcap Indices
3 10-12-2015 NIFTY Smallcap Indices
4 10-12-2015 NIFTYFINSERVICE Smallcap Indices
... ... ... ... ...
558 31-07-2023 BANKNIFTY Smallcap Indices
559 04-08-2023 NIFTYFINSERVICE Smallcap Indices
560 07-08-2023 BANKNIFTY Smallcap Indices
561 10-08-2023 NIFTY Smallcap Indices
562 17-08-2023 NIFTY Smallcap Indices
563 rows × 4 columns
It shows the names of the stocks and the time in which they were triggered. You can use the shared file as a starting point for the rest of the guide of backtesting. You may also use the data for other purposes.