Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 ghoul, Today, 06:02 PM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        44 views
        0 likes
        Last Post jeronymite  
        Started by Barry Milan, Yesterday, 10:35 PM
        7 responses
        20 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by AttiM, 02-14-2024, 05:20 PM
        10 responses
        180 views
        0 likes
        Last Post jeronymite  
        Started by DanielSanMartin, Yesterday, 02:37 PM
        2 responses
        13 views
        0 likes
        Last Post DanielSanMartin  
        Working...
        X