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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    42 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    29 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    46 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    38 views
    0 likes
    Last Post CarlTrading  
    Working...
    X