PureBytes Links
Trading Reference Links
|
I hate to spend too much time on this. If it is old hat to some of you do
not read on...
However,
In the example Dennis makes here EasyLanguage is behaving exactly as
expected and as designed. The problem is either in the expectations of the
reader or in a willingness to be argumentative.
As I have stated previously, the EasyLanguage code is executed PRIOR to
the close of the bar. So, if you place a MOC order it is not possible to
be long (unless you are pyramiding).
On the other hand, a MOC order (like the Market Order) is an absolute
order. There is no chance, barring the end of the world, NOT to be filled
on the next bar. Realizing this, how about something like :
if Condition1 and (@MarketPosition <> +01) then begin
Buy ("le.Main") on the close ;
lx.Price = Close - (@MinMove * 10 Points) ;
ExitLong ("lx.OEB") at lx.Price Stop ; { On Entry Bar }
end ; { not currently long }
if (@MarketPosition = +01) then begin
if (@BarsSinceEntry <= +01) then begin
{*
* I put this line in because almost EVERY system I work on has multiple
entries!
*}
lx.Price = @EntryPrice - (@MinMove * 10 Points) ;
end ;
ExitLong ("lx.AEB") at lx.Price Stop ; { After Entry Bar }
end ; { currently long }
Instead of arguing about how something DOES work, why not understand HOW
(and WHY) it works and taking advantage of it! I will help any way I can.
It is what I love to do more than anything else!
Samuel
At 09:12 PM 05/03/99 , you wrote:
>Samuel Tennis writes:
>> The times that I do NOT use @MarketPosition are for exits that are
specifically for the bar of entry and then I will usually be testing for
"(@MarketPosition <> +01)".
>> There is no problem, and never has been to my knowledge, with the
@MarketPosition function.
>
> Here's the gotcha (assume daily data):
>
>if whatever then buy on close; {filled Monday MOC}
>if marketposition = 1 then exitlong at (entryprice - 10) stop;
>
> The earliest your stop will be filled is on the open Wednesday. If the
market crashes on Tuesday (the bar AFTER entry), you are hosed.
>
> Better to use your own vars:
>
>if whatever then begin
> buy on close; {filled Monday MOC}
> ep = close;
> mp = 1;
>end;
>if mp = 1 then exitlong at (ep - 10) stop;
>
> That one will get you out on Tuesday if it crashes. Or, as Mike G. points
out, forget the mp var altogether. It's not needed. ALL the built-in
position functions suffer from this "feature." Code your own if you want to
be able to exit on the bar following an on-close entry.
>
>--
> Dennis
> "It's not a bug, it's a feature."
Because this question is rather intense, detailed and exacting, I have
left the previous message here in it's entirity... My apologies to any
purists (like me) who want to see it snipped, OK?
Samuel
|