Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in and Co-Creator of Algomojo (Algorithmic Trading Platform for DIY Traders)

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 Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in and Co-Creator of Algomojo (Algorithmic Trading Platform for DIY Traders)

Plotting Day Wise Equity Curve using Amibroker

We know that Amibroker provides an equity curve for the whole strategy. Is there a way where we can build a simple Day Wise...
Rajandran R
1 min read

Simple Open Range Breakout Trading System with Exploration –…

Opening Range is very often a measure of security high and low generally monitored by breakout traders to gauge the sentiment of the market....
Rajandran R
5 min read

Range Filter – Trading Strategy – Amibroker – Better…

Range Filter is a non-ATR-based trend following strategy inspired by Tradingview Pinescript coder - DonovanWall. According to him, Range Filter is an experimental study...
Rajandran R
4 min read

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