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 04-27-2011, 07:57 AM   #1
sagoga69
Junior Member
 
Join Date: Apr 2011
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default Problem with NT restrictions

Hello everybody,

I'm translating into Ninja Trader 7 a strategy that I used to run on MultiCharts, but I have a problem with NT order restrictions.

Specifically, my problem is that when the strategy opens a position (for example a long one) it generates the following orders (in this order):
- An enterShortStop order to reverse the position
- An exitLongLimit to close de current position (stopProfit)

This works fine in Multicharts, but it seems that it doesn't in NT since I can't send a Profit Order to exit a position when there is active another order to open positions in the opposite direction. The Help Guide says: "Methods that generate orders to exit a position will be ignored if: A position is open and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction"

Knowing this, I thought that a good solution would be to change the enterShortStop order to a exitLongStop and use the method OnExecute to throw the enterShortStop when the exitLongStop is executed, but the problem is that (on backtesting at least), the event OnExecute is only triggered at the end of the current bar, so it throws the order (the enterShortStop) in the next bar, and I need the strategy to throw it exactly at the same time that the execution of the exitLongStop.

Is there any posibility to do this? How?

Thanks in advance. Regards.
sagoga69 is offline  
Reply With Quote
Old 04-27-2011, 08:14 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

Hello sagoga69,

Welcome to the NinjaTrader forums!

The internal order handling rules you're running into are part of the managed order system, so you may consider moving to an unmanaged one. An unmanaged strategy has none of the internal rules or order management. The only three methods you use are SubmitOrder(), ChangeOrder(), and CancelOrder(). Your stop order would be submitted at one half the quantity of your limit order, which you plan to use as reversal.


Additional info on unmanaged NinjaScript strategies is available here:
http://www.ninjatrader.com/support/h...d_approach.htm
NinjaTrader_RyanM is offline  
Reply With Quote
Old 04-28-2011, 04:18 AM   #3
sagoga69
Junior Member
 
Join Date: Apr 2011
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks for your welcome Ryan and for your quick answer,

Your suggestions help me a lot, but I have several problems with the unmaged approach. Since they are about another matter, I'm going to post a new thread.

Thanks again.
sagoga69 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
Loading NT problem Harry Version 7 Beta General Questions & Bug Reports 3 05-25-2010 03:28 PM
NT 7 problem with connection coffeedan Connecting 1 05-22-2010 10:10 AM
Problem NT Forsouls Version 7 Beta General Questions & Bug Reports 1 04-19-2010 06:48 AM
I love NT but I have a problem auto9817 Installation and Licensing 6 02-22-2009 11:03 AM
NT problem lindsayf Miscellaneous Support 15 01-17-2009 01:19 PM


All times are GMT -6. The time now is 12:14 PM.