NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

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.

Reply
 
Thread Tools Display Modes
Old 03-31-2005, 05:50 AM   #1
scjohn
Senior Member
 
Join Date: Dec 2004
Location: , ,
Posts: 225
Thanks: 0
Thanked 11 times in 8 posts
Post imported post

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"
scjohn is offline  
Reply With Quote
Old 03-31-2005, 05:54 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Post imported post

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
NinjaTrader_Ray is offline  
Reply With Quote
Old 03-31-2005, 07:11 AM   #3
scjohn
Senior Member
 
Join Date: Dec 2004
Location: , ,
Posts: 225
Thanks: 0
Thanked 11 times in 8 posts
Post imported post

The issue is should you be starting another AT command before the last has finished.
scjohn is offline  
Reply With Quote
Old 06-20-2005, 07:43 PM   #4
mkundi
 
Join Date: Jun 2005
Location: , ,
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

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 ?
mkundi is offline  
Reply With Quote
Old 06-21-2005, 12:04 AM   #5
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Post imported post

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.
NinjaTrader_Ray is offline  
Reply With Quote
Old 06-21-2005, 07:03 AM   #6
mkundi
 
Join Date: Jun 2005
Location: , ,
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

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 ...... ?
mkundi is offline  
Reply With Quote
Old 06-21-2005, 08:58 AM   #7
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Post imported post

For realtime you don't only need a few seconds, for simulation 60 seconds is plenty during standard market hours.
NinjaTrader_Ray is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 05:19 AM.