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

Re: Exit



PureBytes Links

Trading Reference Links

At 9:17 AM +0100 11/15/00, KD wrote:
>
>maxprice=highest(high,barssinceentry);
>
>If (MarketPosition = +1) then begin
>  If maxprice > EntryPrice(0) + 100 then
>  ExitLong at EntryPrice(0) + 100  stop  ;
>  end ;
>
>But I can't use stop orders for today's bar. They work only for tomorrow.
>For example: yesterday my entry price was 1000. Today the highest price
>was 1130 and close 1090. I would like to exit long at 1100, but with
>this code I can't do that. I can exit my position only tomorrow,
>but tomorrow's open could be ie. 1050.
>How can I change my code?

Gary Fritz explained a way to do something like this recently . Perhaps you can adapt this idea.

Bob Fulks

---------

If MarketPosition <> 1 Then
  ExitLong ("EBP") Next Bar at Close - RiskPnts Points Stop;
 
Buy/sell/exit orders take effect on the NEXT bar.  So this has the
result of setting long exit stops on all bars when you aren't long
(which is obviously useless) AND setting it on the FIRST bar of a
long position.

E.g. if you enter an entry stop order on bar N, and that entry price
is hit on bar N, the above exitlong will be in effect on the first
bar of the position.  It will NOT be in effect on any subsequent bars
of the position, because MarketPosition will then be 1.