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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    44 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    54 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    34 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    94 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    56 views
    0 likes
    Last Post PaulMohn  
    Working...
    X