• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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:
    if(Rising(AO)) { if (showpaintbars) BarColor = Color.Green; PlotColors[ 0][ 0] = Color.Green; BackColor = Color.PaleGreen; } else { if (showpaintbars) BarColor = Color.Red; PlotColors[ 0][ 0] = Color.Red; BackColor = Color.Salmon; }
    Shawn B.NinjaTrader Customer Service

    Comment


      #3
      Great, thanks so much!

      90bideven

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Vincere, Today, 01:59 AM
      0 responses
      4 views
      0 likes
      Last Post Vincere
      by Vincere
       
      Started by Davoone1, Yesterday, 07:28 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_ChrisSch  
      Started by Bobisam, Yesterday, 10:53 PM
      1 response
      6 views
      0 likes
      Last Post Bobisam
      by Bobisam
       
      Started by quantera, Yesterday, 05:38 PM
      0 responses
      5 views
      0 likes
      Last Post quantera  
      Started by ciro1963, Yesterday, 03:58 PM
      0 responses
      6 views
      0 likes
      Last Post ciro1963  
      Working...
      X