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 01-25-2012, 06:52 AM   #1
unter821
Senior Member
 
Join Date: Aug 2010
Posts: 114
Thanks: 3
Thanked 0 times in 0 posts
Default Change PositionSize when using Managed Approach

Hi there,

I have the following general question:

In the unmanaged approach for order methods there exits the method ChangeOrder(), which obviously allows to change certain characistics of an order (Quantity, LimitPrice, StopPrice).

However I am working with the managed approach and would like to change just the quantity of the order. How can this best be done without closing the order and producing a new one?

By the way to change to the unmanaged approach is not really an option for me, would need a lot of changes I assume. Is that correct?

Best, Peter
unter821 is offline  
Reply With Quote
Old 01-25-2012, 07:41 AM   #2
NinjaTrader_PatrickH
NinjaTrader Customer Service
 
NinjaTrader_PatrickH's Avatar
 
Join Date: Jul 2011
Location: Denver, CO, USA
Posts: 1,683
Thanks: 116
Thanked 189 times in 184 posts
Default

Hello unter821,

Thank you for your post.

You are correct, to change the order with the Managed Approach you will need to cancel the order and then resubmit the order.
For a reference on using the CancelOrder() method please visit the following link: http://www.ninjatrader.com/support/f...ad.php?t=18890

The Unmanaged Approach is reserved for experienced programmers, for more information on the Unmanaged Approach please visit the following link: http://www.ninjatrader.com/support/h...d_approach.htm

Please let me know if I may be of further assistance.
Last edited by NinjaTrader_PatrickH; 01-25-2012 at 07:52 AM.
NinjaTrader_PatrickH is offline  
Reply With Quote
Old 01-25-2012, 08:26 AM   #3
unter821
Senior Member
 
Join Date: Aug 2010
Posts: 114
Thanks: 3
Thanked 0 times in 0 posts
Default

Ok, when I understand the concept correct I have to know already at the point of the entry, how I want to scale out later. In your case I EnterLONG 5 pieces two times to be able to scale out later with 5 pieces each. Is that correct?

What can I do under the following scenario:
- I enter a trade with a quantity of 2
- During the trade my vola decreases and I add 1 quantity having a new total quantity of 3
- For some reason my vola goes up dramatically and have to reduce my quantitiy by 2 to a total quantitiy of just 1

Any way to handle that with the managed approach?
unter821 is offline  
Reply With Quote
Old 01-25-2012, 10:13 AM   #4
NinjaTrader_PatrickH
NinjaTrader Customer Service
 
NinjaTrader_PatrickH's Avatar
 
Join Date: Jul 2011
Location: Denver, CO, USA
Posts: 1,683
Thanks: 116
Thanked 189 times in 184 posts
Default

Hello unter821,

Thank you for your response.

With the Managed Approach each entry would need a specific signalName.

So for your first condition you would enter with two separate EnterLong()s:
if (Condition1)
{
EnterLong(1, "Signal1");
EnterLong(1, "Signal2");
}


And then for your second condition you would enter once more with a specifc signalName:
if (Condition2)
{
EnterLong(1, "Signal3");
}


Then once you need to reduce your quanitity by two, you can exit with the singalName:
if (Condition3)
{
ExitLong(1, "Signal1");
ExitLong(1, "Signal2");
}


For a reference on scaling out of a position using the Managed Approach please visit the following link: http://www.ninjatrader.com/support/f...ead.php?t=3751

Please let me know if I may be of further assistance.
NinjaTrader_PatrickH 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
Managed vs Unmanaged approach Merlin997 Automated Trading 1 10-18-2011 09:48 AM
OCO possible with Managed approach? motownlucas Automated Trading 1 06-20-2011 10:01 AM
Cancel Order Using Managed Approach Baseheadz Strategy Development 18 06-14-2011 02:24 PM
Under the managed approach, how can i change kaywai Strategy Development 2 05-23-2011 01:11 AM
Managed Approach Orders question ScottB Automated Trading 9 07-30-2010 02:19 PM


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