Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get Indicator values in strategy

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

    Get Indicator values in strategy

    Hi,
    I am using an indicator in my strategy .This indicator create different type of plot on a chart but in my strategy I get only one value .In what way I get all points in my strategy where lines are drawn in indicator

    #2
    Hello,

    Thanks for your note.

    When calling an indicator you can reference the value of that indicator for a historical bar by using a bar ago value.

    For example, to find the value of the SMA(9) from 5 bars back use:

    Print(SMA(9)[5]);

    Below is a link to the help guide on the DataSeries Class. This is somewhat mentioned in this article.
    http://www.ninjatrader.com/support/h...ries_class.htm


    Please let me know if this does not resolve your inquiry.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your reply.

      I know how to access the dataseries. I guess my original question was not clear enough.

      What i meant to ask was that my indicator creates many different plots on the charts. I need to access values of all those plots (lines, squares etc) But, i am only able to get value of one of them. How can i get the values of all the entities that are being plotted on the chart?

      Hope this clears things.

      Thanks.
      Irfan.

      Comment


        #4
        Hi,

        Thanks for clarifying that.

        The plots can be found in two ways.

        1) Use the Strategy Wizard. While making a condition you can specify an indicator and plot within that indicator. This will create a drop-down of the plots available. Below is a link to short video I made showing how to do this.

        http://screencast.com/t/8ddHjRkbs7

        2) Look within the code of the indicator you are calling. The public variables will be in the Properties Region.

        For example:
        Code:
        #region Properties
        /// <summary>
        /// </summary>
        [Browsable(false)]
        [XmlIgnore()]
        public DataSeries Avg
        {
        get { return Values[1]; }
        }
        This is from the MACD indicator that is included with NinjaTrader. The code you see here is responsible for making the Avg line public.


        Please let me know if this does not resolve your inquiry.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        648 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        573 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        575 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X