I'm having a problem with what appears to be my strategy automatically syncing to a position that doesn't exist when I turn it on.
I have attached screenshots of before turning the strategy on, after turning it on and when I turn it off.
What is happening is when I turn it on it appears to be syncing to a position that doesn't exist. It shows in the strategy tab that a position is taken and shows P$L. It submits a live stop. No position actually exists.
When I turn the strategy off it is supposed to close the position so what happens is it submits an order to close but since there is no position it actually enters live position.
If I leave it on I can cancel the stop and when it hits a trade trigger in the opposite direction it will submit an order to close giving me 1 position and then submit the proper order and stop for the for the position It is supposed to and I then have 2 positions. I can close 1 position manually and everything functions normally from then.
If the price moves in the same way as the position and hits a trade trigger nothing happens.
The sync option was hard coded to be true and was suspected of being the problem so it was modified so it wasn't hard coded and I have tried choosing sync false but still have a problem.
Any help you could give would be greatly appreciated.
Regards
Brian
Comment