Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Background color based on Indicator state.

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

    Background color based on Indicator state.

    Is it possible to change the background color based on the state of an indicator / several indicators?

    For example, if (Close[0] > SMA(20)) then color.Blue background otherwise color.White background so it's easier to visually see when the price has closed about the 20 SMA.

    Or if (ToTime(Time[0]) >= 930 && ToTime(Time[0]) <= 1615) then background color.White otherwise gray to highlight RTH in a 24-hour chart.

    Thanks

    #2
    Hello 8DTK8,

    Yes, this is possible using either BackColor or BackColorAll properties.



    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      backcolorall

      If I make a blend of colors by using lineargradient brush - can you hint how I would paint the whole Canvas instead of just the chart panel - BackColorAll doesn't take non standard colors as I understand it?

      Comment


        #4
        Hello Mindset,

        Correct, BackColorAll can only take the standard color selections in the C# library.

        Anything beyond this is outside our scope of support, but you may be able to get ideas from this indicator:
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        43 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        25 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        163 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        98 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        158 views
        2 likes
        Last Post CaptainJack  
        Working...
        X