rogerha wrote: Sun Mar 24, 2019 9:49 pm
Just noticed after re reading the entire thread that the answer to my question is in the thread, ADR is based on yesterday range. Apologies for asking a stupid question
//+---ADR------------------------------------------------------------------------------------------------------------+
ADR1=0; ADR5=0; ADR10=0; ADR20=0; ADRavg=0; int a,b,c; int ypos=0;
ADR1=(iHigh(NULL,PERIOD_D1,1)-iLow(NULL,PERIOD_D1,1));
for(a=1;a<= 5;a++) ADR5= ADR5+(iHigh(NULL,PERIOD_D1,a)-iLow(NULL,PERIOD_D1,a));
for(b=1;b<=10;b++) ADR10=ADR10+(iHigh(NULL,PERIOD_D1,b)-iLow(NULL,PERIOD_D1,b));
for(c=1;c<=20;c++) ADR20=ADR20+(iHigh(NULL,PERIOD_D1,c)-iLow(NULL,PERIOD_D1,c));
ADR5=ADR5/5; ADR10=ADR10/10; ADR20=ADR20/20; ADRavg=(((ADR1+ADR5+ADR10+ADR20)/4))/Point/pipsize;
double avYest=(iHigh(NULL,PERIOD_D1,1)-iLow(NULL,PERIOD_D1,1))/Point/pipsize; color colorDAV=LimeGreen;
if(ADRavg>avYest){colorDAV=DarkOrange;} iPanel(ID+"Xard15",52,280,"ADR",10,"Arial Bold",clrSnow);
iPanel(ID+"Xard16",14,280,DoubleToStr(ADRavg,0),11,"Arial Bold",colorDAV);
ADR is not yesterday range.... ADR =
ADRavg=(((ADR1+ADR5+ADR10+ADR20)/4))/Point/pipsize;
All the best
Xard777