Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help creating moving average highlight bars

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

    Help creating moving average highlight bars

    Hi! I'm trying to create an indicator that will color bars either red or green.

    Green if: Simple Moving Avg, Close, 8 period is > than the Simple Moving Avg, open, 8 period.
    Red if: reverse of above

    Can someone please help me with this?

    #2
    Hi maggiej12, thanks for your post.

    You would need to use the BarBrushes array (or just BarBrush) to change the bar color based on a condition.


    See here for an example use case:

    This is a basic sample on how to implement a color gradient to your charts price bars using an RSI for the calculations. Converted from NT7 version provided by jortuzar.


    If you have any questions on this material please let me know.

    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.

    Comment


      #3
      Thank you for the info! However, I don't even know where to go from here, this is way too complicated for me. If i try to customize this for my indicator, its not going to make any sense. Is there someone who would create this for me?

      Comment


        #4
        Hello maggiej12,

        Thank you for your reply.

        NinjaTrader has a handful of third-party programming consultants that can help you build custom indicators. You can search our extensive library of NinjaScript consultants through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more:You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third-party services for NinjaTrader, all pricing and support information will need to be obtained through the consultant.

        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 companies and services 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.

        Let me know if I may be of further assistance.

        Comment


          #5
          maggiej12,

          This does not provide for your specific request but gives you an indicator that contains the basic coding concept of what you are after:

          Standard MACD that changes the bar colors based on the MACD crossing above or below. User input allows you to define the colors used


          Perhaps it helps.

          sandman

          Attached Files

          Comment


            #6
            Originally posted by maggiej12 View Post
            Hi! I'm trying to create an indicator that will color bars either red or green.

            Green if: Simple Moving Avg, Close, 8 period is > than the Simple Moving Avg, open, 8 period.
            Red if: reverse of above

            Can someone please help me with this?
            Hello, I modify MACDbarcolor set it to 8 period EMA of High and Low, this is not a professional coding practice but it will meet you specs.

            Click image for larger version

Name:	2020-03-05_1725.png
Views:	754
Size:	43.3 KB
ID:	1089534

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            553 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            324 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            100 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            543 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            546 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X