If set 1 = true, wait until set 2 = true then place a trade
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Set 1 + Set 2 = Trade
Collapse
X
-
Hello Uregon,
Thanks for your note.
You could consider creating two bool variables (initially set to false) in the Inputs and Variables screen of the Strategy Builder.
In the Conditions and Actions screen of the Strategy Builder, you would create a condition in Set 1 and set the first bool to true. You would create a condition is Set 2 and set the second bool to true. Then, in Set 3 you would create a condition that checks if the two bool variables are true and call your Entry order method.
By doing so, the Entry order method would only be called once both variables evaluate to true.
For example, see below.
Code://Set 1 if (<condition 1>) { bool1 = true; } //Set 2 if (<condition 2>) { bool2 = true; } //Set 3 if (bool1 == true && bool2 == true) { //do something }
Builder Screens: https://ninjatrader.com/support/help...er_screens.htm
Conditions: https://ninjatrader.com/support/help...on_builder.htm
Actions: https://ninjatrader.com/support/help...t8/actions.htm
Let me know if I may assist further.Last edited by NinjaTrader_BrandonH; 07-08-2022, 08:05 AM.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
-
NinjaTrader_BrandonH
Thank you.
I did it like you explained, but then it seems it is true all the time and place orders every new price movement.
Comment
-
The bools will remain true until you reset them to false.
The conditions in set one and two will only set the bool to true when the condition is true however when the condition is false the bool is not set false.
You have to reset the bools to false, after the action in set 3.
Once set to false then set one and two can then change the bools to true when the conditions are once again true.
Comment
-
-
Hello Uregon,
Thanks for your note.
Tasker-182 is correct. The bools will remain true in your strategy unless you set it to false.
Something you could consider is flipping the bools to false in the same Set as your entry order method, after the entry method call. This way they bool will be set to false after your entry method is called to enter a position.
For example, see the attached screenshot.
Let me know if I may assist further.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
-
NinjaTrader_BrandonH
Hi Brandon, yes I´ve set it like this and it works.
Now I only have to make the right order settings.
Bool1 is the first and after it Bool2 should be triggered
So its not possible that Bool2 is true + Bool1 is true and enter a trade.
I´d like to enter a trade only if after Bool1 a Bool2 is coming.
As example:
Bool2 = true
Bool 1= true
no trade
Bool1 = true
Bool2 = true
trade
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by BeachTrader11807, Today, 01:14 PM
|
3 responses
20 views
0 likes
|
Last Post
|
||
Started by futureszone, Today, 06:09 PM
|
0 responses
3 views
0 likes
|
Last Post
![]()
by futureszone
Today, 06:09 PM
|
||
Started by futureszone, 02-07-2025, 02:48 AM
|
2 responses
21 views
0 likes
|
Last Post
![]()
by futureszone
Today, 06:05 PM
|
||
Started by cutzpr, Today, 05:24 PM
|
0 responses
5 views
0 likes
|
Last Post
![]()
by cutzpr
Today, 05:24 PM
|
||
Ola
by Ezequiel40
Started by Ezequiel40, Today, 05:23 PM
|
0 responses
7 views
0 likes
|
Last Post
![]()
by Ezequiel40
Today, 05:23 PM
|
Comment