I have a pretty good idea on how to do this using,
Position.MarketPosition == MarketPosition.Flat
and
Position.MarketPosition == MarketPosition.Long or Short
with my current entry signals copied for just an exit, but I really don't want to do as I always prefer to keep my script as clean as possible (my entry parameters are very long and if I have to use them for my exit too..). Before I dive into the latter, is there a simple way to tell EnterShort or EnterLong or their equivalents to only close the opposite and not enter? Again I would prefer not to have to have if(Position.MarketPosition == MarketPosition.Long) then Exit and then have the if(Position.MarketPosition == MarketPosition.Flat) then Enter. If it can be done with less script I would like that. Also very curious if it there is another way in managed. Thanks in advance and always am very appreciative of any advice.

Comment