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

Re: EL Question - Referencing 52-week High on Intra-Day Chart



PureBytes Links

Trading Reference Links

OM wrote:
> You set the inputs to whatever the appropriate values would have
> been at the start of the chart 33 weeks ago (13000 5-min bars =~
> 33 weeks).  Then the 52-week high and low can easily and
> automatically be adjusted for any changes that take place during
> the time covered by the chart: 

Ah.  I assumed you meant to manually input the CURRENT 52wk H & L on 
a weekly basis.  That's the only way you could do it with only two 
inputs -- but it wouldn't work for backtesting.

You could do what you suggest, but you couldn't just give it one H 
and one L.  To properly update the 52wk H/L forward from the 33-wks-
ago starting point of the system, you'd have to "prime" the system 
with the H & L for *each* of the previous 52 weeks and let it move 
forward from there.  Otherwise you wouldn't know if the 52wk high 
happened last week or 51 weeks ago, and therefore if it should drop 
out in the 2nd week of your 33wk strategy test.

(And given TS's limitations, I'm not sure how you'd feed the system 
104 inputs, short of putting it right in the system code.)

> If DatetoJulian(Date) - DatetoJulian(Date[1]) > 1 and AHHold > AH 
>   then AH = AHHold;
> If DatetoJulian(Date) - DatetoJulian(Date[1]) > 1 and ALHold < AL 
>   then AL = ALHold;
> {Above two statements adjust 52-week H & L (AH and AL) each week.  

Close, but not quite.  They adjust it any time Date skips more than 
one day between bars.  That would happen over a weekend, but it would 
also happen for any midweek trading holidays.  I think testing for 
DayOfWeek(Date) < DayOfWeek(Date[1]) is a safer test.  The market 
would have to be closed for more than 5 consecutive weekdays before 
that test would fail.

Gary