Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MarketData return 0 using client DLL

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

    MarketData return 0 using client DLL

    Hi!

    I've downloaded market replay data for the instrument "ES 12-15", playing back, enabled AT and trying to connect from my custom windows form app in VS using the Ninjatrader.Client.DLL (32-bit DLL and 32-bit instance of NT8).

    These are the lines I'm running:

    client.Connected(1) -> returns 0
    client.SubscribeMarketData("ES 12-15") -> returns 0

    BUT

    client.MarketData("ES 12-15", 0) always return 0, no matter what. Seems to me that I am connected - but there is no usable MarketData coming through to me - even though my chart in NT8 tells me there is a lot of action. Has anyone had similar problems?
    Or is there something I am doing completely wrong here?

    Best regards
    Fatter

    #2
    Hello,

    Thank you for the question.

    I would be happy to look into this, I will likely need to work with development on this to ensure the code used would be expected that it can be used in this way. Could you provide a simplified sample of the syntax you are using to get connected and the steps you are taking?

    I can test on my end and that way I have the correct syntax and structure you have used to get more information on whats happening.

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

    Comment


      #3
      Thanks for the reply!

      I am basically doing the same I did using NT7.
      Creating a standard windows forms app, the code goes like this:


      using System;
      using System.Collections.Generic;
      using System.ComponentModel;
      using System.Data;
      using System.Drawing;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.Windows.Forms;
      using NinjaTrader.Client;
      namespace YetiTrader
      {
      public partial class Form1 : Form
      {
      Client client;
      public Form1()
      {
      InitializeComponent();
      }

      private void button1_Click(object sender, EventArgs e)
      {
      client = new Client();

      int connected = client.Connected(1);

      richTextBox1.Text = "";
      Log("Connected: " + connected);
      Log("Subscribed: " + client.SubscribeMarketData("ES 12-15"));
      Log("Last: " + client.MarketData("ES 12-15", 0));
      }

      private void button2_Click(object sender, EventArgs e)
      {

      Log("Bid: " + client.MarketData("ES 12-15", 1));
      Log("Last: " + client.MarketData("ES 12-15", 0));
      Log("Ask: " + client.MarketData("ES 12-15", 2));
      }

      private void Log(String text)
      {
      richTextBox1.Text += text + "\n";
      }
      }
      }


      Did this is PowerShell as well...just to be certain:


      PS C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE> Add-Type -path "C:\Program Files (x86)\NinjaTrader 8\bin\NinjaTrader.Client.dll"
      PS C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE> $atiTest = New-Object NinjaTrader.Client.Client
      PS C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE> $atiTest.Connected(1)
      0
      PS C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE> $atiTest.CashValue("Sim101")
      0
      PS C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE> $atiTest.SubscribeMarketData("ES 12-15")
      0
      PS C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE> $atiTest.MarketData("ES 12-15", 0)
      0
      PS C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE>

      Do you need more information?
      I'm running NT8 with AT enabled and my chart tells me there's a lot of action i en market replay.

      Best regards, Fatter

      Comment


        #4
        Hello,

        Thank you for providing this sample.

        This seems to contain the references along with the code needed to test the question. I will test this as well as confirm with development if this would be a viable approach to what you are trying with NT8 specifically.

        Once I have further details I will reply back here.

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

        Comment


          #5
          Hello,

          I wanted to follow up on this.

          I was able to successfully test the connection and return a 0 for connected using the client.Connected(1); syntax. This was tested using the 64 bit NT with a 64 bit VS project.

          Originally I was unable to get this connected but once I did get confirmation that this should be possible it looks that my error was leaving NT7 open. This does not work if NT7 is open. Can you confirm your NT7 is completely exited while testing this item?

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

          Comment


            #6
            Hi!

            Thanks again for the reply.
            I was probably not being precise - I am not using NT7, I am using NT8. I am using a similar code and approach as I did when using NT7 (which worked fine). My machine only has NT8 installed.

            I've tried both with the 32 bit and 64 bit versions, but same result.
            I get connected (returns a 0), I also get a 0 when calling SubscribeMarketData("ES 12-15")), which tells me that the two first calls to the DLL are fine and working.

            But the problem is the MarketData function - it always returns 0, no matter what the last/bid/ask actually is on the chart in NT8 during replay.

            Did you get different values than 0 from the MarketData function?

            Comment


              #7
              Hello,

              Thank you for the reply.

              My test was also done using NT8 per your note in post #1.

              I had seen 0 as well, I wanted to just confirm that nt7 was closed on your end also and you were getting the values you were, if that is the case we have the same result.

              I am currently working with development on this regarding expectations on this. Once I have further information on this item I will reply back.

              The connection works from my tests, regarding other items they were not tested.

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

              Comment


                #8
                Hello,

                I just wanted to post feedback on this item, it seems this has been address and is potentially scheduled for the next beta release NTEIGHT-9188.

                Once the next release is out, could you please try a new test with this and see if it is resolved for you?

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

                Comment


                  #9
                  Thank you for your response!

                  That is good news and I will test and post my findings as soon as the new release is available!

                  Best regards,
                  Joakim

                  Comment


                    #10
                    Hi,

                    I just want to confirm that I updated to 8.0.0.8 and it works!
                    The market data is now returned as expected, thank you

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by 00nevest, Today, 02:27 PM
                    0 responses
                    1 view
                    0 likes
                    Last Post 00nevest  
                    Started by Jonafare, 12-06-2012, 03:48 PM
                    5 responses
                    3,986 views
                    0 likes
                    Last Post rene69851  
                    Started by Fitspressorest, Today, 01:38 PM
                    0 responses
                    2 views
                    0 likes
                    Last Post Fitspressorest  
                    Started by Jonker, Today, 01:19 PM
                    0 responses
                    2 views
                    0 likes
                    Last Post Jonker
                    by Jonker
                     
                    Started by futtrader, Today, 01:16 PM
                    0 responses
                    9 views
                    0 likes
                    Last Post futtrader  
                    Working...
                    X