I have a strategy running with FXCM as my broker. Last night the strategy went short on a few positions. Then an exit signal was given and my strategy exited the short positions and entered into a few long positions.
The issue was that one of the stop loss orders didn't cancel correctly on the original short positions when the underlying position was closed. An error message popped up and said the order wasn't a multiple of 1000. The order was actually a order of 1000 being 57000. You can't place an order with fxcm the order is of 1000. Because of this the strategy then bought all the positions that i had just closed again. i read on the forum here that if MarketPosition is not flat and you buy a position in the opposite direction to what you have it will then issue a closed position order and cancel out the other positions.
The problem here is my strategy had already closed out my position then ninjatrader bought all the positions again. So now I had twice as many long positions as i was after which resulted in a loss twice what it should have been. For next time I will add in a check not to add positions until the MarketPosition is Flat.
What I would like to know is if i have closed a position and then ninjatrader for some reason can't close out the stoploss order associated with that position. Is there any way that I can then force the cancellation of the stop order so my strategy can then be marketposition.flat. When i checked my account in fxcm the stop order had been cancelled. It was just showing as a state of 'Cancelling' when in Ninjatrader order tab.
Cheers,
Mark

Comment