Range plotting and stop repainting

Dear All,

I am trying to plot range when :

  1. If its upside then range should be when first lowest high is created.
  2. If its downside then range should be when first highest low is created.

Below is my code :

newday = Day() != Ref(Day(),-1);  //check if new day or not
FCL=ValueWhen(newday,L); // Day first candle low
FCH=ValueWhen(newday,H); // Day first candle high

hh = HighestSince(newday,H);
ll = LowestSince(newday,L);

ORBCandle = (H < hh AND L > ll);// OR (H > hh AND L < ll );

ORBCandle = Sum(ORBCandle, BarsSince(newday)+1)==1;

ORBHIGH = ValueWhen(ORBCandle,hh);
ORBLOW = ValueWhen(ORBCandle,ll);

Plot(ORBHIGH,"ORBHigh",colorGreen,styleDashed);
Plot(ORBLOW,"ORBLow",colorRed,styleDashed);

Problem here is that, its plotting correctly in some cases but not working in some cases where its ignoring highest or lowest since values.

Wrong plotting

Request your help to solve this issue.

Thanks in advance.

Regards,
Mahesh

Hi Mahesh,

Could you give me any Authentic Source to get Intraday data into Amibroker as it seems you are using Intraday data.

Thanks & Regards,
Suresh

Hi Suresh,

There are lot of providers with cheap rates but I would recommend you to go for authorized data vendors like global data feed or true data or someone equivalent to them.

But don't go others as you will find a lot of issues in high low close open values which will make lot of issues for you.

And dont forget to take trial before going ahead.

Thanks.
Mahesh

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.