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

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, 04: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 Waxavi, Today, 02:10 AM
              1 response
              16 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by Kaledus, Today, 01:29 PM
              5 responses
              13 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by Waxavi, Today, 02:00 AM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by alifarahani, Today, 09:40 AM
              5 responses
              23 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by gentlebenthebear, Today, 01:30 AM
              3 responses
              17 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X