Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

OnMarketData never called when in MarketReplay mode

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

    OnMarketData never called when in MarketReplay mode

    I'm trying to test a strategy by replaying current or previous day data with the Market Replay tool.
    My data series is the ES with Tick Replay enabled.

    I can't seem to find a way to get the correct "current" tick value.
    I checked this forum and thought OnMarketData () would give me the current price, using this snippet:
    Code:
    if (e.MarketDataType == MarketDataType.Last) 
        Print("Last = " + e.Price + " " + e.Volume);
    But when I use the VS Debugger and place a breakpoint inside OnMarketData(), it NEVER gets called.

    I'm obviously missing something here.
    How can I get the current tick value when I run the replay mode, and how can I get onMarketData() to be called ?

    I can't seem to find the answer even after countless searches here.
    Really appreciate your help.

    #2
    Hello g49nep1f,

    Thank you for the post.

    I wanted to confirm, do you have TickReplay checked in the chart as well as the options menu? There are two settings, one in the options menu and then another for each individual chart or where the script is applied.

    Outside of this observation, are you seeing any prints at all? I wouldn't be able to use the VS debug info but we can address the problem by confirming if you are seeing any prints or not. If there are no prints that is sufficient to let me know the override was not called or that your print was not reached.

    To confirm other logic is not the problem have you tested using the print from the help guide specifically? Testing this print with no other custom logic would help to know if the override is being called and no other logic you may have is affecting the result: https://ninjatrader.com/support/help...sub=tickreplay

    The other item to check would be that you are connected to your data provider and to reload the historical data when you do this test.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks Jessie,

      I reviewed all the steps you mentioned and my problem is fixed now.
      Thanks again for your help!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      3 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      238 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      384 views
      1 like
      Last Post Gavini
      by Gavini
       
      Started by oviejo, Today, 12:28 AM
      0 responses
      4 views
      0 likes
      Last Post oviejo
      by oviejo
       
      Started by pechtri, 06-22-2023, 02:31 AM
      10 responses
      125 views
      0 likes
      Last Post Leeroy_Jenkins  
      Working...
      X