Do simple strategies really work in Indian Markets? This curiosity arises when one of our Amibroker Mumbai Participant comes up with a simple trading strategy. Hence the tutorial series, Do Simple Strategies Really Works?. This tutorial series explores the space of simple rules, easy to practice, easy to adapt and the to explore if there is any real edge with the simple rules.
Lets kickstart with the very simple trading strategy,
Buy if the price touches previous day high with stop loss as previous day low
Sell if the price touches previous day low with stop loss as previous day high
as the day progress previous day high and previous day low will be acting like a trailing stop loss. It is a simple long-short system where the system is always in position.
Previous Day High Low Breakout Strategy
To test this rules written a simple Amibroker AFL Code where the entry is limit order as the entry levels are predefined (Either your previous day high or low is your entry point) and if there is any gap down situation at open then buying/shorting at price is considered. And the AFL code is programmed accordingly to get the appropriate backtesting results.
Symbol | Nifty Futures |
Timeframe | 1 min |
Trade Execution | LMT order at a touch of price level & MKT order in case of Gap up/ Gap Down |
Dataset Length | Sep 2010 – Oct 2017 |
Trading Commissions + Slippages | 0.02% |
Initial Capital | 3,00,000 |
Position Sizing | 2lots or 150 shares per trade (Fixed shares) |
Filter | 1 point filter from entry level |
If you are using a discount broker like Tradejini, Zerodha, Upstox theoretical commissions works out to 0.01% in case of futures whereas with full broker theoretical commissions will be bit higher. Since there are gap up and gap down situations, where one cannot exactly punch orders at the open price of the candle hence market orders are placed which eventually results in extra slippages. So a theoretical value of 0.02% is used whereas in real life it could be even much higher depends on how volatile markets are when it is opening with gap up or gap down. Higher the volatile or emotional higher your slippage would be.
Backtesting Metrics | Long/Short | Long Only |
Initial Capital | 3,00,000 | 3,00,000 |
Ending Capital | 9,30,581 | 9,41,319 |
Net Profit | 6,30,581 | 6,41,319 |
Annual Return % | 17.22% | 17.41% |
Total Trades | 797 | 399 |
Winning Ratio | 37% | 40% |
Drawdown | -47% | -34% |
Sharp Ratio | 0.43% | 0.91% |
Avg Profit/Loss | 791 | 1607 |
Profitable Months | 54 out of 86 months | 56 out of 86 months |
Equity Curve – Trading Long/Short
Equity Curve – Long only
Trading strategy makes money undoubtedly in both long/short and long-only system. However, it tends to lose money when only short is practised. Overall performance of long-only is good in terms of risk and returns in comparison with the long-short system. In long-only system drawdown is controlled, profitability is increased. But still there are emotional phases where it goes through the extensive drawdown in terms of money and time which will definitely test the patience of any trader.
https://gist.github.com/b7db3d34ef3e089168dd33550f7f28a3
Download Amibroker AFL Code Previous day High Low Breakout Strategy
Dear Sir,
Please provide any free site or software where I can get the daily, weekly and monthly data of stocks in the same view.
This strategy makes money in a trending market , nifty was sideways/flat at 5000 levels from 2010 to 2013 loses money. Also SAR will loose money if the markets become volatile.
please put back test afl also back test not posble
What happens if both high & low breakdown happens on the same day?? How to backtest it on daily data(without Intraday Data), I mean without knowing which breakout happened first in this case?
We put Buy stoploss and high and sell stop loss and low. which ever first touches is the entry and other would be the stoploss.