When I did market replay I got different entry points. Strategy is doing market order.
On market replay, I tried both ways to get the data
1. Connection set to Topstep and then downloading the market replay data for mnq jun 25 for 2025-03-19
2. Connection set to Playback and downloading market replay data
Both sets of data yielded same result when doing market replay.
The strategy logic put a market order short at 19799.5
It filled me at 19795.5
The live sim filled me at 19798.75 vs market replay at 19795.5 (strategy fired market short at 19799.5)
Here's some output I got for the marketreplay
#2025-03-19 10.54 MNQ marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19800 volume=1 time='2025-03-19 10:54:04 AM' bid=19800 ask=19800.25 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.75 volume=2 time='2025-03-19 10:54:04 AM' bid=19799.75 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.75 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.75 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.75 volume=5 time='2025-03-19 10:54:04 AM' bid=19799.75 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.75 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.75 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.75 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.75 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.75 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.75 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.75 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.75 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.75 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.75 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.75 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.75 ask=19800 isReset=False onorderupdate:orderId='555908ca01a64dae8dfe5475d39a7cb2' account='Playback101' name='S' orderState=Submitted instrument='MNQ JUN25' orderAction=SellShort orderType='Market' limitPrice=0 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=42163 time='2025-03-19 10:54:05' gtd='2099-12-01' statementDate='2025-03-19' onorderupdate:orderId='555908ca01a64dae8dfe5475d39a7cb2' account='Playback101' name='S' orderState=Accepted instrument='MNQ JUN25' orderAction=SellShort orderType='Market' limitPrice=0 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=42163 time='2025-03-19 10:54:05' gtd='2099-12-01' statementDate='2025-03-19' onorderupdate:orderId='555908ca01a64dae8dfe5475d39a7cb2' account='Playback101' name='S' orderState=Working instrument='MNQ JUN25' orderAction=SellShort orderType='Market' limitPrice=0 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=42163 time='2025-03-19 10:54:05' gtd='2099-12-01' statementDate='2025-03-19' onorderupdate:orderId='555908ca01a64dae8dfe5475d39a7cb2' account='Playback101' name='S' orderState=Filled instrument='MNQ JUN25' orderAction=SellShort orderType='Market' limitPrice=0 stopPrice=0 quantity=1 tif=Gtc oco='' filled=1 averageFillPrice=19795.5 onBehalfOf='' id=42163 time='2025-03-19 10:54:05' gtd='2099-12-01' statementDate='2025-03-19' onorderupdate:orderId='5afc5f69bdfc4a78b1847a27705a67dd' account='Playback101' name='Stop loss' orderState=Submitted instrument='MNQ JUN25' orderAction=BuyToCover orderType='Stop Market' limitPrice=0 stopPrice=19815.5 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=42164 time='2025-03-19 10:54:05' gtd='2099-12-01' statementDate='2025-03-19' onorderupdate:orderId='5afc5f69bdfc4a78b1847a27705a67dd' account='Playback101' name='Stop loss' orderState=Accepted instrument='MNQ JUN25' orderAction=BuyToCover orderType='Stop Market' limitPrice=0 stopPrice=19815.5 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=42164 time='2025-03-19 10:54:05' gtd='2099-12-01' statementDate='2025-03-19' onorderupdate:orderId='364399b5a989479cbdacc951dbc38a23' account='Playback101' name='Profit target' orderState=Submitted instrument='MNQ JUN25' orderAction=BuyToCover orderType='Limit' limitPrice=19783.25 stopPrice=0 quantity=1 tif=Gtc oco='00c4b5ccb8be442eafc382e91d1eb401' filled=0 averageFillPrice=0 onBehalfOf='' id=42165 time='2025-03-19 10:54:05' gtd='2099-12-01' statementDate='2025-03-19' onorderupdate:orderId='364399b5a989479cbdacc951dbc38a23' account='Playback101' name='Profit target' orderState=Accepted instrument='MNQ JUN25' orderAction=BuyToCover orderType='Limit' limitPrice=19783.25 stopPrice=0 quantity=1 tif=Gtc oco='00c4b5ccb8be442eafc382e91d1eb401' filled=0 averageFillPrice=0 onBehalfOf='' id=42165 time='2025-03-19 10:54:05' gtd='2099-12-01' statementDate='2025-03-19' onorderupdate:orderId='364399b5a989479cbdacc951dbc38a23' account='Playback101' name='Profit target' orderState=Working instrument='MNQ JUN25' orderAction=BuyToCover orderType='Limit' limitPrice=19783.25 stopPrice=0 quantity=1 tif=Gtc oco='00c4b5ccb8be442eafc382e91d1eb401' filled=0 averageFillPrice=0 onBehalfOf='' id=42165 time='2025-03-19 10:54:05' gtd='2099-12-01' statementDate='2025-03-19' marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.5 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.5 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.5 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.5 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.5 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.5 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.5 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.5 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.5 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.5 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.5 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.5 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.5 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.5 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.25 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.25 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.25 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.25 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.25 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.25 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.25 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.25 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.25 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.25 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19799.25 volume=1 time='2025-03-19 10:54:04 AM' bid=19799.25 ask=19800 isReset=False marketDataUpdateinstrument='MNQ JUN25 Globex' type=Last price=19
then the order filled at 19795.5
and the next tick shows price at 19799.5 again
I would like to do backtesting using zero slippage. To get similar scenario I just created a basic strategy logic
that if price is within range, then take short
To emulate this scenario use market replay for mnq 2025-03-19
PriceRangeStart = 19799.5;
PriceRangeEnd = 19787.25;
bool inPriceRange = currentPrice <= PriceRangeStart && currentPrice >= PriceRangeEnd;
if (inPriceRange)
{
if (Position.MarketPosition == MarketPosition.Flat)
{
EnterShort();
SetProfitTarget(CalculationMode.Ticks, ProfitTicks);
SetStopLoss(CalculationMode.Ticks, StopLossTicks);
}
}

Comment