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

Re: El question



PureBytes Links

Trading Reference Links

At 7:26 AM -0700 6/27/98, Dennis Holverstott wrote:

>>
>> Input: BTime(0940), STime(1530);
>> if Time = BTime then Buy next bar at market;
>> if Time = STime then Sell next bar at market;
>
>The TS optimization functions don't work every well using time as an
>input because there are 60 minutes in an hour. Instead of testing 0950,
>0955, 1000, 1005, it will test 0950, 0955, 0960, 0965... invalid times.
>
>Try the calctime function:
>
>Input: add_mins(10);
>Var: BTime(0);
>BTime = calctime(sess1starttime,add_mins);
>
>For the SP, with the default input, BTime = 0930 + 10 = 0940. Then
>optimize for add_mins.

Cute. I missed this.

There is still the potential problem of Time not exactly being equal to
BTime (if the time bars are not set to start on 5 min intervals). Hans' "if
Time CROSSES ABOVE  BTime" idea would fix this.