Avoid Sunday evening...

 

Hi, the attached indicator works fine for brokers that do not include Sunday evening bars.

If I apply the indicator on a platform that include the Sunday session, then I need to make refer to the previous Friday bars.

I tried with this condition considering (i+2) instead (i+1) when it is Monday, but it doesn't work


if (DayOfWeek()==1)
{
if (High[i+2]>LastHigh) LastHigh=High[i+2];
if (Low[i+2]<LastLow) LastLow=Low[i+2];

......


Could you help me? Thank you!

Files: