Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MarketData works for ES only

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

    MarketData works for ES only

    Hello.

    I have a C# test program that show last price (client.MarketData(Instrument, 0), bid price (client.MarketData(Instrument, 1) and ask price (client.MarketData(Instrument, 2), every 60 seconds.

    Tests work fine only with the instrument ES 06-17,but I dont know why don't work with YM 06-17.

    With YM 06-17, the price values are wrong and they are not updated.

    Please, I like to know who had any problem like that, and how was fixed.

    Thanks.
    Attached Files

    #2
    Hello excepticons, and thank you for your question. There are many reasons this could be happening. Would it be possible to send a stripped down copy of your code? This will help us give the best help possible.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      We understand your time is valuable. Since NinjaScript pulls from the same data source your Basic Entry corner of the Orders tab of the control center does, the most common reason for your NinjaScript not matching this information would be your code processing on bar closing. I would like to recommend refactoring your NinjaScript code as a multi-timeframe strategy



      with a one-tick secondary series, and reading values from this series. Please let us know if there are any other ways we can help.
      Jessica P.NinjaTrader Customer Service

      Comment


        #4
        Hi, Jessica.
        I have concluded that version 7 has some connectivity issues. I dont know what issues are, but with just install version 8, problems are gone.
        Remark:I'm not using NinjaScript. I have developed a program in C# with netframework 4.6 that has a reference to NinjaTrader.Client.dll.
        This is the source:

        ...
        using NinjaTrader.Data;
        ...
        ...
        iRetornos = client.SubscribeMarketData(cInstrumento);
        dLastPrice = client.MarketData(cInstrumento, 0);
        dBidPrice = client.MarketData(cInstrumento, 1);
        dAskPrice = client.MarketData(cInstrumento, 2);
        ...
        ...
        client.UnsubscribeMarketData(cInstrumento);
        ...

        This C# program works perfect with NT 8!

        Thanks for your cooperation.

        Gustavo

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        23 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        115 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        68 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        222 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        406 views
        0 likes
        Last Post CaptainJack  
        Working...
        X