Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Please assist with using srategy wizard

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

    Please assist with using srategy wizard

    I am trying to figure out how to create a condition in strategy wizard:

    1. If rule 1 is true then go long but if rule 2 is true then do nothing.

    How would I do this?

    Thank you

    #2
    Hello relogical,

    In the Conditions and Actions window you can create conditions that if true that they can do an action. For example in the Set 1 tab we can say that if the Close[0] of the current bar is greater than the Close[1] of the previous bar to go long. See attached image Set1.

    If you want a separate condition to go short you can use the Set 2 tab to create a separate list of conditions and actions. For example in the Set 2 tab we can say that if the Close[0] of the current bar is less than the Close[1] of the previous bar to go short. See attached image Set2.

    Here is a link to our help guide that goes over the Condition Builder in the Strategy Wizard.
    http://www.ninjatrader.com/support/h...on_builder.htm

    We do have a YouTube video that goes over the Strategy Wizard that you may view at the following link.
    http://www.youtube.com/watch?v=fVFqw...ure=plpp_video

    Please let me know if I can be of further assistance.
    Attached Files
    JCNinjaTrader Customer Service

    Comment


      #3
      Thank you for your assistance but this is not what I am trying to accomplish. I am trying to go long when one indicator tells me to do so but if another indicators tells me not then do nothing and wait for next rule.

      Comment


        #4
        Originally posted by relogical View Post
        I am trying to figure out how to create a condition in strategy wizard:

        1. If rule 1 is true then go long but if rule 2 is true then do nothing.

        How would I do this?

        Thank you
        You will need an if ... else branch. You will have to unlock the code to add the else construct; the Strategy Wizard cannot natively do if ... else constructs.

        Comment


          #5
          Hello,

          You could still do this with the strategy analyzer. What you would do is in set one check the value of the indicator A is in a range you want to trade, then in the Do The Following: sections Set a variable = 1 for example. 1 for true and 0 for false for flags that we then will check in another set to see if both confitions are true.

          Set 1 would check indicator A and set indicator to 1
          Set 2 would check indicator A and set variable to 0 if its not ready to trade
          Set 3 would check indicator B and set variable to 1
          Set 4 would check indicator B and set variable to 0 if its not ready to trade

          Finally

          Set 5 would check that Variable0 and Variable1 are both set to 1, if they are then enter the trade if not then wait.

          -Brett

          Comment


            #6
            Originally posted by NinjaTrader_Brett View Post
            Hello,

            You could still do this with the strategy analyzer. What you would do is in set one check the value of the indicator A is in a range you want to trade, then in the Do The Following: sections Set a variable = 1 for example. 1 for true and 0 for false for flags that we then will check in another set to see if both confitions are true.

            Set 1 would check indicator A and set indicator to 1
            Set 2 would check indicator A and set variable to 0 if its not ready to trade
            Set 3 would check indicator B and set variable to 1
            Set 4 would check indicator B and set variable to 0 if its not ready to trade

            Finally

            Set 5 would check that Variable0 and Variable1 are both set to 1, if they are then enter the trade if not then wait.

            -Brett
            That sounds more like Assembler than C# !

            Comment


              #7
              Actually the solution is much easier since the Rule is just a conditional statement. What's needed is for Rule 2 to be made as an Override.

              Since Conditions and Actions wizard only applies 'AND' logic to each rule, all rules must be TRUE for Actions to be triggered.

              All that's needed is for relogical's Rule 2 conditional statement to always be TRUE unless the condition is such that the Action be Overriden. For Rule 2 currently defined as A > B, the revised condition would be A < B, or more precisely, A <= B.

              Comment


                #8
                Thank you for your assistance but this is not what I am trying to accomplish. I am trying to go long when one indicator tells me to do so but if another indicators tells me not then do nothing and wait for next rule.
                is this what you're looking for ?
                (To import use File/Utilities/Import Ninjascript)

                Marco
                Attached Files

                Comment


                  #9
                  Thank you for your help but my brain seems to not function today and I am not able to figure out the logic. I am sure it is very simple so I am hoping that you can show or explain to me how to set it up. All I want to do is not trade if ADX is below SMA14 and SMA30. Any other time is ok to trade. Thank you.

                  Comment


                    #10
                    Hello relogical,

                    Please be aware that we do not normally do any NinjaScript development for customers, since it can limit our level of support to our customers. We do have a number of Educational Partners that can teach you about NinjaScript. Also, we do have NinjaScript Consultants that can help you write NinjaScript for a fee. Please view our website for more information about our Partners.

                    http://www.ninjatrader.com/partners#...pt-Consultants

                    With that said I have attached a strategy that was made inside the Strategy Wizard that you can see how to create the strategy that you want and customize to your preferences if you need.

                    To Import
                    1. Download the attached file to your desktop
                    2. From the Control Center window select the menu File > Utilities > Import NinjaScript
                    3. Select the downloaded file

                    Please let me know if I can be of further assistance.
                    Attached Files
                    JCNinjaTrader Customer Service

                    Comment


                      #11
                      Thank you for the sample. You have Variable0=0 and 1=0 but there is nothing to refer to these variables in your sample. The only rule to go long is if 0=1 and 1=1. So why are the other variables for?

                      Also, in your sample the condition to go long is if ADX crosses below SAM14 and SMA30. But what if ADX is between the two SMA14 and SMA30 or between SMA30 and SMA14, what happens then?

                      Thank you

                      Comment


                        #12
                        Hello relogical,

                        Variable0 to Variable9 are User variables that are predefined inside a strategy to use, which comes in part to check logic in the Strategy Wizard as one of the Strategy Actions is to set user variable to a value.

                        Nothing will happen until the ADX crosses below the SMA14 and SMA30. You can add more logic to define your Automated Strategy to your own preferences. You may read more about the condition builder at the following link.
                        http://www.ninjatrader.com/support/h...on_builder.htm

                        We do have a YouTube video that goes over Automated Strategy Development at the following link.
                        http://www.youtube.com/watch?v=fVFqw...ure=plpp_video

                        Please let me know if I can be of further assistance.
                        JCNinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by DJ888, Today, 10:57 PM
                        0 responses
                        1 view
                        0 likes
                        Last Post DJ888
                        by DJ888
                         
                        Started by MacDad, 02-25-2024, 11:48 PM
                        7 responses
                        158 views
                        0 likes
                        Last Post loganjarosz123  
                        Started by Belfortbucks, Today, 09:29 PM
                        0 responses
                        7 views
                        0 likes
                        Last Post Belfortbucks  
                        Started by zstheorist, Today, 07:52 PM
                        0 responses
                        7 views
                        0 likes
                        Last Post zstheorist  
                        Started by pmachiraju, 11-01-2023, 04:46 AM
                        8 responses
                        151 views
                        0 likes
                        Last Post rehmans
                        by rehmans
                         
                        Working...
                        X