I've put up a strategy that uses
Uses an indicator to generate entry and exit signals.
Entry signal long is at the same time the exit signal for short and vice versa
I also put in a trailing stop to make sure that, if the exit signal fails, there is a solid exit.
Now, if I run a backtest everything seems fine, but when I run it agains realtime data something seems wrong. As soon as I start the strategie it says that it has an open position and keeps counting p/l even there is no open position... also the trailing stops stay initialized when a position is closed.
What do I have to do to get this correct?
Is there a need to cancel the trailing stop when the exit signal is generated and filled? If so, how is this done?
Thanks for your help,
Dennis

Comment