Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple conditions within Strategy Wizard

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

    Multiple conditions within Strategy Wizard

    Hi,

    I am a new user and just starting to familiarise myself with NT tools (which look excellent so far).

    I have some basic VBA skills which I am quickly trying to adapt to the C# environment for Ninjascript, but would ideally like to do as much as possible via the wizards.

    Via the Strategy Wizard I would like to set up a series of conditions that look at the relative price locations of successive price bars, eg "If current bar close > prior bar high; AND If prior bar low < low of the bar 2 bars ago..." and so on.

    Is it possible within the wizard to set up such a series of conditions and then have the resulting action only occur if all conditions are true?
    Within the wizard it looks like each resultant action occurs if only that particular single condition is true, and is not possible to require all conditions be true.

    Many thanks for any pointers on how I would go about setting up such a strategy for BT purposes.

    #2
    Pourleau, welcome to the forums and thanks for the kind words - you can enter multiple conditions in one Set, those will be linked then via the logical AND.



    You can view the underlying generated code at any time by pressing the 'View Code' button (great syntax learning aid).

    As you progress in complexity user variables would also be helpful -

    BertrandNinjaTrader Customer Service

    Comment


      #3
      Great - thanks, Bertrand.
      That saves me a lot of time.

      Great service too.

      Comment


        #4
        By the way - within the Strategy Wizard, is it possible within a Set of conditions to use an OR statement (||)?
        So a condition is true, for example, if:
        Close[0] > Open[1] OR Close[0] > Open[2] ?

        Or would you have to repeat the second condition in a different Set?
        thanks

        Comment


          #5
          It would need a different set then, all you place in one Set together are 'linked' via the logical AND (&&).
          BertrandNinjaTrader Customer Service

          Comment


            #6
            If and or ....

            Originally posted by NinjaTrader_Bertrand View Post
            It would need a different set then, all you place in one Set together are 'linked' via the logical AND (&&).
            Is there a (shortcut) way for the strategy wizard to generate code that would accept/calculate an action if (example) 5 of 6 conditions are true:
            (english code)
            SMA 20 close (0) > SMA 50 close (0)
            HMA 10 typical (0) > LinRegSFX value (1)
            VWMA 10 typical (0) > LinRegSFX value (1)
            WMA 55 typical (0) > LinRegSFX value (1)
            JMA 50 100 typical (0) > T3 value (1)
            VWMA 20 typical (0) > T3 value (0)

            SO that if any 5 of the above 6 were true a long entry would be generated etc ?? my type of fuzzy logic

            Thanks
            TJ
            Last edited by Trader.Jon; 05-06-2010, 03:52 PM.

            Comment


              #7
              TJ,

              Unfortunately there is no shortcut way to do so. You would need to run a counter for how many of your conditions are true at the exact same time.
              Josh P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by GussJ, 03-04-2020, 03:11 PM
              11 responses
              3,229 views
              0 likes
              Last Post xiinteractive  
              Started by andrewtrades, Today, 04:57 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by chbruno, Today, 04:10 PM
              0 responses
              7 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by josh18955, 03-25-2023, 11:16 AM
              6 responses
              441 views
              0 likes
              Last Post Delerium  
              Started by FAQtrader, Today, 03:35 PM
              0 responses
              12 views
              0 likes
              Last Post FAQtrader  
              Working...
              X