Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New and need help w MACD changing bar colors

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

    New and need help w MACD changing bar colors

    Hi,

    I'm new to this forum and new to Ninja script and am hoping someone can get me started on programming my bar charts to change color with certain MACD conditions.

    Very simply I want the bar to turn green if the MACD is both above the signal line and above zero. I want the bar to turn red if the MACD is both below the signal line and below zero.

    Thanks,
    BB

    #2
    BB, welcome to our forums - without diving fully into custom this script via NinjaScript / C# you could use our point and click strategy wizard interface to create this coloring for your chart via a Strategy.



    I've attached your little example as a courtesy to get started down this path easier.

    You can import the zip file via File > Utilities > Import NinjaScript.

    Play around with it and good luck,
    Attached Files

    Comment


      #3
      Bertrand,

      Thank you for the start, I appreciate the help. Unfortunately, it didnt work. I plugged it into a range bar chart and all the HLOC bars remained black. Is there some way i'm not aware of to implement the strategy?

      Comment


        #4
        You're welcome, is the enable parameter for your strategy set to 'true', so it would actually run live on this chart?

        Comment


          #5
          Got it, thanks.

          Comment


            #6
            Bertrand,
            Thank you again for the strategy, it's working just fine. I did have to remove and reinstall NT, so I had to come find it again to reload it.

            I was wondering if there's anything that could be done to allow me to use what you created AND chart trader. Right now, as you probably already know, the strategy disables chart trader. And, if you were using a strategy to actually place trades, that might make sense.

            Comment


              #7
              Glad to hear it's working fine for you BB, unfortunately it would be either ChartTrader activated or a Strategy running on the chart - we have allowing both items on our list of feedback in product management and I've surely added your vote in here as well.

              A workaround would be either using 2 charts, one for the strategy, the other for ChartTrader or just entering orders over the DOM interface while having the chart on the side.

              Yet another would be using custom coding to convert the analysis of the strategy to an indicator so you would apply it to a chart with ChartTrader enabled.

              Comment


                #8
                i figured the custom code would be the answer for now. Using two charts is not very efficient. You could get used to it, just not what I want to end up with.

                I'll wait a little while and see what happens with the next few updates. If it does come down to custom code, do you have any suggestions you could PM to me?

                Comment


                  #9
                  Correct, for now it would come down to moving your script to an indicator based one via custom coding.

                  To get started down this path, I would suggest working through those tutorials -



                  If you would prefer to get this ported professionally for you, a NinjaScript consultant could assist in the process - http://www.ninjatrader.com/partners#...pt-Consultants

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  596 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  343 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  103 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  556 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  554 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X