Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Testing for a certain indicator pen color

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

    Testing for a certain indicator pen color

    I'm testing for a certain pen color in my indicaor script. I get a compile error when I use either of the following code.

    if (Plots[0].Pen.Color == Color.Lime)

    or

    if(Plots[0].Pen.Color.Lime == True)


    How can I test to see if the color of my indicator plot is lime?

    Thanks;

    #2
    Hi Drummer,

    There's unfortunately not a supported property you can read from to get the color of an indicator plot for a particular bar.

    If you change plot color by assigning PlotColors to a color value, then you could use that. You're then reading the value you assigned for this property.
    Print(PlotColors[0][0].ToString());
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply.

      If I have the same indicator loaded twice for the same chart, is there any way I can determine that there is more than one instance of the indicator on the chart, within the indicator code?

      Example:

      if(this indicator is loaded more than once within the same chart and on the same panel)
      {
      do Something
      }

      If I had the Simple MA loaded twice in the same chart, with different parameters and both displayed on the same panel, how could I have some differently functionality between the two (like write text for one and different text for the other) within the script?


      Thanks

      Comment


        #4
        This is just not possible in our framework. You apply an instance of an indicator to your chart, and there is no communication possible among multiple instances of this indicator.

        To get different functionality you would need to develop different indicators. You could also code some control so that it can do different things depending on user input selection, like a bool or enum input. This sample can help with this idea, by setting a MA plot differently depending on the input selection made.
        http://www.ninjatrader.com/support/f...ead.php?t=3420
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Thank you for your reply.

          One more idea; is it posible for a script to know if more than one indicator is loaded on a chart?

          Comment


            #6
            That is not currently possible in our framework.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Is there a list in document form, of all the methods available to ninjascript like I see when intellisense tries to complete syntax for me?

              Comment


                #8
                You can find an alphabetical reference of NinjaScript methods at the link below.
                http://www.ninjatrader.com/support/h..._reference.htm
                JasonNinjaTrader Customer Service

                Comment


                  #9
                  that reference has A LOT of methods missing that I have found using intellisense. Ex; the methods for the Indicator class, the chart control class, the instrument class, the dataseries class....

                  Comment


                    #10
                    That's true. There are some items you can access and use that are not documented or supported. You could check out this thread to get an introduction to some undocumented tips and tricks.

                    http://www.ninjatrader.com/support/f...ad.php?t=22435
                    Ryan M.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by mballagan, Today, 01:02 PM
                    0 responses
                    3 views
                    0 likes
                    Last Post mballagan  
                    Started by larkmail, Today, 12:30 PM
                    1 response
                    5 views
                    0 likes
                    Last Post NinjaTrader_Kate  
                    Started by omermirza, Today, 12:39 PM
                    0 responses
                    9 views
                    0 likes
                    Last Post omermirza  
                    Started by Danila, Today, 11:08 AM
                    1 response
                    11 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by dbida001, Today, 10:31 AM
                    1 response
                    5 views
                    0 likes
                    Last Post NinjaTrader_ChristopherJ  
                    Working...
                    X