Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change Plot Color

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

    Change Plot Color

    I am using the following code to plot a volume buy/sell indicator histogram. It is supposed to be green when positive and red when negative.
    Instead if the last plot is negative it turns all bars red, and if the last plot is positive it turns all bars green. There must be something funky with my indexing but when I tried to change it I got an error.
    Here's the code:
    HTML Code:
    			if(Value[0] > 0)
    				{
    				 Plots[0].Brush = Brushes.Green;
    				}
    			else
    				{
    				 Plots[0].Brush = Brushes.Red;	
    				}
    				
    I've attached a small picture of the plot.

    What am I doing wrong?

    Thanks

    DaveN
    Attached Files

    #2
    No worries, I figured it out. Need to use PlotBrushes[0][0] = Brushes.Green or red instead.
    It's working fine now.

    Comment


      #3
      Thanks for posting the solution, I had the exact same problem. Despite following the language reference (http://ninjatrader.com/support/helpG...-us/?plots.htm)

      Comment


        #4
        Hello,

        Thanks for your post.

        Based on the comments we will amend our documentation to note that the Plots[0].Brush = Brushes.Blue; example shows the entire series color change and we will add a foot note reference/link to PlotBrushes for the individual element color change.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        672 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        379 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        577 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        582 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X