Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Historical bid/ask spread for Tick Replay

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Historical bid/ask spread for Tick Replay

    I need to get average spread (bid/ask) of last 5min for a strategy that's running on TickReplay.

    How can that be done? Could share an example snippet?

    Your doc says following would give past bidAsk, but cannot be used for TickReplay type. What would happen if one tries to access Ask series during tick replay?

    eg. AddDataSeries("AAPL", BarsPeriodType.Minute, 30, MarketDataType.Ask);
    from https://ninjatrader.com/support/help...20English.html

    https://ninjatrader.com/support/help...ick_replay.htm
    Warning: A Tick Replay indicator or strategy CANNOT use a MarketDataType.Ask or MarketDataType.Bid series.
    Tick Replay was only ONLY designed to work with MarketDataType.Last. A TickReplay indicator or strategy should NOT be mixed with a MarketDataType.Ask or MarketDataType.Bid series


    #2
    Hello yubo27,

    Thanks for your post.

    As stated in the help guide link and snippet you shared, TickReplay can only be used to work with MarketDataType.Last, not MarketDataType.Ask or MarketDataType.Bid.

    You could view the BuySellVolume indicator that comes default with NinjaTrader to see how to get the Ask or Bid price from OnMarketData() when MarketDataType == MarketDataType.Last. To view the script, open a New > NinjaScript Editor window, open the Indicators folder, and double-click on the BuySellVolume indicator.

    OnMarketData(): https://ninjatrader.com/support/help...marketdata.htm

    Let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    118 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X