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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    63 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    40 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    21 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    23 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    51 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X