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 argusthome, 03-08-2026, 10:06 AM
        0 responses
        61 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        40 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        21 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        23 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        51 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X