Now I have the need to enter using Limit order so that I can enter on a pullback after I have the entry signal (this is coming in the primary data series) . I am still using the same technique as before, the granularity one. Now that I am working with Limit orders, I would expect the fill price to be the same as the price in Limit order. I am assuming that because my limit order was entered using a granular technique, that the fill for such an order would be evaluating the granular data series, and generating a fill order with that limit order price.
After many hours (going into days) of testing, I notice that the fill price for the limit orders is somewhat random. Sometimes I get the Limit price and sometimes I get one tick above the limit price (for long orders).
Questions:
- Based on the strategy that I am sharing (simplified strategy to see if I can understand the fill engine logic) and the fact that I am using the granular entry technique when creating the Limit order, what else should I be doing in order for the fill to be using the granular data series (I have 1 tick ASK, BID and LAST) on the Limit order?
- Should I be using the GetCurrentBid or GetCurrentAsk instead of my granular data series?
- Do you have an explanation for this behavior?
Other things that I have tried:
- In the strategy that I am sharing, I have tried playing around with the barsInProgressIndex parameter for the EnterLongLimit overload method. At the same time I have use Closes[1][0], Closes[2][0] and Closes[3][0] when calculating the limitPrice. This gives me even more random fill prices.
When it comes to the stop order and the profit target (for simplification purposes I am using the SetProfitTarget() {this order should be a ExitLongLimit order} and the SetStopLos() orders, but eventually I will create those in the OnExecutionUpdate method), the fill price is the one that one would expect. Something is going on with Limit orders and their filled price
Comment