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 11-05-2009, 11:14 PM   #1
geoMEAN
Member
 
Join Date: Mar 2008
Posts: 69
Thanks: 0
Thanked 0 times in 0 posts
Question Submit Market Order if Stop Order Was Rejected (FOR DLL??)

Hi,

I'm just starting to program my TS strategies with the NT DLL interface for order placement.

I have used the SMTP for over a year and have always selected the "Submit market order if stop order was rejected" checkbox in Options--> ATI--> Tradestation Stop Orders area.

If I submit a stop order through DLL interface and it is rejected, will checking this checkbox still submit a market order for me?

(I want it to submit a market order if I get a rejected stop order because some TS strats are restricted from using tick by tick evaluation-- end-of-bar only because I'm using multiple datastreams. In turn, not having tick-by-tick evaluation in TS means I can't replicate the functionality of checking for a rejected order a few seconds after the order was placed; I would have to wait until the end of the next bar, which in some cases could be many minutes later depending on the timeframe.)

Thanks.
geoMEAN is offline  
Reply With Quote
Old 11-06-2009, 06:04 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,572
Thanks: 262
Thanked 1,018 times in 999 posts
Default

geoMEAN, the orderhandling options for TS apply to the Email and DLLl interface.
NinjaTrader_Bertrand is online now  
Reply With Quote
Old 11-06-2009, 04:20 PM   #3
geoMEAN
Member
 
Join Date: Mar 2008
Posts: 69
Thanks: 0
Thanked 0 times in 0 posts
Default

Oh man, that is the best news I've heard all week! Thanks!
geoMEAN is offline  
Reply With Quote
Old 11-10-2009, 06:04 PM   #4
geoMEAN
Member
 
Join Date: Mar 2008
Posts: 69
Thanks: 0
Thanked 0 times in 0 posts
Default

I just tested this and I think you are incorrect. The order handling options only apply to the SMTP server ATI.

I tried placing some buy stop orders that were below the market by a little bit and by a lot, through the DLL ATI and all the ones I tried were rejected without replacement market orders getting placed.

Is there a way to automatically make rejected orders convert to market orders without having to handle it in easy language when using the Tradestation DLL ATI?


I'm limited from monitoring for rejected orders every few seconds in easy language because i use multiple data streams in most of my TS strategies, and one major limitation of using multiple data streams is that TS will not let you run intrabar (tick by tick) processing IF you are using multiple data streams.
Last edited by geoMEAN; 11-10-2009 at 06:13 PM. Reason: add / clarify
geoMEAN is offline  
Reply With Quote
Old 11-11-2009, 03:52 AM   #5
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,572
Thanks: 262
Thanked 1,018 times in 999 posts
Default

geoMEAN, please contact me using the Help > Mail to Support feature and check to include your trace and logs so I can have a look - thanks!
NinjaTrader_Bertrand is online now  
Reply With Quote
Old 11-11-2009, 02:17 PM   #6
geoMEAN
Member
 
Join Date: Mar 2008
Posts: 69
Thanks: 0
Thanked 0 times in 0 posts
Default

Ok I will do that now. I just sent the log files. Thanks.

FYI, all of the tests were done on the "Sim101" account with a zenfire connection. I didn't want to experiment with real money to see if there was a difference between Sim101 and my live trading account.

Here's the TS code I used to once again test the buy stop orders on @ES.D (for execution on ESZ09):

Code:
//tested with @ES.D via Tradestation to Ninja DLL ATI link
//testing to see if Ninja will replace rejected stop orders with market orders
//like it does when using the SMTP ATI interface

input:
    currentESZ09ask(1096.25),  //Current ESZ09 ASK
    numMinMoves(0);    //number ticks or minmoves to add to current ask (use negative for minmoves below ASK)

variables:
    Success(0),
    oneMinMove(0.25);

if lastbaronchart then
begin
    Success = NTBuyStop("TestRejectBuyStop", 1, currentESZ09ask + numMinMoves*oneMinMove);
end;
From my observations I see buy stop orders will accept if price is AT BID OR HIGHER. Any lower than BID price, Ninja will give a rejected order dialog box and no replacement market order will be submitted.

Also FYI, I'm using Ninja 6.5.1000.14

Attached Images
File Type: gif buystop rejected.png (6.1 KB, 36 views)
Last edited by geoMEAN; 11-11-2009 at 03:05 PM.
geoMEAN is offline  
Reply With Quote
Old 11-12-2009, 04:33 AM   #7
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,572
Thanks: 262
Thanked 1,018 times in 999 posts
Default

Thanks geoMEAN got the files, will review and respond.
NinjaTrader_Bertrand is online now  
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rejected Stop Order toptrader Strategy Development 1 10-19-2009 10:28 AM
06/05/2009 2:59:19 PM Order Order rejected - reason:Too late to replace order (201) junkone Strategy Development 1 05-06-2009 02:29 PM
why was this stop order rejected. junkone Strategy Development 7 12-15-2008 09:56 AM
Submit Limit Entry Order and Stop Loss Order at same time? aspTrader Miscellaneous Support 2 10-04-2006 02:40 AM
Order rejected: no market data available dwil Automated Trading 10 03-22-2006 03:12 AM


All times are GMT -6. The time now is 03:38 AM.