Rajandran R FollowTelecom 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)

Coral Trend Indicator – Amibroker AFL Code

1 min read

Nifty Future EOD charts

[wp_ad_camp_5]

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

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;i<BarCount;i++)
{
i1[i] = c1[i]*src[i] + c2[i]*i1[i-1];
i2[i] = c1[i]*i1[i] + c2[i]*i2[i-1];
i3[i] = c1[i]*i2[i] + c2[i]*i3[i-1];
i4[i] = c1[i]*i3[i] + c2[i]*i4[i-1];
i5[i] = c1[i]*i4[i] + c2[i]*i5[i-1];
i6[i] = c1[i]*i5[i] + c2[i]*i6[i-1];
}
bfr = -cd*cd*cd*i6 + c3*(i5) + c4*(i4) + c5*(i3);
color = IIf(bfr>Ref(bfr,-1),colorGreen,colorRed);
Plot(bfr,"Coral Trend Indicator", color,styleDots|styleNoLine|stylethick);
_SECTION_END();

Related

Rajandran R FollowTelecom 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)

This tutorial provides an overview of the P-Signal reversal strategy, a quantitative trading strategy that utilizes statistical parameters and error functions to generate probabilistic...

Reversal Finder is designed to identify potential reversal signals in a stock's price action. It highlights specific bars that meet the criteria for a...

Thought of converting some of the top-rated pinescript codes to Amibroker AFL code. So started with CM Williams VIX FIX with 51,000+ ratings for...

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

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

Hi Download the updated Code for Coral which resolves the Repainting while Zoom in or Zoom out

Hi,

The download link gives the same code with repainting problem. Please update the link. Enjoy, CArnot.

Take the code from the Github Code. Download link is not yet updated.

Now the download link too updated with the new file.

Hi,
Thanks for the efforts.
Enjoy,
CArnot

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

Sir below link is SUPERTREND MTF MT4

As said in previous post if possible please modify COREL TREND. IN TO MULTI TIME FRAME.
Thank you sir

Could not apply in amibroker,It is showing 134 error

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.

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

Hi Download the updated Code for Coral which resolves the Repainting while Zoom in or Zoom out

Hi,

The download link gives the same code with repainting problem. Please update the link. Enjoy, CArnot.

Take the code from the Github Code. Download link is not yet updated.

Now the download link too updated with the new file.

Hi,

Thanks for the efforts.

Enjoy,

CArnot

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

Sir below link is SUPERTREND MTF MT4

As said in previous post if possible please modify COREL TREND. IN TO MULTI TIME FRAME.

Thank you sir

http://www.wisestocktrader.com/indicatorpasties/1566-supertrend-multi-time-frame-for-mt4&lc=en-IN&s=1&m=269&ts=1451714952&sig=ALL1Aj5CX0PgTHW3_URFhSivSQtsJNkhaA

Could not apply in amibroker,It is showing 134 error

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.

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;

}

How can I download the nifty future 15 mint charts