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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        23 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        13 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        8 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        10 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        16 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X