![]() |
|
|||||||
| Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Dec 2004
Location: , ,
Posts: 225
Thanks: 0
Thanked 11 times in 8 posts
|
I am having trouble getting NT to accept an OIF command, after a Cancel command. The Cancel command has not finished being processed in NT when NT starts processing the OIF command. NT has accepted the Cancel command because the Cancel file has been deleted. I check for this condition (Cancel file does not exist) before I send the OIF command in the Order file. It seems that NT can't get out of it's own way, fast enough
Code:
"3/31/2005 2:09:39 PM ORDER STATUS TARGET1 ER2 06-05: FILLED B Type:LIMIT Qty:2 @ Limit Price:613.3 Stop Price:0 Position Id:ER2 06-05 SIM-101 90143321818 Order Id:90144447SIM Simulation" "3/31/2005 2:09:41 PM ORDER STATUS STOP1 ER2 06-05: CANCELING B Type:STOPMARKET Qty:2 @ Limit Price:0 Stop Price:614.4 Position Id:ER2 06-05 SIM-101 90143321818 Order Id:90144446SIM Simulation" "3/31/2005 2:09:41 PM ORDER STATUS STOP1 ER2 06-05: CANCELLED B Type:STOPMARKET Qty:2 @ Limit Price:0 Stop Price:614.4 Position Id:ER2 06-05 SIM-101 90143321818 Order Id:90144446SIM Simulation" "3/31/2005 2:11:35 PM SUBMIT ORDER ENTRY1: S 2 @ Limit Price:1183.5 Stop Price:1183.5 Order Id: Position Id:ES 06-05 SIM-101 90143592119 Simulation" "3/31/2005 2:11:35 PM ORDER STATUS ENTRY1 ES 06-05: PENDING S Type:STOPLIMIT Qty:2 @ Limit Price:1183.5 Stop Price:1183.5 Position Id:ES 06-05 SIM-101 90143592119 Order Id: Simulation" "3/31/2005 2:11:39 PM ORDER STATUS ENTRY1 ES 06-05: ACP_XCHG S Type:STOPLIMIT Qty:2 @ Limit Price:1183.5 Stop Price:1183.5 Position Id:ES 06-05 SIM-101 90143592119 Order Id:9014113548SIM Simulation" "3/31/2005 2:16:33 PM CANCEL ORDER ENTRY1: S 2 @ Limit Price:1183.5 Stop Price:1183.5 Order Id:9014113548SIM Position Id:ES 06-05 SIM-101 90143592119 Simulation" "3/31/2005 2:16:33 PM ORDER STATUS ENTRY1 ES 06-05: CANCELING S Type:STOPLIMIT Qty:2 @ Limit Price:1183.5 Stop Price:1183.5 Position Id:ES 06-05 SIM-101 90143592119 Order Id:9014113548SIM Simulation" "3/31/2005 2:16:34 PM AT 'ORDER OIF' ABORTED: Can't place order while entry order is pending" "3/31/2005 2:16:37 PM ORDER STATUS ENTRY1 ES 06-05: CANCELING S Type:STOPLIMIT Qty:2 @ Limit Price:1183.5 Stop Price:1183.5 Position Id:ES 06-05 SIM-101 90143592119 Order Id:9014113548SIM Simulation" "3/31/2005 2:16:37 PM ORDER STATUS ENTRY1 ES 06-05: CANCELLED S Type:STOPLIMIT Qty:2 @ Limit Price:1183.5 Stop Price:1183.5 Position Id:ES 06-05 SIM-101 90143592119 Order Id:9014113548SIM Simulation" |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
|
That is not the issue.
Simulation is driven by market data. If data is coming in slow, the simulator will respond slow. Also, any order actions performed in the simulator have a delay that is internally simulated or based on an actual real-time internet delay. The internet delay is based on round trip time from your PC to our servers. If you have bad internet connection during that time, the delay will be representative of this scenario. Ray
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Dec 2004
Location: , ,
Posts: 225
Thanks: 0
Thanked 11 times in 8 posts
|
The issue is should you be starting another AT command before the last has finished.
|
|
|
|
|
|
#4 |
|
Join Date: Jun 2005
Location: , ,
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
|
If thats true, thats a problem. I look for the same condition, i.e.
CANCELALL then FLATTENALL then issue the brand new OIF (order.txt) I look for the absence condition, if absence = true, only then issue next OIF. But looks like, here, the CANCEL has not finished, yet NT reports (via deletion of file) that it has completed the CANCEL operation. Ray, comments ? |
|
|
|
|
|
#5 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
|
It processes once the command has been proccesed not once the functions of the operation is complete. In the simulator, the cancel/flatten could have delay since it is market data driven. In realtime, it's command driven.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Join Date: Jun 2005
Location: , ,
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
|
Ok, thanks. So if I put lets say 60 secs delay after the CANCELALL , that should be ENOUGH to guarantee ..... a graceful completed CANCEL ..... both for simulation and realtime ...... ?
|
|
|
|
|
|
#7 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
|
For realtime you don't only need a few seconds, for simulation 60 seconds is plenty during standard market hours.
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|