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

Exit



PureBytes Links

Trading Reference Links

Hello,


I have a little problem with my exit rule.
I use buy and sell rules in my system and they work fine,
but I would like to add exitlong (exitshort) module.
I'd like to exitlong once my profit since entry is > 100
and price crosses below this level (entry price + 100).
(If it will be a false signal, my buy rule will open a new position).
I 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?

Thanks and best regards,
Krzysztof