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

client.Orders() call in C# sample application returns nothing?

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

    client.Orders() call in C# sample application returns nothing?

    Guys,

    I'm working on an app to integrate with NinjaTrader, and for various reasons I want it to be external and not part of the NinjaScript interface.

    I've configured the C# sample app and run it. However, I simply cannot get the documented Orders() method to return anything for account SIM101, even though I'm running the simulated feed and the account is there, and I've placed orders in it, both through Control Center and through the sample app.

    Another concern is that my orders placed from the sample app don't seem to show up in the Control Center...so I'm concerned it's broken all around.

    See here:
    Code:
     // Submit the order
                if (cboOrderType.Text == "MARKET")
                    success = client.Command("PLACE", "SIM101", instrument, action, quantity, "MARKET", 0, 0, "DAY", "", orderId, "", "");
                else if (cboOrderType.Text == "LIMIT")
                    success = client.Command("PLACE", "SIM101", instrument, action, quantity, "LIMIT", (double) nudLimitPrice.Value, 0, "DAY", "", orderId, "", "");
                else if (cboOrderType.Text == "STOP")
                    success = client.Command("PLACE", "SIM101", instrument, action, quantity, "STOP", 0, (double) nudStopPrice.Value, "DAY", "", orderId, "", "");
                else if (cboOrderType.Text == "STOPLIMIT")
                    success = client.Command("PLACE", "SIM101", instrument, action, quantity, "STOPLIMIT", (double) nudLimitPrice.Value, (double) nudStopPrice.Value, "DAY", "", orderId, "", "");
                System.Console.WriteLine(client.Orders("SIM101"));
    This code is from Form1.cs, and I added that last line (System.Console.WriteLine(client.Orders("SIM101")) ) on line 70. However, nothing is printed out...the newline is printed (i.e., I know writeline is working) but no data is returned from the call.

    Am I doing something wrong here?

    #2
    Never mind...got it. I had not turned on the AT interface (File->AT Interface).

    Thanks.

    Comment


      #3
      Ok, great you got it working!
      BertrandNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by TraderBCL, Today, 04:38 AM
      3 responses
      23 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by WeyldFalcon, 08-07-2020, 06:13 AM
      11 responses
      1,423 views
      0 likes
      Last Post jculp
      by jculp
       
      Started by RubenCazorla, Today, 09:07 AM
      0 responses
      4 views
      0 likes
      Last Post RubenCazorla  
      Started by BarzTrading, Today, 07:25 AM
      2 responses
      29 views
      1 like
      Last Post BarzTrading  
      Started by devatechnologies, 04-14-2024, 02:58 PM
      3 responses
      21 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X