![]() |
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 |
|
Senior Member
Join Date: Jun 2007
Location: Anguilla
Posts: 140
Thanks: 0
Thanked 0 times in 0 posts
|
If I am long a contract, and a new signal is generated by my strategy to go short, what is the correct way to go short.
Currently I use the following ExitLong() EnterShort() However I believe this may be incorrect, as, I ended up Short 2 contracts, instead of one. In both the simulated strategy, and my live account strategy. |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
All you need to call is:
EnterShort() this will take care of closing the long and opening the short.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Aug 2008
Posts: 1
Thanks: 0
Thanked 0 times in 0 posts
|
Hello,
I would like to ask if anyone knows how to solve the problem with reversin position in case stop loss is used and I need to enter via EnterStopLimit(). My short position is closed by stop loss (correctly), but command to enter long position in the same bar is ignored (EnterLongStopLimit). I am sure that strategy coding is correct as when I use only long part, it generates correct entry signals. Thank you for any idea how to solve it. |
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Please run with TraceOrders = true. I suspect you may be running into one of these Internal Order Handling Rules. Please check them out here and confirm with your logs if this is the case: http://www.ninjatrader-support.com/H...verview36.html. If not please provide the reason the TraceOrder logs provide as to why your order is ignored. Thanks
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Entershortstop not reversing long position and vice versa | verge | Strategy Development | 1 | 05-02-2008 07:42 AM |
| Re: Strategy Position vs. Account Position | Pete S | Strategy Development | 1 | 11-14-2007 08:55 AM |
| Strategy Position vs. Account Position | NinjaTrader_Josh | Tips | 0 | 11-12-2007 06:06 PM |
| Reversing Position | shellers | Automated Trading | 3 | 01-19-2006 05:45 AM |
| Reversing a Position on Breakout or Breakdown | Alfred | ATM Strategies (Discretionary Trading) | 1 | 05-10-2005 03:02 AM |