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 CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        172 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        88 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        129 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        208 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        185 views
        0 likes
        Last Post CarlTrading  
        Working...
        X