Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change Plot Color

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

    Change Plot Color

    Hello

    In my Initialize method I'm adding a plot using:
    Add(new Plot(new Pen(Color.FromKnownColor(KnownColor.Yellow), 3), PlotStyle.Line, "MyPlot"));

    Is there a way to change the plot's color after the initialize?

    Thanks

    #2
    Hello,
    You can change the color of the plot outside of the the Initialize() event method by using PlotColors. Please see the following link for more information on PlotColors: http://ninjatrader.com/support/helpG...plotcolors.htm
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your reply.

      I can see there's a barsAgo parameter. How can I change the entire plot instead of a single bar?

      Comment


        #4
        Hello,
        There is not a way to change the entire color of the plot.
        A work around would be if you have PlotColors[0][0] = Color.YourColor; at the Beginning of the OnBarUpdate() method this will have every bar be that color as the indicator is ran on each bar and the plot for every bar would be changed.
        Cody B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        23 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        17 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        182 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        335 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        259 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X