I am having an issue with my strategy placing two many orders when reversing from long to a short or vice versa. The strategy is a ma crossover so if 10 crosses above 30 enter long if 10 crosses below 30 enter short.
This only happens when trading on live account on playback connection all works fine. I have attached a picture of the execution of one such instance. So strategy triggers to enter long now moving average crosses below so I want to close the long and enter a short. But on live data I am ending up with two shorts. In executions I am seeing a close position a sell from my strategy labelled short911 and then another short which leaves me with 2 shorts when I should only have 1. I have to manually place a buy to get back to one short position.
I do have a exitlong and exit short clause with the strategy but they have a time frame attached to only be active when my entry timeframe has passed to close out the last trade of my session.
Again on market playback data it all works perfect. But running the live strategy it does not.
Any help would be appreciated.
Comment