I have a self coded strategy and I am experiencing several problems while executing in real time.
* My positions exit twice. For a short position, when I call exit, there is a close position fill and a buy to cover fill. I end up with one long position in the end. Same scenario happens with long orders.
I am using EnterLong(), EnterShort and ExitShort(), ExitLong(). To give an example, consider this actual event. I am short 1 GBPUSD. It exits twice and then my strategy goes long at the same time. So instead of 1 long, now I am 2 long. Real fun begins now. Strategy exits long positions and I am 2 short, just because it closed twice, and then my strategy goes short. I am 3 short. So the strategy that started with 1 position max in each direction has me with 3 short positions somehow!! thankfully I am still testing on sim account.
* I start strategy from strategy tab. When I stop a strategy by clicking stop button, it cancels stop and limit orders but any open positions are not closed.
Then I close the positions manually. Next time I start strategy, the previous open position shows up. e.g. if I am long GBPUSD, I stop strategy, it cancels stop and limit orders. Long GBPUSD is left untouched. I close manually. Next time I start strategy on same instrument, it shows 1 long GBPUSD. There is no actual open position and it's not there in positions tab. There is no way to close this position and there are no stop/limit orders for this ghost position.
I have "cancel strategy orders on strategy termination" checked in the options menu.
* Sometimes when I start a strategy, I get "DB ....object not being tracked" error. the strategy starts anyway.
I am using version 6.0 and Gain capital data feed for forex.
I hope these issues are resolved quickly so I can atleast begin testing my strategies correctly real time and feel confident enough to go live.
Thanks,
K
Comment