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

Reading background color?

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

    Reading background color?

    Hi,

    I'd like to know if it is possible to programaticly determine the "background" color of an indicator display (at the bottom of the screen under the price chart)? For example if something like this is possible:

    if(Indicator.BackColor == Green){do something;}

    Thanks in advance for any help.

    #2
    - an indicator has no "background" color
    - you can access the color of a plot e.g. by "Plots[0].Pen.Color"

    Comment


      #3
      Hi Burga1,

      You can paint the indicator panel a certain color though. Please take a look at these two links:
      BackColor
      BackColorAll
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        Hi,

        Thanks for the replies...yes that's what I mean--if an indicator has had the command for "backcolor" executed to change the color...can this be subsequently "read" as per my example in my first post? I simply want to be able to program a strategy to "read" what the indicator backcolor is...

        Comment


          #5
          Yes, it can be accessed as per Josh's post below

          Comment


            #6
            Thank you, so you're saying that this:

            if(Indicator.BackColor == Green){do something;}

            is acceptable code?

            Comment


              #7
              No. Just do this:
              Code:
              if (BackColor == Color.Green)
                   // Do something
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Thanks for the reply. If I'm writing a strategy to access the backcolor within a seperate indicator, is that not possible? Would I have to write the code that sets the backcolor within the strategy then?

                Comment


                  #9
                  Not sure I follow, but maybe you could just expose a property from your indicator that contains values pertaining to the conditions you are searching for and then access those from the strategy.

                  Here is a reference sample for doing just that: http://www.ninjatrader-support.com/v...ead.php?t=4991
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Thank you.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by wzgy0920, 04-20-2024, 06:09 PM
                    2 responses
                    26 views
                    0 likes
                    Last Post wzgy0920  
                    Started by wzgy0920, 02-22-2024, 01:11 AM
                    5 responses
                    32 views
                    0 likes
                    Last Post wzgy0920  
                    Started by wzgy0920, Yesterday, 09:53 PM
                    2 responses
                    49 views
                    0 likes
                    Last Post wzgy0920  
                    Started by Kensonprib, 04-28-2021, 10:11 AM
                    5 responses
                    192 views
                    0 likes
                    Last Post Hasadafa  
                    Started by GussJ, 03-04-2020, 03:11 PM
                    11 responses
                    3,234 views
                    0 likes
                    Last Post xiinteractive  
                    Working...
                    X