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 sjsj2732, 03-23-2026, 04:31 AM
        0 responses
        89 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        324 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        331 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        155 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        122 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X