Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

Supertrend V5.0 – Amibroker AFL Code

31 sec read

In the new version of Supertrend thought of removing ATR factor to make the trading strategy independent of volatility factor. It is a simple long/short strategy fits for trading lower timeframes (5min, 10min, 15min) and strategy requires carry-forwarding the open position.

Supertrend v5

Trading Rules
1)Long and close previous short when Buy Signal appears with Supertrend as trailing stop loss (Green Line) on close of the candle
2)Short and close previous long when Short Signal appears with Supertrend as trailing stop loss (Red Line) on close of the candle

Initial Paramter Settings (Nifty Future backtesting)

Initial SettingsValue
Initial Capital10,00,000
Position Size300 shares per trade
Trading ComissionsRs250/- per leg
Margin Required10%
Backtesting Period10th Aug 2010 - 27th May 2016
Rollover Charges CalculatedNo

Backtesting Results on Various Timeframes

Parameter5min10min15min
Net Profit196.46%142.44%194.90%
CAGR (Compounded
Annual Returns)
20.67%
16.55%20.56%
Total No of Trades1471743489
Winning Ratio41.05
37.82%42.74%
Consecutive Winners656
Consecutive Losers14137
Max Draw Down %21.70%-21.29%20.58%
CAR/MDD0.620.781.00
Recovery Factor2.864.916.47
Sharpe Ratio0.520.780.99

Previous Versions
Supertrend V4.0 – Amibroker AFL Code
Supertrend V3.0 – Amibroker AFL Code

Equity curve 5min

Supertrend 5min

Equity curve 10min
Supertrend 10min

Equity curve 15min
Supertrend 15min

Supertrend V5.0 – Amibroker AFL Code

https://gist.github.com/810eac5177addc4e5efbf162545829f3

Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

Algomojo Index Straddle/Strangle Execution Module with Intraday Stoploss

This tutorial focus on how to automate your index straddle/strangle strategy with intraday stop-loss levels with time-based entry and exits using Algomojo Platform and...
Rajandran R
7 min read

Learn How to Login into Algomojo Account using Amibroker

In the last tutorial, we learn how to automate the algomojo login process and in this video tutorial, we are going to learn with...
Rajandran R
1 min read

Amibroker Execution Module – Hedged Index Futures for Directional…

In the last tutorial, we learn the importance of Hedging Futures Position with OTM Options for Reduced Margin. This tutorial focus on how to...
Rajandran R
14 min read

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More