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 09-12-2008, 08:43 AM   #1
nfeldberg
Member
 
Join Date: Jul 2008
Posts: 67
Thanks: 0
Thanked 0 times in 0 posts
Default Partial fill

Hi there,

I have a general question:
when getting a partial fill for a target order, will the system try to cancel the remaining of the associated orders with the position?

I believe that this is the current reality on the system but clearly it should not behave like that, only when the entire position is closed you should send a cancelled pending exit order. otherwise I would be without a stop in the market.

could you clarify how it should work? I can send logs and traces if required.

kind regards,
Nir
nfeldberg is offline  
Reply With Quote
Old 09-12-2008, 08:51 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Nir,

Please change your strategy to run on ByStrategyPosition instead of PerEntryExecution for the "Stop & Target submission" property.
NinjaTrader_Josh is offline  
Reply With Quote
Old 09-12-2008, 10:01 AM   #3
nfeldberg
Member
 
Join Date: Jul 2008
Posts: 67
Thanks: 0
Thanked 0 times in 0 posts
Default

OK will do.

could you please quickly explain what does the: execution.Order.Filled number will include in each case?

what other impact this property have on the strategy management?

I have 2 entries, if I will use the by strategy position how will i know how much was filled for each entry?

if I leave my strategy as is (use to work all right before) I now have 1 set of exit orders that think I got the full position (double than the amount I actually need) and the second set of exit orders that have the right size (half of the position).

hope you understand me. if you can refer me to sample or extra info on this topic it would be great,

thx
Nir
nfeldberg is offline  
Reply With Quote
Old 09-12-2008, 10:15 AM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

execution.Order.Filled will return the amount filled on the IOrder and NOT the amount filled in this particular execution.

execution.Order.Filled will tell you the amount filled for that order. You can keep track of the amount filled manually.

I do not know what you mean. Are you trying to have 2 sets of Exits for 1 entry? This is not advisable. If you want to scale out you need to scale in with 2 entries.

If you essentially want the same entry. Submit an entry1 and an entry2 at the same time. Then for your exits scale out with half the protective orders assigned to entry1 and the other half to entry2.
NinjaTrader_Josh is offline  
Reply With Quote
Old 09-12-2008, 10:23 AM   #5
nfeldberg
Member
 
Join Date: Jul 2008
Posts: 67
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Josh,

this is what I am doing.

however following your sample code onorderupdate() for both entries and when the property is ByStrategyPosition for reason that I am not sure I am getting on one set of exit (target and stop related to entry 1) the full position quantities instead of only half and on the second set of exit (target and stop related to entry 2) the approperiate half size.

any ideas why?
when the property is set to PerEntryExecution it is working as expected. (but than the original problem is still there)

thx nir
nfeldberg is offline  
Reply With Quote
Old 09-12-2008, 10:37 AM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Nir,

I will need to test some things. I will get back to you later.
NinjaTrader_Josh is offline  
Reply With Quote
Old 09-15-2008, 03:50 AM   #7
nfeldberg
Member
 
Join Date: Jul 2008
Posts: 67
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Josh,

any news on this topic?

thx
nir
nfeldberg is offline  
Reply With Quote
Old 09-15-2008, 09:06 AM   #8
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Nir,

I am in contact with the development department because there is no easy solution yet.
NinjaTrader_Josh is offline  
Reply With Quote
Old 09-15-2008, 09:18 AM   #9
nfeldberg
Member
 
Join Date: Jul 2008
Posts: 67
Thanks: 0
Thanked 0 times in 0 posts
Default

thx, any estimation for time line? did you manage to reproduce?

do you think there will be advantage if I would use: execution.Quantity instead?

which direction should be followed PerEntryExecution in which case NTshould not cancel the exit orders on partial fills or ByStrategyPosition in which case maybe I need to change my code and use execution.quantity? or you have an internal issue there as well...

any info would be great,

thx Nir
nfeldberg is offline  
Reply With Quote
Old 09-15-2008, 09:27 AM   #10
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Nir,

I do not have any further information. The direction we are investigating is with the PerEntryExecution, but this can easily flop depending on what we find. execution.Quantity may/may not be of use. We just don't know yet. When we determine a suitable solution we will inform the community at that time. Thank you for your patience.
NinjaTrader_Josh is offline  
Reply With Quote
Old 09-30-2008, 07:16 AM   #11
nfeldberg
Member
 
Join Date: Jul 2008
Posts: 67
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Josh,

could you please provide an update to this issue?

Regards,
Nir
nfeldberg is offline  
Reply With Quote
Old 09-30-2008, 07:25 AM   #12
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Hi Nir,

Rest assured this issue has not fallen through the cracks. We are working hard to address this and will release an approach that will not have any holes in it as soon as possible.
NinjaTrader_Josh is offline  
Reply With Quote
Old 06-04-2009, 03:03 AM   #13
murfinp
Senior Member
 
Join Date: Jan 2007
Location: , ,
Posts: 133
Thanks: 1
Thanked 0 times in 0 posts
Default Is this resolved ...

Quote:
Originally Posted by NinjaTrader_Josh View Post
Hi Nir,

Rest assured this issue has not fallen through the cracks. We are working hard to address this and will release an approach that will not have any holes in it as soon as possible.
hi ninja ...

Is this resolved ... if I am using setProfitTarget and setStopLoss and I get partial fills can I be sure that the original order, stop and target are managed as they should be?

thanks
murfinp is offline  
Reply With Quote
Old 06-04-2009, 04:52 AM   #14
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 977 times in 960 posts
Default

Paul, which order handling setting are you using?
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 06-04-2009, 05:08 AM   #15
murfinp
Senior Member
 
Join Date: Jan 2007
Location: , ,
Posts: 133
Thanks: 1
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Bertrand View Post
Paul, which order handling setting are you using?
Sorry Bertrand I don't undertand ...

I am using SetProfitTarget to set the target and SetStopLoss to set the stop loss and I am sending orders with

// set stop for all orders

SetStopLoss(CalculationMode.Price,stopLossPrice);

// set target for this order

SetProfitTarget(entrySignal,CalculationMode.Ticks, targetTicks);

// send order

EnterLong(0,noLots,entrySignal);
EnterLongLimit(0,true,noLots,entryPrice,entrySigna l);
EnterShort(0,noLots,entrySignal);
EnterShortLimit(0,true,noLots,entryPrice,entrySign al);
murfinp 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
Strange Market Order Partial Fill Exit Behavior mrlogik Strategy Development 1 08-29-2008 10:47 PM
Simulate Partial fill ... with ease. ltemme Automated Trading 4 08-16-2008 10:04 AM
Partial Fills Harry ATM Strategies (Discretionary Trading) 5 02-26-2008 06:25 AM
ATM cancels entry after partial fill Futures_Shark ATM Strategies (Discretionary Trading) 4 09-06-2007 04:47 PM
How to complete entry on a partial fill in V5? Merv Miscellaneous Support 3 12-30-2005 06:24 AM


All times are GMT -6. The time now is 09:23 AM.