Exit rule based on entry rules

An exit rule based on the decision of entry rules.

I tested the following scenario: a reasonably successful strategy opens a position. Then I clone it. The original goes into some profit, but later the market seems reverting and the clone opens a position in an opposite direction. I think this would be a good signal to exit the current in-profit position even if it had not hit the TP.

So, the exit rule will have following semantics: even if the strat already has an open position, it considers evaluating potential market entry and if it sees another potential “would have opened position” it provides some signal for an exit rule. It should have some additional settings, because I had several use-cases in mind:

  • if the current position is in profit, but the strat would have opened a position in a different direction, exit
  • if the current position is at loss and the strat would have opened a position in a different direction > N times, take loss and exit
  • maybe others