So I look at my back test, I short an instrument, and on every OnMarketData() update I test to see if I'm shorting. If I am, I get the latest Bid and call:
if (Position.GetProfitLoss(GetCurrentAsk(), PerformanceUnit.Currency) >= desiredProfit)
If the current unrealized gains are equal or greater to the profit target, I close the shorted position at market. I do the same in reverse for the long positions but using GetCurrentBid().
However when I do my market data replay with data I recorded from last night, I see that the intstrument that was shorted lost a lot of value, but the position was never closed? The low for that bar was much lower than my profit target, so why didn't the market data event get fired? This event does fire for market data playback recordings right?
Comment