Skip to content

Instantly share code, notes, and snippets.

@marketcalls
Created November 2, 2018 03:18
Show Gist options
  • Save marketcalls/ee564bc82fdd7cd5603f3133d4f25570 to your computer and use it in GitHub Desktop.
Save marketcalls/ee564bc82fdd7cd5603f3133d4f25570 to your computer and use it in GitHub Desktop.
Percent Rank Based ATR
// Coded by Rajandran R
// Coded Date : 14-09-2018
// Author - Maketcalls (www.marketcalls.in )
// Co-Founder - Traderscafe (www.traderscafe.in)
_SECTION_BEGIN("Percent Rank Based ATR");
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);
prbstatus = WriteIf(PRBATR > Ref(PRBATR,-1) OR PRBATR == 100,"Increasing","Decreasing");
Plot( PRBATR, "PRB-ATR", color, styleLine | styleThick );
_SECTION_END();
_SECTION_BEGIN("Exploration");
Filter = 1; //allow all
AddColumn(Close,"LTP",1.2);
AddColumn(PRBATR,"PRBATR",1.2,colorWhite,color);
AddtextColumn(prbstatus,"Status",1,colorWhite,color);
_SECTION_END();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment