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 sjsj2732, Yesterday, 04:31 AM
          0 responses
          36 views
          0 likes
          Last Post sjsj2732  
          Started by NullPointStrategies, 03-13-2026, 05:17 AM
          0 responses
          287 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          287 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          133 views
          1 like
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          95 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Working...
          X