NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 02-22-2009, 08:40 PM   #1
Czarek
Senior Member
 
Join Date: Jun 2008
Posts: 159
Thanks: 0
Thanked 0 times in 0 posts
Default How to place All Or Nothing order??

Hallo.
How to place AOL orders. I use EntryLimit orders and sometimes unfilled part is smaller than lot and this is a case of error and strategy termination. This happened in forex if the order quantity is 25 000 then filled part is 20000 so the rest 5000 made error because smallest quantity is 18 000.
Czarek
Czarek is offline  
Reply With Quote
Old 02-23-2009, 01:03 AM   #2
NinjaTrader_Ben
NinjaTrader Customer Service
 
NinjaTrader_Ben's Avatar
 
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
Default

Hello,

This is not supported, sorry.
NinjaTrader_Ben is offline  
Reply With Quote
Old 02-23-2009, 05:42 AM   #3
Czarek
Senior Member
 
Join Date: Jun 2008
Posts: 159
Thanks: 0
Thanked 0 times in 0 posts
Default

How to avoid this problem ?? Strategy sometimes terminate by its self.
Czarek.
Czarek is offline  
Reply With Quote
Old 02-23-2009, 08:27 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Which broker are you executing on?
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 02-23-2009, 08:58 AM   #5
Czarek
Senior Member
 
Join Date: Jun 2008
Posts: 159
Thanks: 0
Thanked 0 times in 0 posts
Default

Interactive Brokers
Czarek is offline  
Reply With Quote
Old 02-23-2009, 09:57 AM   #6
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Please go to Tools > Options > Strategies > NinjaScript and try setting your OrderHandling option to 'ByStrategyPosition'.

Please also check this link - http://www.ninjatrader-support.com/H...tegiesTab.html
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 02-23-2009, 10:47 AM   #7
Czarek
Senior Member
 
Join Date: Jun 2008
Posts: 159
Thanks: 0
Thanked 0 times in 0 posts
Default

Hallo.
I'm not sure if this could help. OrderHandling option to 'ByStrategyPosition'. Concern Stop los and target orders. However, the problem is that if I want to buy 25000Euro, and I got 20000 filled then if strategy want to buy outstanding 5 000 Euro, I got the Error because smallest amount, I can buy is 18 000. Therefore, trategy close all orders and terminate it self.
So the error comming from entry order not stop or target order.
Czarek.
Czarek is offline  
Reply With Quote
Old 02-23-2009, 11:52 AM   #8
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Hi Czarek, I see - please send your log and trace files to support at ninjatrader dot com Attn Bertrand so I can investigate further. Thanks!
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 02-24-2009, 03:04 AM   #9
Czarek
Senior Member
 
Join Date: Jun 2008
Posts: 159
Thanks: 0
Thanked 0 times in 0 posts
Default

Bertrand.
The message I got is: Order Message: Warring: our order is smaller than the minimum order size of 20000 EUR (399) Affected order Buy 5000 Limit.

Czarek
Czarek is offline  
Reply With Quote
Old 02-24-2009, 08:35 AM   #10
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Thanks for the clarification Czarek - I would suggesting to contact your broker on why you get these partial fills - have you tried using a different order type such as a market / stop order?
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 02-25-2009, 09:09 AM   #11
Czarek
Senior Member
 
Join Date: Jun 2008
Posts: 159
Thanks: 0
Thanked 0 times in 0 posts
Default

Bertrand.
I tried market orders but I lost to much on each transaction. Today I talked to TWS team, and I found out that actually the small order (5000EURO) is placed but not in Idea Pro but is transferred to Idea and can get filled. Unfortunately simultaneously the error message is sent by TWS and there is now way to turn it off in TWS. Are any way that Ninja strategy will be ignoring such error messages????
Czarek
Czarek is offline  
Reply With Quote
Old 02-25-2009, 09:33 AM   #12
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Unfortunately not Czarek, if an error is generated the strategy will terminate, unless you look into this option - http://www.ninjatrader-support.com/H...rHandling.html But this is an advanced topic and will require your due diligence in using it. Thanks.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 02-25-2009, 10:26 AM   #13
Czarek
Senior Member
 
Join Date: Jun 2008
Posts: 159
Thanks: 0
Thanked 0 times in 0 posts
Default

Bertrand.
If I put this code:
protected override void Initialize()
{
RealtimeErrorHandling = RealtimeErrorHandling.TakeNoAction;
}
will the strategy not take any action for the error messages and keep working ???? I play using my strategy about 4 months live and until now only the partial filled error appeared so I'm not afraid on any other event happened? However, because of this error I lost a very big target.
Czarek
Czarek is offline  
Reply With Quote
Old 02-25-2009, 10:33 AM   #14
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

RealtimeErrorHandling turns off all handling. You need to manage everything yourself if you decide to use it.
NinjaTrader_Josh is offline  
Reply With Quote
Old 02-25-2009, 10:49 AM   #15
Czarek
Senior Member
 
Join Date: Jun 2008
Posts: 159
Thanks: 0
Thanked 0 times in 0 posts
Default

Is that mean "turns off all error handling" and if I do not put any error handling rules strategy will not take any action if error appeared ?
Czarek 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Place Buy order and Sell order at same time. robotics General Programming 38 08-07-2009 02:10 PM
Place Order in multiple Instrument laserjet ATM Strategies (Discretionary Trading) 3 12-11-2008 04:49 AM
How to place a order @stop on a market that doesn't accept them skynetman Strategy Development 5 04-10-2008 09:44 AM
Unable to Place Order with Amp Futures dgregor5 SuperDOM and other Order Entry Windows 6 01-22-2008 02:16 PM
how to place an opening order only trade HelloHello Automated Trading 5 09-11-2007 08:02 PM


All times are GMT -6. The time now is 08:17 AM.