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 charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          60 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          145 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          161 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          97 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          283 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X