Skip to content

Instantly share code, notes, and snippets.

@marketcalls
Created November 2, 2018 03:20
Show Gist options
  • Save marketcalls/cae0915971521a8e2391d65444a26827 to your computer and use it in GitHub Desktop.
Save marketcalls/cae0915971521a8e2391d65444a26827 to your computer and use it in GitHub Desktop.
PRB-ATR candles
// Coded by Rajandran R
// Coded Date : 14-09-2018
// Author - Maketcalls (www.marketcalls.in )
// Co-Founder - Traderscafe (www.traderscafe.in)
_SECTION_BEGIN("PRBATR colored Candles");
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 ) ) ));
periods = Param( "Periods", 20, 1, 200, 1 );
PRBATR=PercentRank(LinearReg(ATR(periods),periods),periods);
color = IIf(PRBATR > Ref(PRBATR,-1) OR PRBATR == 100,colorBlue,colorRed);
Plot( C, "Close", color, styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment