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 ZeroKuhl, Today, 04:31 PM
|
0 responses
14 views
0 likes
|
Last Post
by ZeroKuhl
Today, 04:31 PM
|
||
Started by Vulgoth_t_Destroyer, 05-09-2022, 04:45 PM
|
54 responses
5,337 views
0 likes
|
Last Post
by Gaterz
Today, 04:29 PM
|
||
Started by ETFVoyageur, 05-07-2024, 07:05 PM
|
11 responses
76 views
0 likes
|
Last Post
by -=Edge=-
Today, 04:27 PM
|
||
Started by _Zero_, 04-10-2020, 03:21 PM
|
145 responses
7,900 views
6 likes
|
Last Post
by johng2
Today, 04:19 PM
|
||
Started by TheTradingMantis, 01-19-2023, 02:05 AM
|
43 responses
923 views
0 likes
|
Last Post
by jmagaia
Today, 04:13 PM
|
Comment