Stop Loss Hunter Trading System with AFL Code and Backtest Results

Stop Loss Hunting is an unfair technique that causes individuals to get stopped out of their positions by driving the prices to a level where most of the traders have chosen to set their stop losses.

Also known as stop hunting, this is often done by market promoters or brokers to create fake volatility and momentum in the market, which in turn can be used to generate some quick profits.

Let’s take an example-

Suppose you enter long in stock at $100. Based on certain calculations you derived that $98 is the immediate support and place your stop-loss order at that level. You are very confident about the setup and waiting to see the profits coming in.

However, within a few minutes, your stop loss level is hit, the stock price goes further down for a fraction of time before it started moving up again. It crosses your original entry price and keeps accelerating.

I am sure this is a very common scenario every trader would have faced. But what exactly happened here?

The stop loss level ($98) was quite common and numerous traders would have chosen it for their trade. The promoters watching the market probably knew this fact and they decided to drive the prices to this SL level, which will trigger many Sell orders.

This in turn leads to high volatility in the market and lets the smart traders enter their positions.

SL Hunting Illustration

Reference: https://forextrader.live

In this post, we are going to look at a Stop Loss Hunter Trading System which lets you benefit from the volatility caused due to stop hunting. The system is built using Amibroker AFL and backtested on NSE:BANKNIFTY index.

Also ReadAll you wanted to know about Stop Loss strategies

Stop Loss Hunter Trading System – Overview

The system is based on the premise that moving average line is generally considered as a stop level. We have considered a 5-period simple moving average which can be changed as required.

This is a pure intraday system where if two consecutive candles touch the stop level and close above it, a BUY position is initiated. While if two consecutive candles touch the stop level and close below it, a SHORT position is triggered.

All the open positions are closed before the end of the trading day.

Below table summarizes all the system rules:

ParameterValue
Preferred Time-frame
15 minutes
Indicators UsedSMA, ADX
Buy Conditions
  • Current candle low is less than MA line but it closes above MA line
  • Previous candle low is less than MA line but it closes above MA line
  • 14 period ADX is less than 20
  • Trade time is between 9:30 to 15:15
Short Conditions
  • Current candle high is greater than MA line but it closes below MA line
  • Previous candle high is greater than MA line but it closes below MA line
  • 14 period ADX is less than 20
  • Trade time is between 9:30 to 15:15
Sell ConditionSame as Short or Time >= 15:15
Cover ConditionSame as Buy or Time >= 15:15
Stop Loss0.5%
Targets5%
Position Size150 (fixed)
Initial Equity200000
Brokerage100 per order
Margin10%

Stop Loss Hunter AFL Code

Download the AFL code from the below link. You may import this AFL in Amibroker and start using it.

Stop Loss Hunter AFL Code

AFL Screenshot

Below are some screenshots from the Amibroker chart:

Stop Loss Hunter AFL Screenshot1

Stop Loss Hunter AFL Screenshot2

Also Read: An accurate intraday trading system using DEMA and RSI

Stop Loss Hunter Trading System- Backtest Report

The system offers a great risk-reward ratio with limited drawdowns throughout the backtesting period. We have tested it on NSE:BANKNIFTY index but it should offer similar returns in any similar volatile instrument.

The annual CAGR of 39.38% is better than most of the system we have ever published.

ParameterValue
NSE:BANKNIFTY
Initial Capital200000
Final Capital3360562.00
Scrip NameNSE Banknifty
Backtest Period01-Jan-2012 to 30-Jun-2020
Timeframe15 Minutes
Net Profit %1580.28%
Annual Return %39.38%
Number of Trades1772
Winning Trade %39.16%
Average holding Period7.50 periods
Max consecutive losses17
Max system % drawdown-17.51%
Max Trade % drawdown-22.85%

Download the detailed backtest report here.

Equity Curve

See below the equity curve of the system that represents how the capital grew over time

Stop Loss Hunter Equity Curve

Profit Table

With an exception of 2017, this system has been consistently profitable every single year since 2012.

Stop Loss Hunter Profit Table

If you wanna learn and build your own Algorithmic trading systems like this, take a look at our structured courses at Trading Tuitions Academy

Additional Amibroker settings for backtesting

Goto Symbol–>Information, and specify the lot size and margin requirement. The below screenshot shows lot size of 25 and margin requirement of 10% for NSE BANKNIFTY:

Banknifty Symbol Info 25 Lots

Disclaimer:

All the AFL’s posted in this section are for learning purpose. Trading Tuitions does not necessarily own these AFL’s and we don’t have any intellectual property rights on them. We might copy useful AFL’s from public forums and post it in this section in a presentable format. The intent is not to copy anybody’s work but to share knowledge. If you find any misleading or non-reproducible content then please inform us at support@tradingtuitions.com

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *