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 lorem, Yesterday, 09:18 AM
        4 responses
        14 views
        0 likes
        Last Post lorem
        by lorem
         
        Started by Spiderbird, Today, 12:15 PM
        0 responses
        5 views
        0 likes
        Last Post Spiderbird  
        Started by cmtjoancolmenero, Yesterday, 03:58 PM
        12 responses
        42 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by FrazMann, Today, 11:21 AM
        0 responses
        6 views
        0 likes
        Last Post FrazMann  
        Started by geddyisodin, Yesterday, 05:20 AM
        8 responses
        52 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X