the intention is to return the barid of the most recent donchianchannel high crossover or low crossover
{
int barid=CurrentBar-1;
int mru=0;
while(barid>1){
if (High[barid] > DonchianChannel(100).Upper[barid+1])
{
mru=barid;
break;
}
barid-=1;
}
return mru;
}
private int mostRecentLower()
{
int barid=CurrentBar-1;
int mrl=0;
while(barid>1){
if (Low[barid] < DonchianChannel(100).Lower[barid+1])
{
mrl=barid;
break;
}
barid-=1;
}
return mrl;
}
Comment