Announcement

Collapse
No announcement yet.

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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    89 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    143 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    83 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    257 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    334 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X