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

Welles Wilder MA

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

    Welles Wilder MA

    Hi folks,

    I am trying to find the Welles Wilder MA but can not seem to find it for Ninjatrader. Could anyone help out here?


    #2
    Hello birdog,

    Thank you for your post.

    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 Welles Wilder MA 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.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      hello birddog

      This is the first code I wrote for NT8 & c# so it may be a little hacky, but I think this is what you are looking for. It is the only MA I ever use.

      Code:
      namespace NinjaTrader.NinjaScript.Indicators
      {
      public class WSMA : Indicator
      {
      private Series<bool> movingUp;
      
      protected override void OnStateChange()
      {
      if (State == State.SetDefaults)
      {
      Description = @"Wilders Smoothed Moving Average";
      Name = "WSMA";
      Calculate = Calculate.OnBarClose;
      DisplayInDataBox = true;
      IsOverlay = true;
      DrawOnPricePanel = true;
      IsSuspendedWhileInactive = true;
      
      MAPeriod = 5;
      AddPlot(Brushes.SteelBlue, "WildersSMA");
      }
      else if (State == State.DataLoaded)
      {
      movingUp = new Series<bool>(this, MaximumBarsLookBack.Infinite);
      }
      }
      
      protected override void OnBarUpdate()
      {
      // Wait for a minimum number of bars to avoid errors when using previous values for Series<T> objects
      if (CurrentBars[0] < 2)
      {
      return;
      }
      
      // Moving Average calculation
      Value[0] = (CurrentBar == 0 ? Input[0] : ((Value[1] * (MAPeriod - 1) + Input[0]) / MAPeriod ));
      movingUp[0] = (CurrentBar == 0 ? movingUp[0] : Value[0] > Value[1] ? true : false);
      movingUp[0] = (CurrentBar == 0 ? movingUp[0] : Value[0] < Value[1] ? false : true);
      
      // Plot colors are based on the Moving Average direction
      if (movingUp[0])
      PlotBrushes[0][0] = Brushes.Green;
      else if (!movingUp[0])
      PlotBrushes[0][0] = Brushes.Red;
      else
      PlotBrushes[0][0] = Brushes.SteelBlue;
      }
      
      [HASHTAG="t3322"]region[/HASHTAG] Properties
      
      [NinjaScriptProperty]
      [Range(1, int.MaxValue)]
      [Display(Name="MA Period", Order=1, GroupName="Parameters", Description="Numbers of bars used for the Moving Average calculation")]
      public int MAPeriod
      { get; set; }
      
      #endregion
      
      }
      }


      cheers!

      Comment


        #4
        Zigfried wow...cool man. I will take a look...much appreciated! I will let you know if I notice any issues etc.

        If you ever do any updates, as you remember, could you repost here?

        Comment


          #5
          birdog...YW & yes, let me know if you see any errors or have any improvements.

          Back when I used TD Ameritrade for years, I decided to always use their Wilders average, so when I transitioned to NT, I compared the TDA Wilders to this one, and they looked the same on the charts. That was the only verification I ever did on it.

          Looking at the code 5 years later, there may be some wonkiness in the movingUp calc...it seems to work fine, but that part maybe could have been done a little more elegantly.

          I have considered adding a flag that is true for only the bar where the direction change occurred...maybe I'll add that someday...will let you know if I do!​

          Comment


            #6
            Zigfried Sounds good. It will import into NT 8 right? Would you mind to post an importable NT8 version of it? When I zip it up and import it mentions it is from a older version of NT.

            Comment


              #7
              hi birdog

              I've never used the NT export/import functions until today, and have only posted code snippets on this forum.

              So I don't know what to expect when you try to import the attached zip, as I am still using NT 8.0.25.0 (to avoid the Watch Button that annoys so many Users) ...you will probably get the same "older version" message when you try to import it.

              The indicator has worked fine for 5 years of NT revs (it is very basic NT/c# code), so if needed, you should be able to just grab the .cs from the zip and paste it into your Indicator directory...of course this would subvert any error/security checking done by the NT import function.

              regards
              Zigfried​
              Attached Files

              Comment


                #8
                Zigfried That worked to import FYI...thank you. Ah, yes of course on putting directly in the folder too. Got it rolling regardless. Thanks Again.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Nyman, Yesterday, 02:27 PM
                1 response
                14 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by Kdevineni, Today, 08:56 AM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Erick  
                Started by Ndakotan1313, Today, 08:54 AM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by Alesiosc, Today, 08:43 AM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by shortrader, Today, 07:15 AM
                2 responses
                10 views
                0 likes
                Last Post shortrader  
                Working...
                X