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)

SDA2 Trend Trading System Verion 2.0 AFL code

1 min read

Earlier during October 26th, 2010 SDA2 Trend Trading System is introduced in marketcalls. After revising my old strategy with better improvements releasing the newer version of SDA2 Trend trading system(version 2.0).This version is more optimized for Long Only Signals (Short Signals are treated as exit from the long position and stay away from the market). In the older version the SDA2 trading system wont perform good if there is any gap up or gap down in the trading instrument. The new version overcomes those flaw and it is more optimized towards those Gap Up/Gap Down. Trading system is tested in both Amibroker 5.4 and 5.5 versions.


[wp_ad_camp_5]

 
The Above chart is for Educational Purpose only not for any kind of Buy or Sell Recommendation in Nifty

Now Upper Channel and Lower Channel are built using the formula

Derived=WMA(WMA(WMA(((H+L)/2)+(O-C),2),2),2);
i=WMA(Derived,3);
Upper=(Derived+StDev(Derived,7))+ATR(2)/1.5;
Lower=(Derived-StDev(Derived,7))-ATR(2)/1;

Buy and Sell Condition

Buy Condition : Buy the Next day open when there is a Buy signal on the chart.
Sell Condition : Sell the Next day open when there is a Sell Signal on the chart.

And the Colour of the Candlestick will be toggled between Green and Red each time when the candlestick close breaks Upper Channel or the the low of the breaks the Lower Channel. This effort minimizes the maximum risk of any long position.

color=IIf(BarsSince(Cross(Lower,Low))>
BarsSince(Cross(C,Upper)), colorBrightGreen,colorRed);

Trading system had been backtested for nifty during the period 1st Jan 2000 to 16th Mar 2012. And the Results are shown Below

Trading System Statistics

Equity Curve

Profit Ditribution

Profit Table for SDA2 Ver 2

Download SDA2 Trend Trading System Version 2.0 AFL code

Waiting for your feedbacks and Comments.

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)

ADXVMA – Indicator – Amibroker AFL Code

ADXVMA is a volatility moving average using ADX as a core concept to identify trends. The trend filter acts as support during uptrending markets...
Rajandran R
1 min read

[Free Webinar] Building a Trading System with Amibroker AFL…

Join us for an insightful webinar on mastering the art of creating a robust trading system using Amibroker's AFL coding. Whether you're a seasoned...
Rajandran R
1 min read

How to Perform Machine Learning Using Amibroker and Python

Amibroker is a powerful technical analysis and trading system development platform, used extensively by traders and analysts for developing and deploying trading strategies. Python,...
Rajandran R
5 min read

3 Replies to “SDA2 Trend Trading System Verion 2.0 AFL code”

  1. Dear Rajandran,

    Thanks for the AFL. One request please- Can I get the AFL of Camarilla calculation on Intra day as well as for the EOD please.

    Regards,

    Veer

Leave a Reply

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