Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MACD strategy

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

    MACD strategy

    How to set up a strategy using MACD (12,26,9)?

    #2
    jp2890,

    You can use the MACD in the Condition Builder of the Strategy Wizard. Suggest you take a look at this tutorial: http://www.ninjatrader-support.com/H...tml?Overview34
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Success!

      Some questions:

      1. What is look back period?

      2. Can I use "second" instead of "minute" as time interval?

      3. Is Zero lag MACD available? Any code available?

      Thank you Josh.

      Comment


        #4
        jp2890,

        1. Depends under what context you are talking about. If you are talking about CrossAbove/Below, it determines the two data points to check. It looks at the values at two points in time, the first point in time is the most recent bar, the second being whatever the lookback period is set to.

        2. Time intervals are determined by what kind of chart you ultimately run on. If you run on a 1min chart, it uses 1min. If you run on a 30 second chart, it will use that.

        3. You can try going through the file sharing second for Zero lag indicators to see if you find what you want.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I would like to use the Strategy Analyser to optimize the MACD parameters.

          What should I enter in the optimize box: parameters, myinput0, min, max value?

          What is Myinput0?

          Thanks!

          Comment


            #6
            jp, MyInput0 is the first variable that gets generated when creating a strategy. Unless you've included MyInput0 in your calculations, you can ignore it.

            The other values you ask about are just like they seem, the low is the lowest value the optimizer will try up to high, the highest value. The other parameter is the "skip" value, which is the increment the optimizer will go from low to high by. So if the low is 9 and the high is 25 and the increment is 5 (9,25,5), the iterations tested will be 9, 14, 19, 24.
            AustinNinjaTrader Customer Service

            Comment


              #7
              Thanks Austin,

              Since MACD has three value, say (12,26,9), in fact which value it is optimizing each time?

              Where to set which value it is optimizing?

              Can I optimizing three values at the same time?

              Merry Christmas!

              Comment


                #8
                JP, it optimizes the value you tell it to. You can select these values from the optimize window, after maximizing the parameters section. Yes, it is also possible to optimize all three at the same time.
                Attached Files
                AustinNinjaTrader Customer Service

                Comment


                  #9
                  Thanks Austin,

                  I understand the case of SMA crossover i.e. fast and slow value.

                  For a MACD optimzation, where to specify which particular value to optimize, i.e. the MACD value, Ave and Diff.

                  Thanks.

                  Comment


                    #10
                    JP, the optimize process is exactly the same for any strategy. If you've created the MACD strategy to be optimized, it is possible the inputs haven't been "exposed", thus they can't be optimized. In your code, the inputs for the MACD must be variables in order for the strategy analyzer to be able to optimize it. Please see the attached screenshots to see where to put what.
                    Attached Files
                    AustinNinjaTrader Customer Service

                    Comment


                      #11
                      Thanks Austin,

                      Not too understand what steps follow screenshot 3.

                      Is there any help menu related to this?

                      Comment


                        #12
                        JP, indeed there is a help guide article for this. Optimizing a strategy.
                        AustinNinjaTrader Customer Service

                        Comment


                          #13
                          Thanks Austin,

                          The critical step is to "expose" the inputs. Understand.

                          Merry Christmas!

                          Comment


                            #14
                            I would like to set a strategy with MACD cross over as entry. Can I use certain points (say 10 points profit) as exit?

                            If yes, how to write the exit setting?

                            Thanks!

                            Comment


                              #15
                              You enter the stops and targets in the wizard's dedicated section to this -



                              For 10 pts on the ES for example just enter 40 ticks.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              558 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              324 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              101 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              545 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              547 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X