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

Re: Problem Exiting at End of Session??


  • To: omega-list@xxxxxxxxxx
  • Subject: Re: Problem Exiting at End of Session??
  • From: gary@xxxxxxxxxxxx (Gary Funck)
  • Date: Thu, 5 Mar 1998 09:40:27 -0800 (PST)
  • In-reply-to: <he96@xxxxxx-club.de>

PureBytes Links

Trading Reference Links

On Mar 5,  6:05pm, hans esser wrote:
> > 
> > Will T/S adjust Sess1EndTime to an earlier time for days where
> > they stop trading earlier than usual, such as half days typical near
> > major holidays, 
> 
> Not that I know

Same here.  My reason for pointing this out, is that I've seen
a lot of TS code that keys off Sess1EndTime, and it is just not
"air tight".  Here's an example:


if t >= ktime and (T[1] < ktime or T[1] = SESS1ENDTIME) then begin
    se = C - Break;
    le = C + Break;
end;

if T[1] < SESS1ENDTIME then begin
    if se > 0 then sell("KT Sell") se stop;
    if le < 99999 then buy("KT Buy") le stop;
end;

This is all a bit esoteric, but might be important if you're trying
to use the above code to backtest, or if you are using it in realtime.
I'd rewrite the above as follows:

if (D = D[1] and (t >= ktime and t[1] < ktime) or (D <> D[1]) then begin
    se = C - Break;
    le = C + Break;
end;

if D = D[1] then begin
    if se > 0 then sell("KT Sell") se stop;
    if le < 99999 then buy("KT Buy") le stop;
end;

The logic above could be simplified -- I just wanted to
show that using SESS1ENDTIME isn't really very reliable, and there
are other coding alternatives.

Note; the example above looks back one bar, and won't fix the
original problem, which is to close all trades at the end of
the session, when trading in a realtime environment.

I think Tradestation needs a _manual_ command to tell the program to close
out all trades on a given chart when the chart is being run off a realtime
data stream.  Unless the data stream is "fixed" to provide a "close
of session" or "trading halted" signal, I don't see how the program
is going to be able to respond to situations where trading halts ahead
of the normal SESS1ENDTIME.


-- 
--
| Gary Funck,  Intrepid Technology, gary@xxxxxxxxxxxx, (650) 964-8135