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

Coloring a MACD histogram?

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

    Coloring a MACD histogram?

    Hi. I've seen various examples of histograms being color-coded to reflect their rising or falling states, but I cannot for the life of me extract the relevant piece of code from an existing indie and put it into my MACD so that it's histo is similarly beautified.

    I currently have my MACD Avg line (not the Diff value) represented as 'bars' and it's these that I'd like to have colored red for falling and green for rising.

    In a dream world, I'd also like the MACD line itself to change color as it passes above or below the Avg line.. but now I'm just being silly...

    I tried so hard to pull the code from the ATRratio indie but it just refused to compile — I have no idea what I'm doing, tbh, so I have to resort to pleading for help...

    Many thanks in advance.
    Last edited by 5iver; 03-01-2009, 04:25 PM.

    #2
    Try this, looks confusing to me but it's what you asked for.
    Attached Files
    Last edited by eDanny; 03-02-2009, 09:19 AM.
    eDanny
    NinjaTrader Ecosystem Vendor - Integrity Traders

    Comment


      #3
      Did you just code that???

      Wow. That's exactly what I needed. thank you so much!

      Looks much less confusing when colored as I imagined it (attached)

      Thank you eDanny. Your help is greatly appreciated.

      Attached Files

      Comment


        #4
        Changed file in previous post to have an Avg line and transparent Diff by default. Now it looks like what you posted.
        eDanny
        NinjaTrader Ecosystem Vendor - Integrity Traders

        Comment


          #5
          Thank you again.

          Would you be offended if I ask for one more thing...?

          Having used this for 24hrs now, I see I should instead have requested that the MACD line change color to reflect its rising/falling state (just like the Avg does), rather than changing color at the cross of the Avg line... my mistake of course.

          It's impertinent to expect you to make the change, (you've already been generous enough) is it something I could do within the code you originally created?
          Last edited by 5iver; 03-02-2009, 11:51 AM.

          Comment


            #6
            Actually I wondered why you wanted to see the color change on the Avg and Macd at the same points before. Here is your modification, it will overwrite your indicator when importing but you will have to remove the old from charts and re-apply since I moved plots around.
            Attached Files
            eDanny
            NinjaTrader Ecosystem Vendor - Integrity Traders

            Comment


              #7
              You've been very generous, and I thank you. This is perfect now.
              I hope I can be of service in return at some point in the future.

              Comment


                #8
                Per your PM request 5iver. The smoothing affects everything so if you only want the Macd line smoothed let me know and it can be fixed easily.
                Attached Files
                eDanny
                NinjaTrader Ecosystem Vendor - Integrity Traders

                Comment


                  #9
                  Repaint problemo

                  Hi eDanny,

                  I'm posting this here so I can include a screenshot. I'm noticing that this new, smoothed version tends to repaint, particularly the rising color over a falling plot.... is this an easy fix or an NT issue? I have to run the indie as "Calculate on bar close: False" for it to be of any use to me.

                  Sorry to be a pain, but any ideas?

                  Many thanks
                  Attached Files

                  Comment


                    #10
                    Unfortunately I have seen this happen every time this method is used. I assume it is a Ninja problem.
                    eDanny
                    NinjaTrader Ecosystem Vendor - Integrity Traders

                    Comment


                      #11
                      Thanks. Then I'll take it up with the powers that be.

                      Oh for v7.

                      Comment


                        #12
                        Hello eDanny,
                        Came across this thread and downloaded your indicator - it is great, thank you very much. Is there another one you might have that would paint the Avg line in diff colors or maybe both lines-Avg and Macd with usual histogram coloring, and hopefully does not repaint. I'm still using Ninja 6.18. Planning to migrate to v7 soon.
                        I'm using one of your Macd ind. and I see the Macd is falling - red color (my falling color). But if I do simple test - if MACD is falling then color my arrows in different colors when cross blw and Macd is falling, then it fails. The arrow shows that Macd is rising although the Macd line is clearly falling on the chart - it is red and falling. Is this a repaint issue?
                        Thank you very much.
                        Art.
                        Last edited by Art09; 11-24-2010, 12:59 PM.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by rdtdale, Today, 01:02 PM
                        1 response
                        3 views
                        0 likes
                        Last Post NinjaTrader_LuisH  
                        Started by alifarahani, Today, 09:40 AM
                        3 responses
                        15 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Started by RookieTrader, Today, 09:37 AM
                        4 responses
                        18 views
                        0 likes
                        Last Post RookieTrader  
                        Started by PaulMohn, Today, 12:36 PM
                        0 responses
                        9 views
                        0 likes
                        Last Post PaulMohn  
                        Started by love2code2trade, 04-17-2024, 01:45 PM
                        4 responses
                        41 views
                        0 likes
                        Last Post love2code2trade  
                        Working...
                        X