Everything is working fine if I use NTSample to send order from tradestation to ninjatrader. However, if I make a small change, I can not send order to NT since log file has nothing of order. my code is very simple as below. Thanks very much for help in advance.
ccl3093
1). stragety:
vars: myPosition(0), Success(0);
if LastBarOnChart and NTConnected(1) then begin
myPosition = NTMarketPosition("Sim101");
print (myPosition);
if myPosition = 0 and close > open then begin
Success = FC_NTAction("Sim101", "Buy", "MyOrderId", 1, "ST1");
end;
if myPosition > 0 and close < open then begin
Success = FC_NTAction("Sim101", "Sell", "MyOrderId", 1, "ST1");
end;
end;
2). FC_NTAction:
inputs: myAccount(string), myAction(string), OrderId(string), Quantity(numericsimple), myStrategy(string);
FC_NTAction = NTCommand("Place", myAccount, myAction, Quantity, "Market", 0, 0, "", "", OrderId, "", myStrategy);
Comment