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.
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,602 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        8 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        4 views
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        12 views
        0 likes
        Last Post Javierw.ok  
        Working...
        X