PDA

View Full Version : Reversing a strategy


pmorissette
05-04-2010, 01:41 PM
Hey,

I was trying to create an automated strategy and I ended creating an absolutely awful strategy -- now obviously, I want to reverse the signal and profit from it. Problem is the strategy has a trailing stop (this is what seems to be making it perform so poorly).

How would one go about "reversing" a stop loss. For example, if I currently have a short position with a 5 tick stop loss, but I want to end up with a long position and that same "trailing stop" signal, how can I program this? Since I no longer have a short position, the trailing stop won't work the same way...

Any ideas? I've tried a bunch of different things but nothing that generates the same trades.

Hope this helps others with extremely bad strategies...

NinjaTrader_Austin
05-04-2010, 02:02 PM
pmorissette, depending on how you have the stop loss and trail stop coded up, it could potentially be completely automatic. If you just do SetTrailStop(...) and/or SetStopLoss(...), then you wouldn't need to change anything. If you have a custom stop/trail strategy, then the code would get more complex.

If you don't mind, could you please post the code you're using here so we can see if anything else looks out of place?

Keep in mind that if you're using trailing stops, simply reversing the trades would not result in a reversed profit as well. Trailing stops are a path dependent function, so a trail stop from a long would be much different than a trail stop started at the same point as the long for a short.