PureBytes Links
Trading Reference Links
|
The best way to handle this is to issue the exit on the bar before entry,
even if you don't know the entry price. If you are using intraday data and
your trade is in the middle of the day, you can use the close of the bar
prior to entry to compute the exit. It will not be that far off most of the
time and the exit is only valid for one bar. After that you can rely on the
entryprice command to compute the exit price.
The worst case is where you enter at the open of the day and you need to
base the exit on the close of the prior session. This could generate bogus
historic test results. However, for testing purposes you can use a NextOpen
DLL that solves the problem most of the time without burdening the system
with the baggage of the dreaded Open Tomorrow command. For real time
trading you can handle the trade at the open manually with your broker on
the first bar of the day. Thereafter, you can use code to deal with the
problem.
At 06:50 AM 1/20/99 -0700, you wrote:
>"William Vedder, Jr" <bved01@xxxxxxx> wrote:
>> This is the crux of the biscuit:
>
>It's the apostrophe! (Apologies to non-Zappa fans :-)
>
>> How do I write an exit statement in EL that will take effect on
>> the same bar as the entry statement? or maybe the question should
>> be CAN I...?
>
>I think the only way you could do it is to issue the exit stop on the
>bar BEFORE you enter. I'm not at all sure that's possible.
>
>In any case, you *shouldn't* do it. You don't know what order the
>prices were hit in that bar. The stop price might have been hit
>before your entry, or after it. (Unless you're entering on the open,
>of course.) If you enter by a stop, and then exit by a stop on the
>same bar, you don't know if the entry price or the exit price was hit
>first. Any results you got from such a system would be utterly
>unpredictable and useless for real trading.
>
>Gary
>
>
William Brower
Publisher of TS Express
Email: 1000mileman@xxxxxxxxxxxxxx
Web: http://www.insideedgesystems.com
|