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

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 bmartz, Today, 09:30 AM
              2 responses
              11 views
              0 likes
              Last Post bltdavid  
              Started by f.saeidi, Today, 11:02 AM
              1 response
              4 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by geotrades1, Today, 10:02 AM
              4 responses
              12 views
              0 likes
              Last Post geotrades1  
              Started by rajendrasubedi2023, Today, 09:50 AM
              3 responses
              16 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by lorem, Today, 09:18 AM
              2 responses
              11 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X