Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
How can I make day of week boolean value on strategy Builder?
Collapse
X
-
Hello rickyblah12,
Thank you for the additional detail.
Unfortunately, this would not help me to better understand what is happening with your last question.
everything works fine the only problem is when only one box is checked the others will still take trades on those days
..how do i fix this
Please let me know if I may be of further assistance.
Leave a comment:
-
the strategy is just a simple sma crossover strategy...n trade whatever days I select only
Leave a comment:
-
Hello rickyblah12,
Thank you for your reply.
I wanted to clarify, are you trying to make a day selection which will allow only 1 day of the week to trade or just make it so only what is selected is traded I.E. 2 or 3 days a week? The images seem to be cut off in the middle so they would not specifically help in this context, additionally, we would need to see the rest of the conditions you made to know how this should be working overall. For this question, it would likely be helpful if you can upload the whole script so we can see all of what you have done so far. Could you attach the strategy for review? https://ninjatrader.com/support/help...tAsSourceFiles
I look forward to being of further assistance.
Leave a comment:
-
This is how the strategy is...I did duplicated each set 2 more times and changed the day wheere it says wedsnday to thrusday and friday..everything works fine the only problem is when only one box is checked the others will still take trades on those days...so for some reason it only works if all 3 of the boxes are checked or 2 out of 3 are checked but when is only one boxed checked it takes trades for the rest of the days...how do i fix this5 Photos
Leave a comment:
-
Hello rickyblah12,
The code you have provided screenshots of is not showing this.
It appears you may be comparing something that is not a DateTime or DayOfWeek object to a DayOfWeek object.
A bool must be compared to a true or a false.
Leave a comment:
-
I was using the Sunday bool as a input to trigger the day of week variable as true or false
Leave a comment:
-
Hello rickyblah12,
Bools are not time objects that can be compared to a DayOfWeek object.
A bool is a true or false value and can only be compared with true or false.
Below is a public link to the Strategy Builder 301 course which details this.
You would need to compare each bool object separately to be either true or false.
if Monday is equal to true and Time > Date series is equal to Time > DayOfWeek > Monday and my other conditions are true then do this action.
If Tuesday is equal to true and Time > Date series is equal to Time > DayOfWeek > Tuesday and my other conditions are true then do this action.
etc..Last edited by NinjaTrader_ChelseaB; 03-18-2019, 02:25 PM.
Leave a comment:
-
not a drop down it would look like this only selected day will make trades on1 Photo
Leave a comment:
-
Hello rickyblah12,
You are wanting to trigger an action if the day selected for an input is not Sunday?
Are you wanting a drop-down with the days of the week? (i.e. a DayOfWeek input selector)
If so, the DayOfWeek public input would need to be custom coded.
Attached is an example that prints 'Not Sunday' if the current bar is not Sunday.Attached Files
Leave a comment:
-
its still not working heres what i got vSunday is just a bool variable and sunday is a input as a bool so i can be able to toggle it on and off....I have 24 sets 4 sets for each trading day just like day only different day and different variable and input4 Photos
Leave a comment:
-
Hello rickyblah12,
In the condition builder select Time > Date series, in the center select 'Not equal', on the right select Time > Day of week.
Leave a comment:
-
how would the code look like if i want something not to be true for example day of week
Leave a comment:
-
Hello rickyblah12,
If you are not trying to create a drop-down with the days of the week, can you clarify what you mean by:
"I want to create a drop down for a variable...any variable not just day"
What do you want in the drop-down?
The strategy builder can trigger when only one group of multiple groups is true if condition groups are added with 'If Any'. However, this would not prevent the condition from triggering if the other groups are also true. Instead, you would need to explicitly code in the condition that certain conditions cannot be true.
Leave a comment:
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by kujista, Today, 06:23 AM
|
4 responses
14 views
0 likes
|
Last Post Today, 09:55 AM | ||
Started by traderqz, Yesterday, 09:06 AM
|
2 responses
16 views
0 likes
|
Last Post
by traderqz
Today, 09:48 AM
|
||
Started by traderqz, Today, 12:06 AM
|
3 responses
6 views
0 likes
|
Last Post Today, 09:41 AM | ||
Started by RideMe, 04-07-2024, 04:54 PM
|
5 responses
28 views
0 likes
|
Last Post Today, 08:48 AM | ||
Started by f.saeidi, Today, 08:13 AM
|
1 response
8 views
0 likes
|
Last Post Today, 08:47 AM |
Leave a comment: