I can call and retrieve values with NTNewOrderId() and NTConnected(). I am also able to place orders in the Sim with NTBuyLimit(orderId, quantity, limitPrice). But when I use the NTFilled(orderId, account) or NTOrderStatus(orderId, account) I run into problems.
Relevant code:
PreMain
dll.addFunction("Filled", DLL.INT, DLL.STDCALL, "Filled", DLL.STRING, DLL.STRING);
dll.addFunction("OrderStatus", DLL.STRING, DLL.STDCALL, "OrderStatus", DLL.STRING, DLL.STRING);
Main
myFilled = NTFilled(orderId);
function NTFilled(orderId){
return dll.cal("Filled", orderId, "");
}
myOrderStatus = NTOrderStatus(orderId, account); // where account is set globally to "Sim101"
function NTOrderStatus(orderId, account) {
return dll.call("OrderStatus", orderId, "");
}
I set them up differently to test if adding account made a difference. I have tested both with "Sim101" and "" in the account position for the dll.call
I first send a call for an NewOrderId with the NT function then send in a limit buy with that ID with the NTBuyLimit function. In NT Control Center I see the order filled (although with a different ID).
Then I call for information with then above code. "myFilled" shows up as 0 in esignal's log (100 in NT CC) and "myOrderStatus" actually causes the EFS to stall out and esignal to crash.
I am not sure what I am doing wrong here. Why I can't call any info requiring arguments or parameters and why esignal crashes at NTOrderStatus has me stumped. My being new to programming probably doesn't help.
Does it have to do with the different orderID's in esignal and NT? Or is it something else?
Thanks in Advance
Rich
Comment