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!
See more
See less

Partner 728x90

Collapse

Creating a Moving Average condition in wizard

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

    Creating a Moving Average condition in wizard

    How would I use the wizard to create a conditon that identifies when a 12 moving average has moved from pointing down to pointing up or vice versa? I dont' want it flat or just a slight change in slope, but when it has literally made a "V" shape and is now headed in a new direction.

    Also, is is possible to not have this trigger at a bar close, but earlier, when the creation of the V first shows itself?

    Thank you.

    #2
    If you do not want to use slope you will need to first come up with your own objective set of conditions that would signify a "V" shape. That is what is difficult about automated trading. How do you quantify the V shape. It is easy to see by the eye, but is difficult to create rules that spot these shapes.

    If you want your strategy to trigger tick by tick you can use CalculateOnBarClose = false. This setting only has relevance for real-time charts though.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      In that case, how do you use slope in the wizard to represent that if the MA was going negative, it is now going in a positive direction, or vice versa? Do you use <0 and ,>0? If so, how do you set that up on the wizard? I don't find the wizard very intuitive when it comes to things like this.

      My understanding so far is that I'd click on the EMA and put in the period requested, but then what do I put in the drop down box with the !=, etc.... and then if I click on Slope under Misc. what should I be putting in those boxes?

      Thank you.

      Comment


        #4
        What you want to do is expand the Misc section and select Rising or Falling. Then in the bottom properties that gets populated you want to change the input series to your indicator. Press the ellipse button on the right and then select your EMA indicator. Then on the right hand side you want to select true or false in the Misc section as well.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks. I just need some more clarification about the last sentence ("Then on the right hand side you want to select true or false in the Misc section as well.")

          After filling out the left hand side I am left with 2 choices in the center drop down box, == and !=. Is there one I should be selecting? (btw, what does == and != mean?) And lastly, when should I be using true and when false under Misc. on the right hand side? I'm not clear about what role the true/false plays in the resulting equation.

          TY.

          Comment


            #6
            Please see the attached picture.

            == means equal to
            != means not equal to

            The way you read the page is left to right. What is on the left is compared to what is on the right. You would use true/false when you are comparing against something that would evaluate to either true or false. Like Rising/Falling for instance.
            Attached Files
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Ok, so if I wanted enter a long position when the EMA goes from down to up (i.e. "rises"), I'd write: Rising(EMA(12)==true

              If I wanted to enter a short position when the EMA goes from up to down(i.e. falls), I'd write; Falling (EMA(12)==true

              I'm not using false, just changing the rising to a falling. Does this all compute?

              Also am I correct in thinking that the terms rising and falling are capturing a change in the EMA direction similar to the V idea?

              Comment


                #8
                Right. Just use Rising and Falling compared against true. Rising/Falling is determined by the EMA's values of the current bar and the previous bar. If the current bar's EMA value > previous bar it is rising. If it is < then it is falling. Nothing funny going on here.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  That's great. Thank you.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by llanqui, 04-28-2024, 03:53 AM
                  5 responses
                  29 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by cmtjoancolmenero, 04-29-2024, 03:40 PM
                  18 responses
                  57 views
                  0 likes
                  Last Post cmtjoancolmenero  
                  Started by llanqui, Today, 11:13 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post llanqui
                  by llanqui
                   
                  Started by ETFVoyageur, 04-30-2024, 06:05 PM
                  9 responses
                  65 views
                  0 likes
                  Last Post ETFVoyageur  
                  Started by llanqui, 04-28-2024, 10:32 AM
                  9 responses
                  36 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Working...
                  X