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 06-14-2011, 08:25 AM   #1
zweistein
Senior Member
 
Join Date: Jan 2009
Posts: 584
Thanks: 2
Thanked 21 times in 12 posts
Default Partial Exit SetStopLoss bug?

Hello ,

managed order handling

I have the following scenario :

Entry in position with 2 lots.

SetStopLoss(entrysignalname,CalculationMode.Price, stopprice,false);
EnterLongLimit(BarsInProgress,true,2,entrylimit,en trysignalname);

....

Later I do a partial exit with:

ExitLong(1,"partial exit",entrysignalname);

at this point my strategy has only 1 lot.

...
Later when the Stop loss is hit, the stop loss order still executes 2 lots.

This is wrong as the strategy contains only 1 lot.

Questions:
1. How can I amend the Stop loss order to reflect the partial exit (hence I need 1 lot stop loss)

2. What is the procedure to ensure that the stop loss order reflects the proper quantity?

best regards

Andreas
www.zweisteintrading.eu
zweistein is offline  
Reply With Quote
Old 06-14-2011, 08:46 AM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hi Andreas,

This is how it will work with a managed order system. If you want to scale out, you must first scale in with separate entry names. Then pair the exits with a specific entry signal name. Any other approach can lead to quantity mismatch.

An alternative to this is to use the unmanaged approach, which allows you to submit, and change orders exactly how you want, but without any built in position management.
http://www.ninjatrader.com/support/h...d_approach.htm
NinjaTrader_RyanM is offline  
Reply With Quote
Old 06-14-2011, 08:53 AM   #3
zweistein
Senior Member
 
Join Date: Jan 2009
Posts: 584
Thanks: 2
Thanked 21 times in 12 posts
Default

OK,

I expected something better from NinjaTrader

By the way, why do you have the quantity parameter in the managed Exit??? functions.

You do not need it and it will only create confusion.


regards
Andreas
zweistein is offline  
Reply With Quote
Old 06-14-2011, 09:11 AM   #4
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Quantity is available there if you want to use it. We don't want to introduce more restrictions in those exit overloads.

The unmanaged approach is designed exactly for situations like this. If you do not like Ninja's built in position and order management, you can create your own with an unmanaged strategy.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 06-14-2011, 09:37 AM   #5
zweistein
Senior Member
 
Join Date: Jan 2009
Posts: 584
Thanks: 2
Thanked 21 times in 12 posts
Default

It is not for me, for my own codebase I do use unmanaged frequently.

It is a tiny project for a customer and I just find out now that what he wants is not do-able with the managed code. In the timeframe given there is no way I will start using unmanaged order handling.
I have read your documentation, but not having this basic feature just escaped my view . I read some comments from earlier posts (beta NT7), and it seemed a bug that ninja was going to fix.

regards
zweistein is offline  
Reply With Quote
Old 06-14-2011, 09:50 AM   #6
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Thanks for the comments, Andreas. At this time, there will be no change to the exit overloads that disallow quantity.
NinjaTrader_RyanM 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
Partial Exit - named signal exit stop not updated MicroTrends Strategy Development 5 02-08-2011 10:17 AM
Partial Exit signal mix.net Strategy Development 18 07-16-2010 01:08 PM
Partial Exit Not Working Prospectus Strategy Development 3 10-08-2009 07:11 AM
Partial fill on exit astrolobe Strategy Development 11 09-03-2009 07:48 AM
New scale-out exit being ignored after a partial, then complete fill on previous exit vjsworld Strategy Development 11 05-18-2009 12:59 PM


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