Amibroker AFL code for Triangular Moving Average

MarketSecrets - Learn To Trade Like a Pro

Amibroker AFL code for Triangular Moving Average:

Please find below the AFL code.

Script:

_SECTION_BEGIN(“Triangular Moving Average”);

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( Close, “Price”, colorWhite, styleCandle );
Periods = Param(“Periods”,20,5,50,5);
SMA = MA(Close,Periods);
TRIMAPeriods = round(Periods/2);
TRIMA = MA(SMA,TRIMAPeriods);
Plot( SMA , “SMA”, colorWhite, styleLine | styleOwnScale );
Plot ( TRIMA ,”TRIMA”, colorBlue, styleLine | styleOwnScale );

_SECTION_END();

Triangular Moving Average

error: Content is protected !!