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

Paint bars based on fast macd crossing 0

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

    Paint bars based on fast macd crossing 0

    I am looking for an indie that will paint the bars Dodger Blue when the MACD Fast EMA (12) Crosses above 0; then paint the bars Red when Fast ema (12) Crosses Below 0. I also want to change the EMA's as I use different settings for different time frames. Anyone know where I can find this indie? Or could anyone develop it for me? I am not a programmer. Thanks!! SP

    #2
    Hello eliscottie,
    Let me correct it, in MACD EMA 12 is not plotted but macd is defined as difference of EMA 12 & EMA 26 which is plotted as macd line & the other signal line is EMA 9 of macd line. I believe you need to color candles when macd line is above / below 0.
    Its fairly simple you can do it yourself, you would need below code for this:
    Code:
    if (macd.Default[0] > 0)
    {[INDENT]BarBrushes[0] = Brushes.DodgerBlue; // body color
    CandleOutlineBrushes[0] = Brushes.DodgerBlue; // wick color[/INDENT]
     
     }
    else
    {[INDENT]BarBrushes[0] = Brushes.Red; // body color
    CandleOutlineBrushes[0] = Brushes.Red; // wick color[/INDENT]
     
     }
    Hope it helps!

    Comment


      #3
      Thank you s kinra. I am not a programmer. Do you have a .zip file for NT 7?? Very much appreciated!

      Comment


        #4
        Hello eliscottie,

        Thanks for your post.

        If you would like an indicator created for you, we can provide a link to 3rd party programmers in the NinjaTrader Ecosystem that can provide that service.

        Another resource you may want to review is the public/free indicators found in the NT User apps section of the NinjaTrader Ecosystem. Here is a link to Ninjatrader8 indicators: https://ninjatraderecosystem.com/use...r-8-indicators

        Please note: 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.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by eliscottie View Post
          Thank you s kinra. I am not a programmer. Do you have a .zip file for NT 7?? Very much appreciated!
          Attaching the closest match to your needs, you can modify it further as required. It should paint bars on macd line crossing average you can change this to 0.
          Hope it helps!
          Attached Files

          Comment


            #6
            Would it be possible to also add another set of variables to the MACDBarColor indicator?
            Yes paint bars when fast crosses above/below 0.
            But also, paint bars when fast crosses slow above/below 0.
            IClick image for larger version

Name:	macdhistoPAINTBARS.png
Views:	581
Size:	100.3 KB
ID:	1193506

            Comment


              #7

              I've attached "MACDBarColoursForChrisNucleus.zip" (NT8 v 8.0.22.2)
              (EDIT UPDATE to the post: I re posted v2 in post# 10)

              Click image for larger version  Name:	MACD Bar Colours .jpg Views:	2 Size:	103.4 KB ID:	1193616

              Hope it helps

              Enjoy



              Bar colours:-
              MACD(Fast) < > 0
              Avg(Slow) < > 0
              MACD cross Avg < > 0

              Plot colours:-
              MACD line rising/falling
              MACD line <> 0
              MACD line rising/falling <>0
              Avg line rising /falling
              Avg line < > 0
              Avg line rising/falling <>0
              DIFF (Histogram) rising falling
              DIFF (Histogram) < > 0
              DIFF (Histogram) rising/falling <>0


              Candle Outline colour:
              Attached Files
              Last edited by dj22522; 04-16-2023, 06:53 AM.

              Comment


                #8
                Originally posted by dj22522 View Post



                I've attached "MACDBarColoursForChrisNucleus.zip" (NT8 v 8.0.22.2)


                Hope it helps

                Enjoy



                Bar colours:-
                MACD(Fast) < > 0
                Avg(Slow) < > 0
                MACD cross Avg < > 0

                Pot colours:-
                MACD line rising/falling
                MACD line <> 0
                MACD line rising/falling <>0
                Avg line rising /falling
                Avg line < > 0
                Avg line rising/falling <>0
                DIFF (Histogram) rising falling
                DIFF (Histogram) < > 0
                DIFF (Histogram) rising/falling <>0

                Background colour:
                Avg < > 0

                Candle Outline colour:
                That screen shot looks PERFECT... but I wont bs ya.. I dont know what the heck to do with that code... I tried pasting it into the MACDBarColor indy & errors came back. Also tried copying nt's original macd indy & pasting it in there but errors too. As you can guess Im very green to programming ninjascript so any help would be appreciated thanks!

                Comment


                  #9
                  Click image for larger version

Name:	trying to dl.png
Views:	525
Size:	58.8 KB
ID:	1193608
                  Originally posted by dj22522

                  Hi Chris

                  I attached the indicator.
                  You just need to import it. There's no code to copy paste.

                  I've attached a version 2 for the reasons outlined below.

                  Import the attached:-

                  "MACDBarColoursForChrisNucleus2.zip"




                  @NinjaTrader_PaulH

                  For Attention of Ninjatrader Help:-

                  The indicator "MACDBarColoursForChrisNucleus.zip" I attached at post # 6 doesn't save to a chart or as a template.
                  I've no idea why.

                  Meaning if I load the indicator to chart and save as template and or simply save workspace then the next time I open up NT8 the indicator isn't loaded on the chart and doesn't load when adding the previously saved template.

                  If anyone an NT can help that would be appreciated.

                  I've taken out the code for the following from "MACDBarColoursForChrisNucleus.zip" attached at post #6 and the indicator saves as it should:-

                  Background colour Avg < > 0
                  Plot lines:
                  MACD line rising/falling <> 0
                  Avg line rising/falling <> 0
                  Diff line rising/falling <> 0
                  Hi dj, thanks for the quick response, Im very grateful. Maybe somethings up w/ NT forum bc the zip wanst showing when I 1st responded. Now when I try to download it, I get redirected to this page. (image attached)

                  Comment


                    #10

                    You're welcome.

                    I don't understand either re the attachments.


                    I've attached v2 "MACDBarColoursForChrisNucleus2.zip" again to this post.


                    Added the following:

                    Bar Colours:-
                    MACD(Fast) < > 0
                    Avg(Slow) < > 0
                    MACD cross Avg < > 0

                    Plot Colours:-
                    MACD line rising/falling
                    MACD line <> 0
                    MACD line rising/falling <>0

                    Avg line rising /falling
                    Avg line < > 0
                    Avg line rising/falling <>0

                    DIFF (Histogram) rising falling
                    DIFF (Histogram) < > 0
                    DIFF (Histogram) rising/falling <>0


                    Candle Outline Colour:



                    dj
                    Attached Files
                    Last edited by dj22522; 04-16-2023, 06:54 AM.

                    Comment


                      #11
                      Originally posted by dj22522 View Post


                      You're welcome.

                      I don't understand either re the attachments.

                      I'm using the "Upload Attachments" button.

                      I attached the zip to post # 6 but then it wasn't showing. now it is
                      I then attached a v2 zip to post # 9 but now that's not showing.

                      I don't understand why.

                      I've attached v2 "MACDBarColoursForChrisNucleus2.zip" again to this post.

                      If the facility to attach doesn't work or I'm doing something wrong then hopefully NT support can advise.


                      Hope it works



                      dj
                      works perfectly & all the options you added w/in the indicator .... AWESOME!!!
                      cant thank you enough for taking the time, as well as going above & beyond... thanks so much!!!

                      Comment


                        #12
                        Originally posted by chris.nucleus View Post

                        works perfectly & all the options you added w/in the indicator .... AWESOME!!!
                        cant thank you enough for taking the time, as well as going above & beyond... thanks so much!!!
                        Great. Glad the attachment attached..

                        I replaced the zip in post #10 so re-download that zip if you want.


                        I added back the plot colours for the MACD, Avg, and DIff rising/falling < > 0

                        I also added option to "Display" indicator name.

                        dj
                        Last edited by dj22522; 03-14-2022, 08:31 AM.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by DJ888, 04-16-2024, 06:09 PM
                        6 responses
                        18 views
                        0 likes
                        Last Post DJ888
                        by DJ888
                         
                        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
                        6 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  
                        Working...
                        X