Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

ATI client methods return empty string

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

    ATI client methods return empty string

    Hello,

    using the C# NinjaTrader.Client.dll:

    Sometimes, the client methods, like client.Orders("SIM101") or client.Strategies("SIM101") return an empty string, although the client is Connected and the client actually has the infos in its privtae HashTable ("client.keys").

    So I made a workaround: If the "official" method return empty string , I try to get the value from the HashTable using the GetString method. It works, but that's not how it should be I guess:
    Code:
    string s = client.Orders(account);
    
    if (string.IsNullOrWhiteSpace(s))
    {
    s = client.GetString("Orders|");
    }
    So why does this happen at all ?

    #2
    Hi Derjan, thanks for posting.

    We will not be able to debug your C# application. I did make a successfult connection to the server and modified the example here (NinjaTraderClient/MainWindow.xaml.cs) to print out the orders to the Visual Studio output Window (modified file attached). Most likely what is happening is there is no connection, confirm that with:

    Console.WriteLine(string.Format("{0} | connect: {1}", DateTime.Now, connect.ToString())); //connect should be 0
    Console.WriteLine("Client Orders (Sim101)" + myClient.Orders("Sim101").ToString()); //added this line @ line # 78 to confirm

    Best regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rtwave, 04-12-2024, 09:30 AM
    5 responses
    37 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by funk10101, Today, 12:02 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by GLFX005, Today, 03:23 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by nandhumca, Yesterday, 03:41 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by The_Sec, Yesterday, 03:37 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X