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

HMA (Hull Moving Average) color change

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

    HMA (Hull Moving Average) color change

    Hi, does anyone know how to code the HMA, so that it changes color, say blue when it is trending up, and red when trending down?

    Thanks,

    Pablo

    #2
    Hi Pablo,

    This can be accomplished by using multiple plots. The following link is a reference sample demonstrating this concept.

    RayNinjaTrader Customer Service

    Comment


      #3
      Hma

      Hi Ray,

      That's is exactly what I am looking for, but how do I apply it to the HMA indicator?

      Sorry, not too technically savvy here.

      Thanks,

      Pablo

      Comment


        #4
        Pablo,

        This might not be the most elegant way to do this, but its very simple:

        Just download the SampleMultiColoredPlot.zip file and extract the files.

        Then edit SampleMultiColoredPlot with Tools + Edit NinjaScript.

        Then do a "Save As" to rename the file (pick a new name).

        Lastly, change all occurrences of "SMA" to "HMA", compile and you're done.

        Best regards,

        KBJ

        Comment


          #5
          Hma

          That worked great!

          Thanks KBJ

          Comment


            #6
            Hma Color Change

            This works great for HMA (cLOSE).
            What if I want to draw hma (High) and HMA(LOW) in multi color format?

            Comment


              #7
              When you load the indicator there is an option that lets you select Close, Median, etc. The option is called "Price type" and you can set those as you please. It is in the "Parameters" section of the indicator dialog window.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Hma

                This option isa available only in the Ninja script generated standard HMA INDICATORS.
                The mulicolor HMA using samplecolorplot script does not have option to select anything other than close.
                Please advise.

                Comment


                  #9
                  Add this to the Initialize() section of the indicator.
                  Code:
                  PriceTypeSupported = true;
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Hma

                    Please advise in between which line numbers should I insert the subject statement?

                    Comment


                      #11
                      You can put it anywhere inside the Initialize() method.

                      For instance:
                      Code:
                      protected override void Initialize()
                      {
                          CalculateOnBarClose    = false;
                          Overlay                = true;
                          PriceTypeSupported    = false;
                      }
                      It doesn't matter what order
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        Hma Color Plot

                        Revised as per your advise.
                        But, the price type does not appear under the parameter as a variable for selection( open,close,high,low,etc).
                        Please advise.

                        Comment


                          #13
                          Please post up your indicator file and I will take a look.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            Hma Color Indicators

                            I have realised that I have not compiled the file after inserting the text.
                            After compilation it worked perfectly and got the price type variable under parameters.
                            Thanks a lot for your help.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by tkaboris, Today, 08:01 AM
                            0 responses
                            1 view
                            0 likes
                            Last Post tkaboris  
                            Started by BarzTrading, Today, 07:25 AM
                            1 response
                            11 views
                            1 like
                            Last Post NinjaTrader_Clayton  
                            Started by EB Worx, 04-04-2023, 02:34 AM
                            7 responses
                            161 views
                            0 likes
                            Last Post VFI26
                            by VFI26
                             
                            Started by Mizzouman1, Today, 07:35 AM
                            1 response
                            9 views
                            0 likes
                            Last Post NinjaTrader_Gaby  
                            Started by Radano, 06-10-2021, 01:40 AM
                            20 responses
                            616 views
                            0 likes
                            Last Post NinjaTrader_BrandonH  
                            Working...
                            X