Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accessing plot properties

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

    Accessing plot properties

    Hi,

    If possible, what is the syntax for accessing the color of a plot?

    What I'm doing is coloring some other objects the same color as the plot, and trying to avoid adding separate user parameters for colors of each of the other objects. So, if I have a line like this:

    Add(new Plot(Color.Blue, PlotStyle.Line, "Upper"));

    there is a user parameter in the indicator setup to select a color. Ideally, I'd like to be able to access whatever that color is, programmatically.

    #2
    Originally posted by coolmoss View Post
    Hi,

    If possible, what is the syntax for accessing the color of a plot?

    What I'm doing is coloring some other objects the same color as the plot, and trying to avoid adding separate user parameters for colors of each of the other objects. So, if I have a line like this:

    Add(new Plot(Color.Blue, PlotStyle.Line, "Upper"));

    there is a user parameter in the indicator setup to select a color. Ideally, I'd like to be able to access whatever that color is, programmatically.
    Search the Help for PlotColors.

    Comment


      #3
      Thanks Koganam,

      The most relevant link I can find is this one:



      which doesn't address the question of programmatically accessing a color property of an already added plot. Did you have some other help page in mind?

      Thanks

      Comment


        #4
        Originally posted by coolmoss View Post
        Thanks Koganam,

        The most relevant link I can find is this one:



        which doesn't address the question of programmatically accessing a color property of an already added plot. Did you have some other help page in mind?

        Thanks
        I am not sure, because your link is to the root of the help index. However, this is the link that I expected that you would reach: http://www.ninjatrader.com/support/h...plotcolors.htm

        Comment


          #5
          Originally posted by koganam View Post
          I am not sure, because your link is to the root of the help index. However, this is the link that I expected that you would reach: http://www.ninjatrader.com/support/h...plotcolors.htm
          Indeed, that's the page I was looking at. No where that I can see does it show the syntax to reference the color of a plot. Yes, it does how how to specify a color. That's not what I need. I want to find out what the color assigned to a plot is, in another part of the code.

          Comment


            #6
            Hi coolmoss,

            You can get the default color with:
            Print(SMA(14).Plots[0].Pen.Color.ToString());

            Plot colors changed dynamically through PlotColors property are not available from another indicator.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Thanks Ryan, I think that'll do the trick!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              581 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              337 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              103 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              554 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              552 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X