Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to create a false condition in builder
Collapse
X
-
Hello aalonzo17,
Thank you for your post and welcome to the NinjaTrader forum community!
This could be done using a bool variable that changes between true or false depending on whether you want to allow a long entry or not. I'm not sure which values you are referencing when you mention "high 52 < high 45 and high 18 < high 12" - please clarify what the numbers represent. Are those the number of bars ago that you are checking the High price for or are they perhaps indicator periods?
Once I have more information from you, I would be glad to provide some screenshots as an example of how you could toggle a bool based on your desired condition.
I look forward to your reply.
-
Thanks for clarifying!Originally posted by aalonzo17 View PostHi Emily! Thanks for the fast response. Right, the numbers I'm referring to represent bars ago.
First, you would need to set up the bool on the Inputs and Variables screen. Here I have set up a bool called AllowLong that defaults to be true:Next, you would need to configure your condition that sets the bool to false. Here are some screenshots of a set where I set up the condition as you have described and configured the action to set AllowLong to be false:You would also need a set that checks for conditions when you want AllowLong to be set to true again. I have created a set with the opposite; it checks if the High from 52 barsAgo is greater than the High from 45 barsAgo AND if the High from 18 barsAgo is greater than the High from 12 barsAgo. If so, it sets AllowLong to true:Finally, you need your set that enters a long condition. In this case, I have a condition that simply checks if the position is flat and if AllowLong is true. If so, the action is to enter a long position via market order:For additional resources related to the Strategy Builder, including a webinar on our YouTube channel and some examples of common conditions and actions, please see the links below:Please feel free to reach out with any additional questions or concerns.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
54 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
72 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
49 views
0 likes
|
Last Post
|

Comment