Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ANDing and ORing conditionals in using the Wizard

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

    ANDing and ORing conditionals in using the Wizard

    I’m trying to master the Strategy Analyzer in using the Wizard and would like to expand its capability for me.

    Could someone tell me if I am correct that clicking on a Set 1 tab followed by clicking on the ADD button will ‘AND' each of the ‘If x…’, ‘If y…’ conditionals (if that is the correct term) to each other each time the ADD button is clicked for that set of actions chosen.
    and
    Would clicking on the Set 2 tab and the ADD button ‘AND’ the conditionals of the Set 2 tab to those of the Set 1 tab?

    Those questions were used to be sure that I correctly understand the logic of how this Wizard was functioning.

    Thinking that I understood that logic what I am actually trying to find out is the following:
    Is it possible, using the Wizard to;’OR’ conditionals to each other? 'If x…' OR 'If y…'then the Action?
    or
    Must I produce the code necessary for the ‘OR’ing of 2 or more conditionals by first, possibly, setting up the automatic coding produced by the Wizard for ‘AND'ing 2 or more conditionals and then editing that code so that I replace the ‘&&’ by ‘||’ in that code?

    I’m sure that there is a more elegant way of phrasing the information I want so excuse this awkward wording.

    #2
    Hello rsuess1,

    Welcome to the NinjaTrader forums!

    Yes, conditions within a set are joined by and (&&). This requires all conditions evaluate to true before executing the actions for that set.

    Sets are independent - Conditions defined in set 2 do not require that set 1 conditions are true before executing those actions.

    Because of this, yes, you can set it up so that actions are executed if set 1 OR set 2 conditions. Actions would be the same for set 1 and 2 but the conditions for entry can vary.

    There may be minor differences (compared to joining both conditions with ||) if both conditions evaluate to true, but it depends on the type of actions defined - whether you would notice this.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thank you, NinjaTrader_RyanM

      I might have misunderstood your answer because I'm unfamiliar with NT programming but:
      I don't believe that my question about whether the Wizard (at that level) is actually able to 'OR' 2 conditions or does that possibly actually require just producing code from the Wizard - which would 'AND' 2 conditions (in the code by using '&&' ) and then manually editing the code generated by the Wizard to replace the '&&' with the '||' to convert the 2 conditionals to the relationship I wanted - the 'OR' relationship? Or, are there other ways to do this type of thing?

      I'll save my other questions about your original response to keep this uncluttered

      Comment


        #4
        Actions for each set can execute independent from other sets. If set 2 actions evaluate to true, it does not also require set 1 actions to be true.

        This is not exactly the same as joining conditions with ||, but in most cases will produce the same result. It really depends on the actions and conditions defined.

        If you're looking to join conditions with || operator specifically then, yes, you will have to work with code for this. Your approach seems a good way to go - you would end up swapping && for ||.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Sorry to belabor this but now if I am not misunderstanding, it seems to me that you are saying that, in order to get the conditions in Set1 to 'OR' with the conditions or Set2 that only one of the sets has to be true. But isn't that just what I was trying to clarify: am I correct that since I am asking about trying to set up conditions that when EITHER set1 or OR set2 are true, the actions will be carried out?

          And to paraphrase that it seems to me that in order to get the multiple conditions in a single Set to 'OR' requires changing the code using '||' but that to 'OR' the conditions in separate sets (Set 1 and Set2) that 'OR' is the natural relationship between the conditions in different sets: it that correct? Or is that going too far?

          Comment


            #6
            rsuess1, conditions setup in the individual Set's are using the logical AND (&& codewise), if you look for an OR just setup the conditions in different sets, those are independent in evaluation if not connected for example through the use of user variables -

            Comment


              #7
              Thank you for your answers. I'd like to ask this question not related to this thread since I've looked in the FAQ and can't find out if there is any specific way to close a thread if one is needed. Please clarify.

              Comment


                #8
                Hi Rsuess1,

                There's not really a way to close the thread. These forums are driven by our users so threads are only closed when you stop participating.

                Let us know if you'd like additional clarification here, and we're glad to assist.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  No, thank you. I just didn't want to be rude. But this does bring up the question whether, for example, if I should think of something I want to ask in this thread in about 4 months (to give an extreme example), can it still be asked? Or would that just be ignored?
                  Last edited by rsuess1; 08-20-2010, 11:27 AM.

                  Comment


                    #10
                    Thanks for your courtesy here - we appreciate it!

                    Yes, of course. There's no expiration on threads here, so if you want to revisit down the line we will still have a response for you.
                    Ryan M.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by NullPointStrategies, Today, 05:17 AM
                    0 responses
                    20 views
                    0 likes
                    Last Post NullPointStrategies  
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    119 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    63 views
                    0 likes
                    Last Post NabilKhattabi  
                    Started by Deep42, 03-06-2026, 12:28 AM
                    0 responses
                    41 views
                    0 likes
                    Last Post Deep42
                    by Deep42
                     
                    Started by TheRealMorford, 03-05-2026, 06:15 PM
                    0 responses
                    45 views
                    0 likes
                    Last Post TheRealMorford  
                    Working...
                    X