• 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 pjsmith, Today, 08:14 AM
      0 responses
      9 views
      0 likes
      Last Post pjsmith
      by pjsmith
       
      Started by levikNT, Today, 07:36 AM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_ChristopherD  
      Started by TazoTodua, Today, 07:27 AM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_JoshG  
      Started by KennyK, Yesterday, 09:47 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Dogmatichacker, Yesterday, 03:52 PM
      1 response
      15 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X