PureBytes Links
Trading Reference Links
|
Subject: Exiting M.O.C. intra-day charts
I would like to exit on the close of the day session. I'm using 1 min
intra-day data. How do I check to see if I'm on the last bar of the day's
session? My code is below, but it doesn't work correctly.
If MP = 1 and Time = Sess1EndTime then begin
If Condition1 then ExitLong all contracts at market;
end;
Thanks for the help.
Randy
ANSWER:
In your exit signal, you have indicated "at market". It means for
TradeStation the opening of the next bar. But after the last bar of the
session there is no next bar, that may be the cause of your problem.
If you would like to exit on close, write simply "close" or "C". Then your
system will exit on the close of the same bar, in your case on the last bar
of the session. It is OK for historical testing purposes. In real-time, if
you would like to get the signal couple of minutes before the market close,
you may alter the code accordingly.
Zoltan
|