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.JesseNinjaTrader Customer Service
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.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by cummish, Today, 08:43 PM
|
0 responses
3 views
0 likes
|
Last Post
by cummish
Today, 08:43 PM
|
||
Started by Option Whisperer, Today, 07:58 PM
|
4 responses
18 views
0 likes
|
Last Post Today, 08:32 PM | ||
Started by ETFVoyageur, 05-07-2024, 07:05 PM
|
13 responses
84 views
0 likes
|
Last Post
by ETFVoyageur
Today, 08:14 PM
|
||
Started by cupir2, Today, 07:44 PM
|
0 responses
9 views
0 likes
|
Last Post
by cupir2
Today, 07:44 PM
|
||
Started by reynoldsn, Today, 07:23 AM
|
6 responses
19 views
1 like
|
Last Post
by reynoldsn
Today, 07:29 PM
|
Comment