• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How can I make day of week boolean value on strategy Builder?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    How can I make day of week boolean value on strategy Builder?

    Edit: nevermind I coded it
    Last edited by rickyblah12; 03-17-2019, 10:08 PM.

    #2
    Hello rickyblah12,

    A bool would be a true or a false value.

    Are you wanting a true or false or are you wanting a drop-down that lets you select a day of the week?

    I would recommend you create a DayOfWeek object instead as the input.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I want to create a drop down for a variable...any variable not just day
      Last edited by rickyblah12; 03-17-2019, 11:43 PM.

      Comment


        #4
        How do i make a condition on the strategy builder that will only fire if one condition in a group is true and not the others in that same group

        Comment


          #5
          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.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            how would the code look like if i want something not to be true for example day of week

            Comment


              #7
              Hello rickyblah12,

              In the condition builder select Time > Date series, in the center select 'Not equal', on the right select Time > Day of week.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                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 input

                Comment


                  #9
                  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
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    not a drop down it would look like this only selected day will make trades on

                    Comment


                      #11
                      what do u think its wrong

                      Comment


                        #12
                        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.
                        https://youtu.be/HCyt90GAs9k

                        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.
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          I was using the Sunday bool as a input to trigger the day of week variable as true or false

                          Comment


                            #14
                            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.
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #15
                              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 this

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by rickyblah12, Today, 08:17 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post rickyblah12  
                              Started by mrlucky1x, Today, 08:07 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post mrlucky1x  
                              Started by uday12, Today, 07:21 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post uday12
                              by uday12
                               
                              Started by voltlon, Today, 05:18 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post voltlon
                              by voltlon
                               
                              Started by Bobisam, Today, 04:57 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post Bobisam
                              by Bobisam
                               
                              Working...
                              X