![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: May 2008
Posts: 12
Thanks: 0
Thanked 0 times in 0 posts
|
I have programmed a strategy with the wizard that goes long (EnterLong) when the price crosses over a simple average, and reverse to short (EnterShort) when the price crosses below.
If the strategy is long and the price crosses below the average, then Ninja sends two orders, one to close long and another to open a short position. Is there any way to make Ninja send only one order to reserve? I mean sending one order selling two contracts in stead of two orders selling one. Thank you very much. |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
You likely closed the position by an explicit exit order which you should not do. Just issue the entry order for the opposite side and NT will close the current position. See also SampleMACrossOver strategy which does exactly what you are looking for.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: May 2008
Posts: 12
Thanks: 0
Thanked 0 times in 0 posts
|
No, the strategy works correctly. The only problem I have is the way to do the reversal.
I have the same problem with the SampleMACrossOver strategy. For example, if the strategy is one contract long and the fast SMA crosses below the slow, then the strategy reverses to short, so Ninja sends two orders: sell one contract to close long position, and sell one contract to open short position. I would prefer that Ninja sent only one order: sell two contracts to reverse. żIs there any way to do it? |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
>> żIs there any way to do it?
Unfortunately not.
Dierk
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Coding a reverse order w/ only enough margin for 2 contracts | insomniac | Strategy Development | 8 | 04-08-2008 06:59 AM |
| need to reverse position in NinjaScript strategy | jammy page | General Programming | 6 | 11-06-2007 07:31 AM |
| Easy questions - superdom single-click entry, Reverse limit order | Steveinvest | Miscellaneous Support | 6 | 05-16-2007 06:58 AM |
| Reverse Strategy / Position | Torso | Automated Trading | 2 | 02-17-2006 04:21 AM |
| 2 order but can you add 2 position strategies? | underground | Automated Trading | 2 | 04-28-2005 05:47 PM |