Documentation
under “Understanding order fill resolution” says “The secondary bar series will mimic the 'price based on' setting in your Strategy Analyzer settings”.
This means that MarketDataType should be the same on (automatically added) secondary as the primary.
But in the current implementation the MarketDataType of the added series is always Last (it does not ‘mimic’ from the primary).
Steps to reproduce the problem:
Run attached strategy sTestFillEngine1 with MarketDataType=Ask, Historical Fill Processing: Resolution=High
Here is example output using daily USDJPY (resolution type=minute, value=1).
DataLoaded: BarsArray.Count=2, Dataseries:
BarsInProgress index=0. Instrument=USDJPY, MarketDataType=Ask, BarsPeriodType=Day, Value=1, Timeframe: From=12/10/2016 00:00:00, To=19/10/2016 00:00:00, TradingHours=IBForex, BreakAtEOD=False, Count=6
BarsInProgress index=1. Instrument=USDJPY, MarketDataType=Last, BarsPeriodType=Minute, Value=1, Timeframe: From=12/10/2016 00:00:00, To=19/10/2016 00:00:00, TradingHours=IBForex, BreakAtEOD=False, Count=8438
Setup: A*****t=B******t, Calculate=OnBarClose, MaximumBarsLookBack=TwoHundredFiftySix, BarsRequiredToTrade=0, StartBehavior=WaitUntilFlat (IsAdoptAccountPositionAware=False)
Historical Fill Processing: Resolution=High, Type=Minute, Value=1, IsFillLimitOnTouch=False, Slippage=0
Order Handling: (managed) EntriesPerDirection=1, EntryHandling=AllEntries, IsExitOnSessionCloseStrategy=False, StopTargetHandling=PerEntryExecution
Order Properties: SetOrderQuantity=DefaultQuantity, TimeInForce=Gtc (TraceOrders=True)
Historical
OnBarUpdate BarsInProgress=0, CurrentBar=0, Time=12/10/2016 22:00:00 (close of CurrentBar), bar-being-built will close at: 13/10/2016 00:00:00
12/10/2016 22:00:00 Strategy 'sTestFillEngine1/-1': Entered internal SubmitOrderManaged() method at 12/10/2016 22:00:00: BarsInProgress=0 Action=Buy OrderType=Market Quantity=100,000 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
OnOrderUpdate Name=Buy, OrderState=Submitted
OnOrderUpdate Name=Buy, OrderState=Accepted
OnOrderUpdate Name=Buy, OrderState=Working
OnOrderUpdate Name=Buy, Qty=100000, filled=100000, avgFillPrice=104.165
*** Warning: We expected FillEngine to fill Buy at openNew=104.215 but got 104.165 instead
...
You can see that the final warning message shows that the Fill Engine has filled the market Buy at the lower Bid price. This would obviouly never happen Realtime and since user specified a Ask series this is not expected.
Comment