Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnMarketData

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

    OnMarketData

    I am a bit new to NT (even though I have been using it for some weeks) and I am completely stopped by the following issue. I simply want to print today's open and yesterday's close in OnMarketData, i.e.:

    protected override void OnMarketData(MarketDataEventArgs e)
    {
    Print(CurrentDayOHL().CurrentOpen[0]+" "+PriorDayOHLC().PriorClose[0]);
    }

    What I obtain (here I use instrument DIA as an example):

    .
    .
    185,5 185,46
    185,5 185,46
    185,5 185,46
    185,5 185,46
    186,07 186,31
    186,07 186,31
    186,07 186,31
    186,07 186,31
    186,07 186,31

    i.e. these prices suddenly change a few lines after running the code. What is interesting: only 186,07 and 186,31 are correct (that is: the first lines are incorrect).

    What wrong am I doing?

    #2
    Hello pkos16,

    I am not able to reproduce your results in a test script.

    Below is a link to a video of the test.
    World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


    Attached is the script I have added your print to and tested.

    I used Jing which is free software to record short videos and host online.
    Would you be able to create a short video demonstrating this same test I have performed but showing the different results?
    Screen capture and recording software for Windows and Mac. Quickly get images and videos. Start your free trial today!
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks a lot. I will try to follow your steps. Actually I am wondering if this is not due to the data provider (I use Interactive Brokers).

      Comment


        #4
        Hello pkos16,

        As long as the chart is up to date with the historical data, the source of the data should not matter.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Yes, you must be right. Anyway, I will put my finger on it. Thanks again for your time!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          576 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 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
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X