Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

background-color-based-on-indicator-output

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

    background-color-based-on-indicator-output



    I know some of this was covered by ninjatrader_kate in an older post. https://forum.ninjatrader.com/forum/...dicator-output

    But I tried the files that were uploaded and couldn't get them to work , wanted me to remove a lot of the region info.

    I am wanting to do something just like the OP.

    I want to be able to change the color of the RSI window background based on the level it is at with an OnTick change ( to make it more visual instead of having to take longer to look at the numbers to the right). So say 0-39 background goes green, 40-69 stays black, 70-100 background turns red all based on the data I select on the indicator ( 14, 21 etc) .

    Is that possible?

    Thanks in advance,
    Mill​

    #2
    Yes, you could change the entire RSI sub-panel background by overloading OnRender.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Hello millunare,

      You can do that using the indicators property called BackBrush. That allows you to set the current bar background to a color based on a condition. You can also use BackBrushes which lets you set historical bar background colors.

      To do that for the RSI or any system indicator you would need to first make a copy of the RSI by opening it in the NinjaScript editor. Then Right click in the code -> Save As and give it a unique name. That will make a copy of the code that you can edit. After doing that you can make any changes you wanted to the existing indicators code. You can view a video of using the NinjaScript editor in the youtube link below.




      Comment


        #4
        To clarify, you only need OnRender if you want to change the ENTIRE background of the subgraph (not just the background behind specific bars). To change the background just behind the specific bars use BackBrush or BackBrushes[] to go backwards.
        Bruce DeVault
        QuantKey Trading Vendor Services
        NinjaTrader Ecosystem Vendor - QuantKey

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        93 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        152 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        80 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        54 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        66 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X