Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

color SMA based on slope???

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

    color SMA based on slope???

    I am interested in an indicator that colors SMA lines based on slope, up and down. Sierra charts has this option for the SMA indicator but i have not found similar for Ninja. Does anyone know where i can find this indicator? Closest i have seen for ninja is the HMAColourChange which would work if it was adaptable to the SMA (adaptable for other MAs would be even better, but SMA will be a great help.)
    I've searched this forum but links are broken, lead nowhere or cycle back to the same links that go....nowhere (including bigmike).
    Indicator seems simple enough, but i am not a programmer. Any help would be much appreciated as i would like to drop sierra charts and use ninja exclusively. Thanks.

    skipper

    #2
    There is an EMA colored slope indicator in the Indicator forums.



    Import this into your Ninjatrader. Files->Utilities->Import Ninjascript.

    Edit the EMA Colored Slope indicator in your indicator list.

    Also edit the the EMA indicator in NT, you'll see a matching line. This calculates the EMA.

    Code:
    Value.Set(CurrentBar == 0 ? Input[0] : Input[0] * (2.0 / (1 + Period)) + (1 - (2.0 / (1 + Period))) * Value[1]);
    This is the easy part.

    Highlight and ERASE this line in the EMA Colored Slope Indicator.

    Edit the SMA indicator in NT.

    You'll see these lines.

    Code:
                if (CurrentBar == 0)
                    Value.Set(Input[0]);
                else
                {
                    double last = Value[1] * Math.Min(CurrentBar, Period);
    
                    if (CurrentBar >= Period)
                        Value.Set((last + Input[0] - Input[Period]) / Math.Min(CurrentBar, Period));
                    else
                        Value.Set((last + Input[0]) / (Math.Min(CurrentBar, Period) + 1));
                }
    Copy these out, and put them in the EMA Colored Slop Indicator.

    Right Click in the editor and "Save As" "SMA_Colored_Slope" or whatever you want to call it.

    Hit F5 to compile.

    It should be available now, and should work if all was successful. Sorry, I didn't test it.




    Originally posted by skipper View Post
    I am interested in an indicator that colors SMA lines based on slope, up and down. Sierra charts has this option for the SMA indicator but i have not found similar for Ninja. Does anyone know where i can find this indicator? Closest i have seen for ninja is the HMAColourChange which would work if it was adaptable to the SMA (adaptable for other MAs would be even better, but SMA will be a great help.)
    I've searched this forum but links are broken, lead nowhere or cycle back to the same links that go....nowhere (including bigmike).
    Indicator seems simple enough, but i am not a programmer. Any help would be much appreciated as i would like to drop sierra charts and use ninja exclusively. Thanks.

    skipper
    Last edited by sledge; 08-04-2012, 04:15 PM. Reason: import

    Comment


      #3
      Skipper,

      There are many indicators available out there that do something like this.

      The links should work just fine here in our forum file sharing sections so if they are not working right there may be something wrong with your web browser or internet security software.

      Big Mikes generally requires a life time membership to download indicators which is something like 50 dollars one time payment. We also have a lot of 3rd party add on providers.

      Indicator forum : http://www.ninjatrader.com/support/f...ks.php?catid=4

      Third party add ons : http://www.ninjatrader.com/partners#Third-Party-Add-Ons

      If you need something specific that doesn't exist you could always discuss your requirements with a NinjaScript consultant.

      Adam P.NinjaTrader Customer Service

      Comment


        #4
        thanks adam, found what i need
        skipper

        Comment


          #5
          thanks sledge, found what i need
          i appreciate your time

          skipper

          Comment


            #6
            Originally posted by skipper View Post
            I am interested in an indicator that colors SMA lines based on slope, up and down. Sierra charts has this option for the SMA indicator but i have not found similar for Ninja. Does anyone know where i can find this indicator? Closest i have seen for ninja is the HMAColourChange which would work if it was adaptable to the SMA (adaptable for other MAs would be even better, but SMA will be a great help.)
            I've searched this forum but links are broken, lead nowhere or cycle back to the same links that go....nowhere (including bigmike).
            Indicator seems simple enough, but i am not a programmer. Any help would be much appreciated as i would like to drop sierra charts and use ninja exclusively. Thanks.

            skipper
            Skipper
            i too use sierra and use the slope of a moving average to color
            you stated you found what you were looking for, can you share the indicator?
            igm

            Comment


              #7
              igm, you could also check into this reference sample here showing how to work with the PlotColors to achieve the slope based coloring you seek.

              Comment


                #8
                thank you very much for the help

                Comment


                  #9
                  Please read through this thread on coloring an indicator line by slope:



                  I have various indicators - including 30 different moving averages - available.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  577 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  334 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