Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnMarketData on Historical data

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

    OnMarketData on Historical data

    Hi,

    I wish to run OnMarketData on Historical data, please tell me how do I take the example in the guide and run it on historical data:

    protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
    {
    // Print some data to the Output window
    if (marketDataUpdate.MarketDataType == MarketDataType.Last)
    Print(string.Format("Last = {0} {1} ", marketDataUpdate.Price, marketDataUpdate.Volume));
    else if (marketDataUpdate.MarketDataType == MarketDataType.Ask)
    Print(string.Format("Ask = {0} {1} ", marketDataUpdate.Price, marketDataUpdate.Volume));
    else if (marketDataUpdate.MarketDataType == MarketDataType.Bid)
    Print(string.Format("Bid = {0} {1}", marketDataUpdate.Price, marketDataUpdate.Volume));
    }

    Thank you.

    #2
    Hello,

    Thank you for the post.

    To use OnMarketData historically, you would first need to enable TickReplay and ensure you have tick replay data for the instrument being used. Once this is done, the override can be used historically.

    We have a help guide article on this specific topic here: https://ninjatrader.com/support/help...sub=tickreplay

    Please ensure to utilize the example that is specific to TickReplay from the above link, the syntax to use TickReplay is different than the syntax you have posted which would be used for Realtime.

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    567 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    548 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X