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

DoubleMAIndicator

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

    DoubleMAIndicator

    Can someone please tell me what this indicator is doing?

    Is it smoothing MA1(MA1(MA2(MA2)))?

    Here is what I have.
    SmoHMA1.Set( HMA(PeriodHMA)[0]);
    SmoHMA2.Set(HMA(SmoHMA1, PeriodHMA)[0]);
    SmoEMA1.Set(EMA(SmoHMA2, PeriodEMA)[0]);
    double SmoothedMA = EMA(SmoEMA1,PeriodEMA)[0];
    Plot0.Set(SmoothedMA);
    For some reason it is not quite as quick as this indicator. Thanks.

    #2
    Hi James, it creates an MA of the MA value - a double MA:

    Code:
    [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] val1Pure = MAV( MAV(Input, MA1Period, ([/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2])MA1Type ), MA2Period, ([/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2])MA2Type)[ bar ];[/SIZE][/SIZE]
    [SIZE=2][SIZE=2][/SIZE][/SIZE]


    Your final EMA is 4 times smoothed, so it makes sense that it is not a quick to react.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Yes, but when using different MA's how does it combine them. When I double smooth my HMA with double smoothed EMA it just doesnt look exactly like the one from this indicator. It's close, almost like this indicator is displacing but it is not. I am just wondering how I can achieve these results.

      Comment


        #4
        Does this come closer?

        Code:
        SmoHMA1.Set( HMA(PeriodHMA)[0]);
        SmoHMA2.Set(HMA(SmoHMA1, PeriodHMA)[0]);
        Plot0.Set(SmoHMA2[0]);
        The DoubleMA constructs a double HMA in your case, you double EMA smooth the double HMA, so this why you see another lag plotted.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          ..my english is not very good... :-((

          This average does not work very well on FESX 06-09.

          ...perhaps because not there are numbers decimates them?

          Someone can help me?

          Thanks.

          Francesco

          Comment


            #6
            Hi Francesco, welcome to our support forums at NinjaTrader! Could you perhaps post a screenshot or explain what you mean by 'does not work good on the FESX'? You can change the placement of the arrows under 'Arrow Displacement, lower numbers = the arrows are closer to price. Also you would need to enter large enough MA1 / MA2 periods.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              This is the differece between ES and FESX.
              Attached Files

              Comment


                #8
                I see thanks for posting the screenshots, this would need custom code changes then. Unfortunately this indicator is provided 'as is' and you would need to step through the code and work the changes in for the FESX market. As a last resort, you can contact a NinjaScript consultant for this task -

                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Moving Average variation...

                  I am trying to plot a lagged moving average on a price chart, along with the current plot of the moving average. However, I cannot seem to get the plot to show up on the chart... can anyone help?
                  __________________________________________________ ____
                  public class EMALagged : Indicator
                  {
                  #region Variables
                  private int period = 200;
                  private int lag = 10;
                  #endregion

                  protected override void Initialize()
                  {
                  Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "XMALagged"));
                  CalculateOnBarClose = true;
                  Overlay = true;
                  PriceTypeSupported = false;
                  }

                  protected override void OnBarUpdate()
                  {
                  XMALagged.Set(EMA(period)[lag]);
                  }

                  #region Properties

                  [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
                  [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
                  public DataSeries XMALagged
                  {
                  get { return Values[0]; }
                  }

                  [Description("moving average period")]
                  [Category("Parameters")]
                  public int Period
                  {
                  get { return period; }
                  set { period = Math.Max(1, value); }
                  }

                  [Description("lag of moving average indicator")]
                  [Category("Parameters")]
                  public int Lag
                  {
                  get { return lag; }
                  set { lag = Math.Max(0, value); }
                  }
                  #endregion
                  }
                  Last edited by toddae; 05-16-2009, 04:38 PM. Reason: edit to code example...

                  Comment


                    #10
                    Hello,

                    You are aware that you can shift all indicators forward or backward using the displacement field when attaching the indicator to the chart?
                    DenNinjaTrader Customer Service

                    Comment


                      #11
                      lagging a moving average

                      I did not know the displacement did that - that'll be useful in charts going forward - thank you. I still need to get the DataSeries worked out though...

                      I will be using the lagged value of an indicator as a part of a strategy so I need to be able to reference the value within my code...

                      Any additional ideas?

                      Comment


                        #12
                        Not sure I follow - are you still having issues getting the lagged XMA part to display? Then most likely because of this - http://www.ninjatrader-support2.com/...ead.php?t=3170
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          Fixed

                          Such an obvious miss!

                          all i had to do was add the following to the first lines of the onbarupdate():

                          if(CurrentBar < lag)
                          return;
                          ------------------
                          Thanks for the help!

                          Comment


                            #14
                            has anyone been able to incorporate the JMA moving average into the DoubleMA as an option, if we subscribe to Jurik MAs?

                            Comment


                              #15
                              suchen,

                              Please do not spam every thread with the same message. Instead please open a new thread to place in a request if you have one. Thank you.
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by tkaboris, Today, 05:13 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post tkaboris  
                              Started by GussJ, 03-04-2020, 03:11 PM
                              16 responses
                              3,281 views
                              0 likes
                              Last Post Leafcutter  
                              Started by WHICKED, Today, 12:45 PM
                              2 responses
                              19 views
                              0 likes
                              Last Post WHICKED
                              by WHICKED
                               
                              Started by Tim-c, Today, 02:10 PM
                              1 response
                              10 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by Taddypole, Today, 02:47 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post Taddypole  
                              Working...
                              X