• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Testing for a color

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

    Testing for a color

    I know this is kind of off the wall but I have an indicator that colors the 100 line a specific color based on some internal rules that I don't have visibility of. Wondering if there is any way to test for a specific color of the 100 line.

    Thanks,
    Mike

    #2
    If you are setting the color dynamically there is probably a variable that is passed around that contains the color. If you can find the name of that variable then you can check the color.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks Josh...the indicator isn't mine and is encrypted. So, I don't have visibility much except what shows in the indicator properties.

      Mike

      Comment


        #4
        Hi Mike,

        From my understanding you are calling this indicator with another indicator/strategy and you want to do something if this indicator's line is some color. Is this correct?

        You can do so by going something like this:
        Code:
        if (ProtectedIndicator.Lines[0].Pen.Color == Color.Red)
             // Do something
        Hopefully you know the exact color he used on the line or else the comparison wouldn't match up and your condition would never be satisfied.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks Josh...this is really close but no cigar yet. His indicator properties tell me exactly what the color is so that isn't a problem. the problem is now that I put that line of code in the indicator and it compiles without complaint. But when I reload the script, nothing prints in the output window. However, when I comment out that line I get all my normal output in the output window. Just so you know, I am using the exact code you suggested except I substituted the correct indicator name of course.

          thanks, Mike

          Comment


            #6
            Its going to be hard to tell. See if he used a plot instead of a line for coloring. Replace the ".Lines" with ".Plots". I think that will work. Also look in the error logs to see if anything popped up.
            Last edited by NinjaTrader_JoshP; 09-18-2007, 03:33 PM.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Already tried plots and nothing there. I guess there just aren't enough clues to take this any further.

              thanks for your help...At least I learned something.

              Mike

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Burak, Yesterday, 10:40 PM
              1 response
              3 views
              0 likes
              Last Post NinjaTrader_ChrisL  
              Started by AdmiralUptick, Today, 05:35 AM
              1 response
              13 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Gav_G, Today, 02:12 PM
              2 responses
              4 views
              0 likes
              Last Post Gav_G
              by Gav_G
               
              Started by Gav_G, Today, 01:41 PM
              0 responses
              5 views
              0 likes
              Last Post Gav_G
              by Gav_G
               
              Started by kweiss, Today, 01:21 PM
              0 responses
              5 views
              0 likes
              Last Post kweiss
              by kweiss
               
              Working...
              X