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

How to rescale MACD histogram?

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

    How to rescale MACD histogram?

    The MACD indicator of NT uses the same scale for the main/signal line and the MACD histogram. This makes the histogram quite unreadable in trending markets, when the MACD has higher values and the histograms bars become tiny.

    To improve readability of MACD histogram, I thought about two modifications:

    - color the histogram bars (quickly and easily done by using two different plot functions)
    - rescale the MACD histogram to make it readable

    To achieve rescaling I would have to normalize the difference between macd and macdAvg, to use at best but not to exceed the y-axis range of MACD on the visible part of the chart.

    Is there any method availlable that would return the number of bars visible in the chart, as shown on the screen?

    #2
    >> Is there any method availlable that would return the number of bars visible in the chart, as shown on the screen?
    Unfortunately not.

    Comment


      #3
      simply do your own version of the macd, add a multiplier to the parameters and multiply the histogram value.
      takes 5 mins

      Comment


        #4
        Rescaling MACD histogram

        Hi Rollins,

        do not think it is that easy. What I want is basically that MACD histogram autoscales independently from MACD. This would also involve a different zeroline for MACD histogram. The histogram scale does not need to be shown on the indicator panel.

        Hi Dierk,

        In the current version MACD and histogram do autoscale together, that means using the same scale - which I do not want.

        So what I need is to overlay them using different scales, or alternatively rescaling the histogram to the range of the MACD within the visible part of the chart.

        I am sure that NT has such a function, because the AutoScale property must use it.

        Comment


          #5
          Don't think what you have in mind can be done, unless you display the histogram in a different panel. Using a multiplier is a practical solution, which can be done quickly and settles the issue for me.

          Good luck

          Comment


            #6
            Harry, unfortunately the logic you are looking for is not exposed. As last report you could look into writing your own Plot() method which overwrites the complete plotting logic (see CustomPlotSample).

            Comment


              #7
              Thanks for your quick reply, Dierk.

              Where can I find MyPlotSample (even if I do not use it, it might be interesting to have a look at it)?

              Comment


                #8
                Sorry, CustomPlotSample. Edited post below

                Comment


                  #9
                  Adapted solution suggested by Rollins

                  Hi Rollins,

                  understand now that Plot/OnBarUpdate will not allow for easy scaling of MACD histogram. Your solution is indeed practical. I added a multiplier, put it into the indicator settings (default setting 3) and this is also good enough for me, so that I do not have to buy a larger screen.

                  Thanks for the suggestion.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Jon17, Today, 04:33 PM
                  0 responses
                  1 view
                  0 likes
                  Last Post Jon17
                  by Jon17
                   
                  Started by Javierw.ok, Today, 04:12 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post Javierw.ok  
                  Started by timmbbo, Today, 08:59 AM
                  2 responses
                  10 views
                  0 likes
                  Last Post bltdavid  
                  Started by alifarahani, Today, 09:40 AM
                  6 responses
                  41 views
                  0 likes
                  Last Post alifarahani  
                  Started by Waxavi, Today, 02:10 AM
                  1 response
                  20 views
                  0 likes
                  Last Post NinjaTrader_LuisH  
                  Working...
                  X