I'm looking to run one of my strategies between Midnight and 10:00 AM, shut down, then run again after 5:00 PM. I'm struggling with the paramaters for this because there is no "or" option in the conditions and every time I try to set up groups, it only seems to recognize one set of instructions. Is there an easy way to do this in strategy builder?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Prevent Strategy from Running During Specific Hours
Collapse
X
-
Prevent Strategy from Running During Specific Hours
Hi there,
I'm looking to run one of my strategies between Midnight and 10:00 AM, shut down, then run again after 5:00 PM. I'm struggling with the paramaters for this because there is no "or" option in the conditions and every time I try to set up groups, it only seems to recognize one set of instructions. Is there an easy way to do this in strategy builder?Tags: None
-
Hello koyunbaba, thanks for your question.
There is an Or (||) option in the builder. On the top left of the set, there is a setting "If all" or "If any" If all acts as the AND and If any acts as the OR. To do this set the main set to "if any" and make two condition groups set to "if all". You would enter the two time constraints into those two groups.
Please let me know if I can assist any further.
-
Thanks for your reply. I guess what I mean is that I'm struggling to combine the AND with the OR. So logically what I'm looking for is this:
IF <Indicator condition> >= X
AND (Current Bar Time of Day > 12:00 AND Current Bar Time of Day < 08:00)
OR (Current Bar Time of Day > 17:00 AND Current Bar Time of Day <=23:59)
The group function allows me to select an If Any operator, but then it doesn't truly filter the time - it only looks to the < or > to determine if the bar meets the criteria, which it always does.
Comment
-
Hi Koyunbaba,
I am not a support representative from Ninja Trader but I would like to help you with your question.
It looks like you are using the Strategy Builder and you want to be able to group conditions. It can be easily achieved, all you have to do is use the button "group" and play with it.
Let's say that you want to build this condition:
If (SMA(14) >= EMA(14) OR (Close > Open AND Time > 9:30 AM))
All you have to do in Conditions and Actions is at the upper left corner select "If Any" -which actually means OR- and configure the first part, which is "SMA(14) >= EMA(14)", then you need to create a grouped condition, so you click the "group" button, between "add" and "edit" buttons at the bottom right corner of Conditions. Here you will choose "If All" -which means AND- and configure the other 2 conditions.
To facilitate your understanding I included a picture that should give you a clue about how to do it, please check it out:
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
62 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
134 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
75 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
45 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
50 views
0 likes
|
Last Post
|

Comment