Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnMarketData in Historical Data

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

    OnMarketData in Historical Data

    Hello,

    I have an indicator that uses volume from OnMarketData in order to make decisions to display certain draw objects on a chart. I notice it doesn't work on historical data. I believe it is due to use the event handler OnMarketData. Is there a way to show the volume from OnMarketData historically?

    Thanks,
    Jeremy
    Last edited by JayRupe; 11-27-2023, 12:49 PM.

    #2
    Hello JayRupe,

    Thanks for your post.

    From the OnMarketData() help guide page:

    "By default, this method is not called on historical data (backtest), however it can be called historically by using TickReplay​.

    If used with TickReplay, please keep in mind Tick Replay ONLY replays the Last market data event, and only stores the best inside bid/ask price at the time of the last trade event. You can think of this as the equivalent of the bid/ask price at the time a trade was reported. As such, historical bid/ask market data events (i..e, bid/ask volume) DO NOT work with Tick Replay. To obtain those values, you need to use a historical bid/ask series separately from TickReplay through OnBarUpdate(). More information can be found under Developing for Tick Replay.​"

    This means that you would need to enable Tick Replay to have OnMarketData() called on historical data.

    See the help guide documentation below for more information.

    OnMarketData(): https://ninjatrader.com/support/help...marketdata.htm
    Tick Replay: https://ninjatrader.com/support/help...ick_replay.htm
    Historical Bid/Ask Series: https://ninjatrader.com/support/help..._ask_serie.htm
    Developing for Tick Replay: https://ninjatrader.com/support/help...ick_replay.htm
    <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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    43 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    30 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    47 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    38 views
    0 likes
    Last Post CarlTrading  
    Working...
    X