//UPDATE STOP ORDER if time < 1500 and NTOrderStatus(NTStopOrderID) = "Accepted" and LStopPr > CurrentLStopPr then begin value1 = NTChange(NTStopOrderID,0,0,LStopPr); CurrentLStopPr = LStopPr; end; //PLACE STOP ORDER if NTFilled(NTEntOrderID) > 0 and NTOrderStatus(NTStopOrderID) = "" then begin value1 = NTCommand("PLACE",NTAcct,"Sell",NTCon,"Stop",0,min list(low - 1,LStopPr),"Day","",NTStopOrderID,"",""); CurrentLStopPr = minlist(low - 1,LStopPr); end; //UPDATE ENTRY ORDER if NTFilled(NTEntOrderID) = 0 and NTOrderStatus(NTEntOrderID) = "Working" then begin value1 = NTChange(NTEntOrderID,0,0,close); end; If condition1 And condition2 And condition3 And condition4 And condition5 Then begin LEPrice = close; value1 = NTCommand("PLACE",NTAcct,"Buy",NTCon,"Limit",LEPri ce,0,"Day","",NTEntOrderID,"",""); end; if time = 1512 and NTOrderStatus(NTExitOrderID) = "Working" then value1 = NTChange(NTExitOrderID,0,0,close - 5); if time > 1500 and time < 1512 and NTOrderStatus(NTExitOrderID) = "Working" then value1 = NTChange(NTExitOrderID,0,0,close); if time = 1500 and NTFilled(NTEntOrderID) = 1 and NTFilled(NTStopOrderID) = 0 and NTOrderStatus(NTStopOrderID) = "Accepted" then begin value1 = NTCancel(NTStopOrderID); value1 = NTCommand("PLACE",NTAcct,"Sell",NTCon,"Limit",clos e,0,"Day","",NTExitOrderID,"",""); end;
Following that, the stop order was placed. However, the stop price never updated as it did in the sim trading, and the 1500 exit order was never sent.
At the end of the day, I still had an open position, which I closed manually.
Comment