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

Re: EasyLanguage Question - capturing phantom fill price (trade n + 1)



PureBytes Links

Trading Reference Links

Hi David,

> <<<
> Thanks.  As long as I assume I am filled at an O-H-L-C price the method
> works (in your suggestion "EntryP = C").
> >>>
>
> It was only my suggestion because the example you gave was an
> "at market" order. I displayed the solution to your question as per
> example.
>
> <<<

Yes indeed!  Many thanks, David.  Sorry for my maybe too-short (hopefully not
curt!) follow-up.

>
>  Now suppose it's a Buy Stop
> order --e.g.
>
>   Thus the previous code for entry is now used to set the flag
> instead of triggering an entry.
>
> previous method...
>
> If {Buy Setup Conditions} and SigVal<>1 then begin
>     if  PF >= 2.0 then Buy("MyBuy") at Market;
>     SigVal=1;EntryP=C;ESigName="MyBuy";
> end;
>
> becomes...
>
> {new vars}
> vars:SetMyB(0),SetMyS(0);
>
> If {Buy Setup Conditions} and SigVal<>1 then begin
>     if  PF >= 2.0 then SetMyB=UpperMA + 1/16;
> end;
>
> If H>SetMyB and SigVal<>1 then begin
>     if  PF >= 2.0 then Buy("MyBuy") at Market;
>     SigVal=1;EntryP=C;ESigName="MyBuy";
> end;
>
> SetMyB=0;{...This would go inside the entry nest above if you
> wanted to erase the flag only after the stop was hit. It is placed
> here assuming that the situation calls for cancelling the stop if it
> is not hit on the bar after the stop order was placed.}
>
> dbs
> >>>

Thanks again.  I think this would work.  There is still a potential problem in
the accuracy of capturing the fill price though, isn't there?  (I may be
especially tuned into this, since I trade stocks, intraday.)  In particular:
If I specify a Stop-Limit Order, I can be sure I'm going to get my stop price
(actually my limit price)--*if* I get filled.  Many times trading stocks
during the day, though, break-out gaps will occur

117 7/8     500 shares
118           400 shares  (<--stops "at the figure" get triggered on this
print...
118 1/2     1700 shares   <--and filled on this one.)
118 3/8      400 shares

Maybe I'm being too picky.  I just wish there were a way to capture--as
TradeStation's "BUY" function does seem to capture when trading in real-time--
the price of the *next print*, since that would be the price I'd get were my
system trading in real-time and not "phantom".

Thanks!
Ian