+91-0000000000

}

Monday – Friday : 9:00 AM – 6:30 PM

MACD HLC Trend Line

This AFL combines MACD analysis with HLC data to generate trend lines, aiding traders in visualizing trend direction. Amibroker AFL uses historical data from the feed to plot MACD trends against HLC, facilitating trend analysis and helping traders in making informed decisions.

/
_SECTION_BEGIN("macd HLCby3");

pivot = (H +L+C)/3; 
piv1 = EMA (pivot,Param("short ema",5,1,20,1));
piv2 = EMA (pivot,Param("med ema",12,1,20,1));
piv3 = EMA (pivot,Param("fast ema",34,1,50,1));

diff1 = piv2-piv3 ;
diff2 = piv1-piv2 ;
diff3 = piv1-piv3 ;

diff1_col = IIf (diff1 > Ref(diff1,-1),colorBlue,colorRed);
diff2_col = IIf (diff2 > Ref(diff2,-1),colorBlue,colorRed);
diff3_col = IIf (diff3 > Ref(diff3,-1),colorBlue,colorRed);


//Plot(diff1, "diff1", diff1_col, styleThick);
//Plot(diff2, "diff2", diff2_col, styleThick);
Plot (diff3, "diff3", diff3_col, styleThick);
Plot(0,"",colorGrey40);

Plot( BBandTop( diff3, 5, 0.5 ), "BBTop", colorYellow, styleDashed ); 
Plot( BBandBot( diff3, 5, 0.5 ), "BBBot", colorYellow, styleDashed ); 
_SECTION_END();

Open chat
1
Hi, how can I help you?