Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Wilder's Moving Average

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

    Wilder's Moving Average

    Hi,

    Can someone help me to correct this indicator.

    It is showing a straight line.

    Regards
    Sujay

    Amibroker Code:
    =============
    A1 = WilderMA(C, 5);

    function WilderMA(Field, Period)
    {
    X[0] = Field[0];

    for(i = 1; i < BarCount; i++)
    {
    X[i] = Field[i]/Period + X[i - 1] * (Period - 1)/Period;
    }
    return X;
    }
    Attached Files

    #2
    sujay,

    Could you describe to me the issue a bit more here for clarification? Where did you get this indicator?
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Hi NinjaTrader_AdamP,

      I wrote this indicator by modifying EMA code.

      Formula:



      Problem:
      This is a kind of trend indicator so it should draw a line like other moving average up and down curve.

      But i am getting a horizontal straight line.
      Last edited by ssijbabu; 10-07-2012, 10:38 PM.

      Comment


        #4
        Hello,

        Likely the formula has an issue here. At first I thought it might be because it's only adding some small value each time, but looking at it closer I think it might be that the order these arithmetic operations are going through causes the issue. Division on computers can sometimes be funky if you aren't careful.



        This appears to work :

        Code:
        Plot0.Set(CurrentBar == 0 ? Input[0] : ((Plot0[1]*(period-1) + Input[0])/period ) );
        Last edited by NinjaTrader_AdamP; 10-08-2012, 08:19 AM.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_AdamP View Post
          Hello,

          Likely the formula has an issue here. At first I thought it might be because it's only adding some small value each time, but looking at it closer I think it might be that the order these arithmetic operations are going through causes the issue. Division on computers can sometimes be funky if you aren't careful.



          This appears to work :

          Code:
          Plot0.Set(CurrentBar == 0 ? Input[0] : ((Plot0[1]*(period-1) + Input[0])/period ) );
          Thanks for the code Adam. Here is the indicator.
          Attached Files

          Comment


            #6
            Does anyone have wilders for ninjatrader? This indicator doesnt work with the newest ninjatrader

            Comment


              #7
              Hello calster,

              Though I was not able to find it, it is possible that this indicator is publicly available on our NinjaTrader Ecosystem website:Otherwise, this thread will remain open for any users of the forum community to chime in if they are aware of any existing versions of the Wilders indicator for NinjaTrader.

              Here is a basic guideline of how to import NinjaScript add-ons in NinjaTrader 8:

              Note — To import NinjaScripts you will need the original .zip file.

              To Import:
              1. Download the NinjaScripts to your desktop, keep them in the compressed .zip file.
              2. From the Control Center window select the menu Tools > Import > NinjaScript Add-on...
              3. Select the downloaded .zip file
              4. NinjaTrader will then confirm if the import has been successful.

              Critical - Specifically for some NinjaScripts, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'

              Once installed, you may add the indicator to a chart by:
              • Right-click your chart > Indicators... > Select the Indicator from the 'Available' list on the left > Add > OK

              Here is a short video demonstration of the import process:
              Please let me know if I can be of further assistance.

              The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

              Comment


                #8
                Originally posted by NinjaTrader_AdamP View Post
                Hello,

                Likely the formula has an issue here. At first I thought it might be because it's only adding some small value each time, but looking at it closer I think it might be that the order these arithmetic operations are going through causes the issue. Division on computers can sometimes be funky if you aren't careful.



                This appears to work :

                Code:
                Plot0.Set(CurrentBar == 0 ? Input[0] : ((Plot0[1]*(period-1) + Input[0])/period ) );
                Hello
                Please check WilderMA_2.txt file if possible,
                Is it true -- Value[0] = CurrentBar == 0 ? Input[0] : Value[1] + (constant1 * (Input[0] - Value[1]));

                or Value[0] = CurrentBar== 0?Input[0]:Value[1] +(constant1*(Input[0] : Value[1]));

                Your opinion on this code ...​​

                Comment


                  #9
                  Hello,

                  Thank you for your post.

                  Are you having issues with this code? Can you be more specific on what exactly you need assistance with?

                  "Is it true -- Value[0] = CurrentBar == 0 ? Input[0] : Value[1] + (constant1 * (Input[0] - Value[1]));

                  or Value[0] = CurrentBar== 0?Input[0]:Value[1] +(constant1*(Input[0] : Value[1]));"

                  Can you clarify what you mean by "is this true"? What exactly are you trying to achieve using this statement?

                  As a heads up, our support generally can't answer questions like "does this look right", we would redirect you to try the script and make sure it does what you asked of it. Testing the script is a very important part of the strategy creation process so that squarely falls on the developer to make sure it works as planned.

                  Comment


                    #10
                    Originally posted by NinjaTrader_Gaby View Post
                    Hello,

                    Thank you for your post.

                    Are you having issues with this code? Can you be more specific on what exactly you need assistance with?

                    "Is it true -- Value[0] = CurrentBar == 0 ? Input[0] : Value[1] + (constant1 * (Input[0] - Value[1]));

                    or Value[0] = CurrentBar== 0?Input[0]:Value[1] +(constant1*(Input[0] : Value[1]));"

                    Can you clarify what you mean by "is this true"? What exactly are you trying to achieve using this statement?

                    As a heads up, our support generally can't answer questions like "does this look right", we would redirect you to try the script and make sure it does what you asked of it. Testing the script is a very important part of the strategy creation process so that squarely falls on the developer to make sure it works as planned.
                    Hello Gaby,

                    Definition
                    "This is true " -
                    wrong

                    I was interested to hear any of your
                    opinions, this indicator code...​

                    Sincerely,​​

                    Comment


                      #11
                      Hello alex@n,

                      As long as the script is working as intended, then I don't see anything "wrong" with the way it is coded.

                      This thread will remain open if any members of the community want to provide feedback on your script.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      574 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      333 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
                      553 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      551 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X