Standard Support Resistance AFL - AlgoJi

Step 1: The Trading Idea

Buy when short-term resistance is broken and stock is in uptrend

Step 2: Selecting Indicators for Support Resistance AFL

In most simple terms, support is defined at the price level from which market bounces up while resistance is the price level from which market goes down.

To find the short-term support level, we pick the lowest price in last 15 bars. The mid-term support level is found using lowest price in last 100 bars. Similarly we also calculate the short-term and mid-term resistance from the highest price over last 15 and 100 bars respectively.

When the market is trending, we buy on the break of resistance. But when the market is sideways, we do not enter a trade at all. Plus Directional Index (PDI) and Minus Directional Index (MDI) indicators are used to determine whether or not the market is trending.

Step 3: Defining Clear Strategy Rules for Standard Support Resistance AFL

Buy: When prices go above short-term resistance and PDI is above 30.

Sell:  When prices go below short-term support.

Support Resistance AFL

Step 4: AFL Coding Guide

We have created Support and Resistance functions which is a improvement over default HHV and LLV functions of AFL. We carefully define the Buy, Sell, Short and Cover rules; where Short and Cover are symmetrically opposite if Buy and Sell. This helps in smooth integration of this AFL with automated trading systems

Step 5: The Backtest

The strategy is significantly profitable in Bank Nifty current month futures. It generates a profit of 4776 points, or Rs. 3,58,200/ over two years on one lot (75 shares). The winner% is 40.38, which is decent for automated support and resistance strategy.

Related Article: Basics in Strategy Backtesting

  • Scrip: Bank Nifty current month futures, 15-minute
  • All trades executed at Close price of the bar on which signal is triggered
  • Brokerage: 0.01% of Trade Value
  • Data History: 01-01-2014 to 31-12-2015 (two years)
  • Strategy Optimization: None

Step 6: Further Improvement

We leave it to the readers to suggest any improvement in Step 2 and Step 3 which can increase the profitability. We can introduce custom stoploss as well as profit targets to further maximize the profitability.

Download here Standard Support Resistance AFL

Click here to download the editable Amibroker Support Resistance AFL Strategy

Click here to learn Support and Resistance from Chart School.

 

Free Webinar Series on Algorithmic Trading

29th May | From Concept to Automation – 9 Trading Strategies
30th May | Algorithmic Trading using Machine Learning in Python
31st May | Kickstart Guide to Algorithmic Trading
1st June | Algorithmic Trading Using Amibroker and MTv3