Skip to content

Instantly share code, notes, and snippets.

@marketcalls
Created February 23, 2017 06:53
Show Gist options
  • Save marketcalls/4ec7806b537befdb8acd4d86a1dbada1 to your computer and use it in GitHub Desktop.
Save marketcalls/4ec7806b537befdb8acd4d86a1dbada1 to your computer and use it in GitHub Desktop.
Range Identifier - Amibroker AFL
//Coded by Rajandran R
//Author - Marketcalls
//www.marketcalls.in
_SECTION_BEGIN("Range Identifier");
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 ) ) ));
range = Param("Price Range",500,10,1000,1);
diff1 = abs(H-Ref(C,-1)); //Range from Yesterday Close
diff2 = abs(H-L); // High - Low Range
color = IIf( diff1>=range OR diff2 >= range,colorYellow,colorDefault);
Plot( C, "Close", color, styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
Filter = 1;
AddColumn(C,"Close",1.2);
AddColumn(diff1,"Change",1.2);
AddColumn(diff2,"Intraday Range",1.2);
_SECTION_END();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment