The strategy is different, not a Stop and Reverse. It has exits that are different than the opposite entry direction. Could it be that this occurs when the exit (to close a position) and the entry (to open a position in the opposite direction) happen to occur on the same bar?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Strategy order with name "Close Position"
Collapse
X
-
I did walk-forward testing (on 4-9-10) again using a strategy created in the strategy wizard. I still got an erroneous "Close position" order submitted that ended up doubling and tripling my position in the wrong direction.
The strategy is different, not a Stop and Reverse. It has exits that are different than the opposite entry direction. Could it be that this occurs when the exit (to close a position) and the entry (to open a position in the opposite direction) happen to occur on the same bar?
-
NTWolfe, this could happen if you issue duplicative orders - you would likely need to analyze what you do / issue with our TraceOrders feature -
If you like you can also send a strategy exhibiting this to support at ninjatrader and my Attn and I will take a look here on my Market Replay.
Thanks
Comment
-
It happened again today, could the strategy wizard be flawed when it creates a strategy. I don't think it is as I have unlocked the code created by the strategy wizard and there is nothing that is labelled "close positon" within the code, maybe it is the platform itself or the bar type, I don't know.
What is the actual e-mail address I should send a copy of the strategy to?
Once I add the TraceOrders code what do I do with the information it generates?
One other thing:
Under the options category in strategies there is a button for "On starting a real-time strategy" that gives the option to either "Wait until flat before executing live" or "Immediately submit live working historical orders". I use market orders and have the Immediately submit live working historical orders button checked. Could this be the reason for getting the extra "close position" order submitted along with my predefined exit order.Last edited by NTWolfe; 04-14-2010, 08:35 PM.
Comment
-
NTWolfe, you can contact me at support at ninjatrader dot com Attn Bertrand.
Close Position is needed to reverse, for example when you short 1 contract to go net long 1 contract you need to buy 2, one to close the open short, the second to get you long then.
Are you 100% sure you're synced up properly as you start trading it?
Yes, if you select the 'Immediately Submit' option and do not take care to sync, the issue could easily show up, have you tried to WaitUntilFlat to then the next freshly generated entry from the strategy?
TraceOrders info can be found here -
Trace
Comment
-
This seems to have corrected the situation, today on live data I did not recieve the extra order "close position"
For any others that may have the same issue:
Under the options category in strategies there is a button for "On starting a real-time strategy" that gives the option to either "Wait until flat before executing live" or "Immediately submit live working historical orders". I use market orders and have the Immediately submit live working historical orders button checked. Switching it to "Wait until flat before executing live" seems to have stopped it on today's run through.
Thank you for your patience Bertrand.
Comment
-
I allowed the strategy to run on live data today and got some pretty bizarre behavior (see attached photo), anyone ever seen anything like this?
On this it still generated the infamous "close position" order and the sim 101 account was in sync (flat) before the strategy began to generate orders. This order still doubled the position in the wrong direction.
One more question. I ran the same strategy on 4 different symbols. Two of these symbols submitted these erratic orders as seen on the photo, the other two submitted no orders at all. Does Ninjatrader only allow a certain number of symbols to be strategy-tested at the same time.?
Comment
-
In reference to the two charts that had a strategy running but did not generate trades.
CL is one and SI is the other. Orders created in the stategy wizard are Market Orders (Enter Long or Enter Short).
However I noticed that even when trying to enter a market order manually it does not get filled. In Control Center under the Orders Tab in the column listed "State" it just continues to say "Working".
I am using the Sim101 account and a live data feed via Barchart.com.
Comment
-
Close Position
I am using NT 6.5 with a Zen-Fire data feed (real-time data). The strategy was created in Strategy Wizard, I am not a programmer. For the last 2 days I have allowed my strategy to run on about 5 different symbols. I am using Range charts. The Sim 101 account, and positions, are flat before starting the strategies (in sync). The orders are market orders.
This order with the name "Close Position" continues to get submitted at some point in the day which ends up doubling or tripling my position on successive entries.
This is what occurs: (Order Action, # contracts, Name of order)
1. Sell- it is a short Entry order 1 contract and the name is what I have created in my strategy "SE"
2. Buy- the next order submitted is a short Exit order for 1 contract and the name is "Close Position" (instead of "SX" which is the order that should be submitted according to the strategy.
At this point I am Flat as I should be position-wise. Next:
3. Buy- a long Entry order for 1 contract and the name is what I have created "LE"
4. Sell- an exit order for 1 contract and the name is what I have created in my strategy "LX"
5. Sell- a short Entry order for 1 contract and it is the "Close Positon" order (this is not part of my strategy)
6. Sell- another short Entry order, the correct one, for 1 contract at the same price as the previous order and it is what I have created in my strategy "SE"
At this point now I am short 2 contracts and this continues to happen throughout the day.
It is not part of my strategy, I simply have Long Entry/Exit and Short Entry/Exit orders.
I am at a loss as to why this happens.
Comment
-
Here is the code
To keep it simple I only used the Donchian Short and Quantity variables when running the strategy with real-time data, the other variables are not used.
I saved it as an MS Word document and added it to a zip file.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
656 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
371 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
579 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment