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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    86 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    44 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    23 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    31 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    31 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X