I'm currently using the NinjaTrader.Client.dll to do some remote trading and came across a few problems.
I am able to connect via (Client).SetUp("127.0.0.01",36973) and returned 0 (which is documented as successful), but afterwards no other API calls were able to pass through and resulted in "-1" as a response.
I've tried to send orders via _client.Command and the returned value was "0", which means it was successful, though no new trades were seen in the Control Center.
Then I tried to place a bunch of trades and call the orders method and it returns an empty/null string.
I'm guessing something is wrong with the connection when I call SetUp.
I've also tried to use NTDirect.dll and loaded it via DllImports but that had the same results as previous.
Some sort of help would be appreciated.
-Kelvin
var client = new Client(); var setupResult = client.SetUp("127.0.0.7", 36973); Console.WriteLine("Setup Result: {0}",setupResult); for (var i = 0; i < 5; i++) { var order = client.NewOrderId(); var result = client.Command("PLACE", "Sim101", "ES 06-14", "BUY", 5, "MARKET", 0, 0, "DAY", string.Empty, order, string.Empty, string.Empty); Console.WriteLine("Order Result: {0} | {1} of 5",result, i + 1); } var orders = client.Orders("Sim101"); Console.WriteLine("Orders: {0}",string.IsNullOrEmpty(orders) ? "EMPTY" : orders);
Setup Result: 0 Order Result: 0 | 1 of 5 Order Result: 0 | 2 of 5 Order Result: 0 | 3 of 5 Order Result: 0 | 4 of 5 Order Result: 0 | 5 of 5 Orders: EMPTY
Comment