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.

Coral Trend Indicator – Amibroker AFL Code

1 min read

Nifty Future EOD charts
Coral Trend Indicator

 

Coral Trend Indicator is yet another trend following indicator inspired by Tradingview Pinescript code. Code is designed to plot in PSAR style. Green color dots represent a bullish trend. and the red dots represent a bearish trend. Coral trend applied to Nifty EOD charts as shown in the above figure.

Looks like the system is quite popular in the MT4 platform among FX traders known as THV Coral. Whatever the code does is just the indication of the trend and not a complete system though. Do your homework if you would like to build some system on top of it.

Nifty Future 15min Charts
NF 15min

 

Amibroker AFL Code – Coral Trend Indicator

_SECTION_BEGIN("Coral Trend Indicator");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 


sm = Param("Smoothing Period",21,2,40,1);
cd = Param("Constant D",0.4,0.1,2,0.1);

SetBarsRequired(ceil(3.5 * sm)) ;   // minimum lookback required for stability //

di = (sm - 1.0) / 2.0 + 1.0;
c1 = 2 / (di + 1.0);
c2 = 1 - c1;
c3 = 3.0 * (cd * cd + cd * cd * cd);
c4 = -3.0 * (2.0 * cd * cd + cd + cd * cd * cd);
c5 = 3.0 * cd + 1.0 + cd * cd * cd + 3.0 * cd * cd;

src = Close;
i1=0;
i2=0;
i3=0;
i4=0;
i5=0;
i6=0;


for(i=1;iRef(bfr,-1),colorGreen,colorRed);

Plot(bfr,"Coral Trend Indicator", color,styleDots|styleNoLine|stylethick);


_SECTION_END();
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.

What is QuantZilla?

Quantzilla is 75+ hours of code mentoring program designed for noncoders who want to learn the coding program right from designing indicators, scanners, trading...
Rajandran R
58 sec read

Things to Consider While Building a Bracket Order Execution…

Building a Bracket Order Strategy is the most demanded request we got from most of the algomojo traders. This article explains the list of...
Rajandran R
12 min read

PlaceOrder – Multi Broker Exectuion Code Snippets for Amibroker

This tutorial explains how to build a button trading right from scratch and with a click of a button how you can send orders...
Rajandran R
7 min read

12 Replies to “Coral Trend Indicator – Amibroker AFL Code”

  1. Hi, I found in Ami 5.60.2 that when you zoom in to a chart the red and green dots are shifting. In such a case the indicator is not very reliable. Brgds, CArnot

  2. hello sir i am regular reader and follower of your AFL and POSTs lot of thanks
    sir my humble Request sir please prepaire to this AFL in to MULTI TIME FRAME ( Not MTF DashBoard ) means when we select 5 min chart but indicator play like 15 min s Data based , and 15 min chart like 60 min …………,
    sir i found like this supertrend in MQ4 but not in Amibroker so please ……………prepaire this AFL ( Coral Trend Indicator) in MTF i hope response possitively thankyou sir

  3. Yes It would be excellent if Coral can be coded for multi time frame.
    Which means the buy signal would be generated in 5 min chart when 15 min chart turns green and in reverse sell would be signalled in conjunction with 15 mind chart or 30 mins chart.
    Even if there is a way to notice coral trend higher time frame indicator in lower time frame it would be excellent.

  4. Not better use this function instead looping.

    function T3( Price, T3Periods, s )
    {
    e1 = AMA( Price, 2 / ( T3Periods + 1 ) );
    e2 = AMA( e1, 2 / ( T3Periods + 1 ) );
    e3 = AMA( e2, 2 / ( T3Periods + 1 ) );
    e4 = AMA( e3, 2 / ( T3Periods + 1 ) );
    e5 = AMA( e4, 2 / ( T3Periods + 1 ) );
    e6 = AMA( e5, 2 / ( T3Periods + 1 ) );
    C1 = -s ^ 3;
    C2 = 3 * s ^ 2 * ( 1 + s );
    C3 = -3 * s * ( s + 1 ) ^ 2;
    C4 = ( 1 + s ) ^ 3;
    T3Result = c1 * e6 + c2 * e5 + c3 * e4 + c4 * e3;
    return T3Result;
    }

Leave a Reply to Rajandran Cancel reply

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