Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Awesome oscillator background color

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

    Awesome oscillator background color

    Hi, long time reader, first time poster. Could someone point me in the right direction please. I want to paint the chart background different colors depending on whether the AO is printing green or red bars.

    I know how to paint the background if the bars are on either side of the 0 line, but I want the background to change solely based on whether the bars are red or green, irrespective of the side of 0 they are on...any thoughts? Thanks.

    90bideven

    #2
    Hello 90bideven,


    You could use BackColor to set the chart panel color for the current bar.
    Here is the BackColor Help Guide to assist you further.
    Here is an example of the AO code that colors the chart panel in response to if the AO is painting a Red or Green Bar.
    Code:
    [LEFT][FONT=Courier New][SIZE=2] [/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#0000FF]if[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2](Rising(AO))[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]                        {     [/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#0000FF]if[/COLOR][/SIZE][/FONT] [FONT=Courier New][SIZE=2](showpaintbars)[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]                                    BarColor = Color.Green;[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]                              PlotColors[[/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]][[/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] = Color.Green;[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]                              BackColor = Color.PaleGreen;[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]                        }[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]                        [/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#0000FF]else[/COLOR][/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]                        {     [/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#0000FF]if[/COLOR][/SIZE][/FONT] [FONT=Courier New][SIZE=2](showpaintbars)[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]                                    BarColor = Color.Red;[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]                              PlotColors[[/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]][[/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] = Color.Red;[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]                              BackColor = Color.Salmon;[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]                        }[/SIZE][/FONT][FONT=Courier New][SIZE=2][/SIZE][/FONT]
    [/LEFT]

    Comment


      #3
      Great, thanks so much!

      90bideven

      Comment

      Latest Posts

      Collapse

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