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

Re: EasyLanguage translation



PureBytes Links

Trading Reference Links

Among other useful information, Dave Nadeau suggested:

> The other situation is for Intraday data.  If you are using intraday
> bars, the determination of the high of the previous day will require a
> couple more lines.  Everything will be the same as above, except replace
> the A:=..... line with the following:
>
> NewDay:=DayOfMonth()<>Ref(DayOfMonth(),-1); {this finds the breakpoints
> in your intraday data from one day to the next without having to worry
> about the length of afterhours trading}
> HHY:=HighestSince(2,NewDay,H); {this looks at two "newday" occurances
> backwards, today and yesterday, and finds the highest value since then}
> PDH:=ValueWhen(1,NewDay,HHY); {finally this selects the HHY value just
> before today's "newday" occurance}

Actually, that doesn't quite accomplish what's needed, does it?  HHY winds
up
as the highest high since yesterday's open, not the highest high between
yesterday's open and yesterday's close.  If this morning puts in a price
above
yesterday's high, that is what we'll see in HYY.

I've been staring at this problem off and on for weeks -- posted a request
for help with it, in fact -- and haven't come up with an answer.  As far as
I can
see, there just isn't any way to say "value since TimeX and before TimeY"
within the limitations of Metastock's language.  The closest I can come is
something like "If(NewDay,HYY,Prev)", but that's as ugly as it is slow to
calculate, and there seem to be cases where it breaks down (though at
the moment I can't quite remember what they were.)

If anyone has a better solution to this, I'd be deeply grateful to hear it.

Thanks.

Owen Davies