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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          133 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          75 views
          1 like
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          117 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          113 views
          1 like
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          90 views
          0 likes
          Last Post CarlTrading  
          Working...
          X