Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Testing indicators for color

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

    Testing indicators for color

    Hi guys

    I'd like to code a strategy based on a third party indicator which changes colors under certain conditions.

    Is it possible to code some sort of test of an indicator based on its color alone?

    Such as if(indicator = red)

    do something...

    Thanks for letting me know.

    #2
    arbuthnot,

    Please find a reference sample below.



    You could use the same example to check for plot colors. I.e. PlotColors object.

    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Much obliged, Adam.

      I've looked up PlotColors in Help and could you please clarify the following:

      In PlotColors[a][b], I see that b is the barsAgo number. I understand that. I see that the a refers to the PlotIndex but I can't find PlotIndex in Help, so could you kindly explain what this is?

      Thanks again.

      Comment


        #4
        arbuthnot,

        Certainly. This would be the index of the plot as they are listed in the properties section :

        public DataSeries Avg
        {
        get { return Values[1]; }
        }

        /// <summary>
        /// </summary>
        [Browsable(false)]
        [XmlIgnore()]
        public DataSeries Default
        {
        get { return Values[0]; }
        }
        Notice the Avg plot has Values[1], the 1 would be its PlotIndex. So if you wanted to change the color of this Avg plot, you would use that index for your PlotIndex.

        Please let me know if I may assist further.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          Thanks again, Adam. I'm going to need to study this hard!

          Another trick, as suggested in another thread, is to try to reproduce this free third party indicator myself in a simpler one which would respond much more easily to NS functions, such as rising, etc.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by cmoran13, Yesterday, 01:02 PM
          0 responses
          25 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          17 views
          0 likes
          Last Post PaulMohn  
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          160 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          94 views
          1 like
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          147 views
          2 likes
          Last Post CaptainJack  
          Working...
          X