[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Yesterday's high & low on intraday data



PureBytes Links

Trading Reference Links

Resurrected part of your original post from the trash folder.  (Sorry,
thought you had it solved.......)

Owen Davies wrote:

   [snip]

> I especially want to figure
> out yesterday's range.

--------------------

This should give you the High-Low range on RTH charts.

MktStart:=Hour()<Ref(Hour(),-1);
yestHiVal:=ValueWhen(1,MktStart,
           Ref(HighestSince(1,MktStart,H),-1));
yestLoVal:=ValueWhen(1,MktStart,
           Ref(LowestSince(1,MktStart,L),-1));
yestHiVal-yestLoVal

----------------

True range on RTH charts:

MktStart:=Hour()<Ref(Hour(),-1);
opn:=ValueWhen(1,MktStart,O);
yestLoVal:=ValueWhen(1,MktStart,
           Ref(LowestSince(1,MktStart,L),-1));
yestHiVal:=ValueWhen(1,MktStart,
           Ref(HighestSince(1,MktStart,H),-1));
If(opn>yestHiVal,opn-yestLoVal,
If(opn<=yestHiVal AND opn>yestLoVal,yestHiVal-yestLoVal,
If(opn<yestLoVal,yestHiVal-opn,
If(opn>=yestLoVal AND opn<yestHiVal,yestHiVal-yestLoVal,0))))

------------------

And, FWIW, the following plots the prior day's H, L, and C on today's
intraday data.   I use it on the RTH session occasionally, but not on 24
hour composite charts, which would require defining each session's
start/end times with the hour() and minute() functions for accurate
results.

  {PriHiLoClo}
MktStart:=Hour()<Ref(Hour(),-1);
yestClo:= Ref(C,-1);
yestHi:= Ref(HighestSince(1,MktStart,H),-1);
yestLo:= Ref(LowestSince(1,MktStart,L),-1);
ValueWhen(1,MktStart,yestClo);
ValueWhen(1,MktStart,yestLo);
ValueWhen(1,MktStart,yestHi);

Regards,
iamken