Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
orders problems
Collapse
X
-
Hello,
Thank you for the additional details.
After running the script and looking at the settings you provided I believe i see what is happening.
Because you are generating a unique signal name for each order and you are also using the UniqueEntries in your Order handling this can open up the possibility of opening multiple positions in a direction.
For the script to work as expected you would want to change this from unique to AllEntries. This will prevent the script from submitting another order if you are already in a position.
Can you please try the changes here and let me know if you still are getting the double orders?
I look forward to being of further assistance.
Comment
-
Hello,
I was looking through the script again and had noticed what looks like the cause. I still have not been able to reproduce this on my end but I believe this would be it based on the action the logic is taking.
It looks like there is an exit and a entry happening on the same bar which does not give NinjaTrader enough time to know that this happened to let the second order know the correct position.
In both your OpenShortTrade() and OpenLongTrade() you have the following:
Code:if (IsShort) ExitShort(); else if (IsLong) return;
Followed by a
Code:_order = this.EnterLong(_contracts, _signal);
which would be an exit followed by an entry in the same bar. Instead of using the ExitShort here you would want to use EnterLong as it will exit your short position automatically.
essentially this logic is saying to buy 1 to exit and then buy 1 to exit and then buy 1 to enter a long position.
The same would go for the opposite direction.
Please try removing the exits and replacing them with your entry in the opposite direction.
I look forward to being of further assistance.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
52 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
130 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
70 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
44 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
48 views
0 likes
|
Last Post
|

Comment