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

EL Observations and Questions



PureBytes Links

Trading Reference Links

I was trying to duplicate the "breakeven" stop in EL with the following:

if maxpositionprofit>=200 then begin
exitlong at entryprice stop;
exitshort at entryprice stop;
end;

Naturally the results weren't the same as with the built-in breakeven stop.
The apparent reason is that the EL-coded stop doesn't apply until the bar
FOLLOWING the entry bar, whereas the built-in stop can get you out on the
same bar. Money management stops encounter the same situation. Isn't there
some way to get a programmed-in stop to do the same thing, that is to be
active on the same bar as the entry?

Along the same line, I ran into some funny stuff with the following:

if condition1 {an inside day or similar} then begin
buy 1 contract at h stop;
sell 1 contract at l stop;
end;

Occasionally there was a situation where both entry stops (both short and
long) would get hit on the same bar. The problem is, there's (apparently)
no way for EL to know which stop got hit first, and last. So coming out of
the bar you might wind up long in the simulation where in reality the sell
entry would have been the most recent and you would have wound up short.
The direction EL chooses in this case seems to be totally random.

If anyone knows how to resolve these little glitches I'd sure like to hear
about it. And perhaps I can return the favor sometime. Thanks!