Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Retrieving exposed values from another indicator

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

    Retrieving exposed values from another indicator

    I'm somewhat new to NinjaTrader and I'm trying to determine if any of the following actions are programmable in Ninjascript?
    • Retrieve the exposed values from another indicator without knowing the parameter values used in that indicator?
    • Retrieve exposed values from another indicator plotted on a different chart (may be a chart for the same symbol but a different time frame, or a totally different symbol)?
    • Call another indicator without specifying parameter values, i.e. just use the default parameter values for that indicator?
    If the answer to any of these is yes, a link to a sample of the code would be most welcome.
    Thanks


    #2
    Hello Scotty33,

    Where you have inquired:
    "Retrieve the exposed values from another indicator without knowing the parameter values used in that indicator?"

    The intelli-prompt will show you the parameters necessary to call an indicator, you will need to call the indicator and add a dot and this will list the methods and properties of the indicator.
    https://ninjatrader.com/support/help...elliprompt.htm


    Where you have inquired:
    "Retrieve exposed values from another indicator plotted on a different chart (may be a chart for the same symbol but a different time frame, or a totally different symbol)?"

    There are no documented or supported methods of getting information from another chart, but using undocumented custom c# this may be possible. Below is a link to an example. (edited, was missing link)


    Instead of trying to get information from other charts, you can always add a data series with AddDataSeries() and use this as the input series for an indicator.
    https://ninjatrader.com/support/help...dataseries.htm
    https://ninjatrader.com/support/help.../barsarray.htm
    https://ninjatrader.com/support/help...inprogress.htm


    Where you have inquiried:
    "Call another indicator without specifying parameter values, i.e. just use the default parameter values for that indicator?"
    That absolutely depends on the indicator itself. Typically the indicator is going to require that the proper parameters be used in the indicator call.
    Last edited by NinjaTrader_ChelseaB; 12-07-2020, 01:28 PM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea,
      Thanks for your reply. However, it doesn't quite provide what I'm looking for. Maybe if I explain what I'm trying to achieve, it will make my questions clearer.
      I have an indicator (call it indicator A) that I built on another platform that I’m trying to convert to NT8. Indicator A picks up the values plotted on the chart by another indicator (may be indicator B, or indicator C, or whatever).
      In indicator A, I don’t need to specify which other indicator plotted the values. All I need to do is reference the chart ID number of the other indicator and the number of the subgraph (exposed value) that I’m interested in, e.g. ID 3. SG4, meaning subgraph #4 from the indicator output whose ID on the chart is #3. Indicator A then can access all of the data values from the other indicator’s exposed subgraph. So, the user of indicator A just needs to provide two parameters: the chart ID of the other indicator and the number of the subgraph. In that way, if the user wants to compare indicator A’s results when using indicator B’s values with those when using indicator C’s or D’s or…, then it’s just a case of inserting the relevant chart ID and subgraph ID, both of which are available from drop down menus listing items currently plotted on the chart. There’s no need in indicator A to specify the indicator names or parameters (or their settings) for indicator B, indicator C, etc.

      However, it seems that in NT8, indicator A must be coded to include the names of all potential indicators that might be used to plot the other curve AND all of their parameter values.
      If the other platform functionality can’t be replicated in NinjaScript, do you know if it would be possible in C# ?
      Thanks.

      Comment


        #4
        Hello Scotty33,

        You have to call a hosted indicator from a host script to get the values from it.

        Meaning you have call the indicator like any other indicator, and use the plot values or exposed values calculated in it.

        The host script can do the plotting, drawing, and rendering.

        If the script is a strategy, you can use AddChartIndicator to automatically add the indicator that does the plotting, drawing, rendering to the chart.

        Yes, the host script must be coded for every indicator it would call. NinjaScript is written in standard C# .NET 4.8. NinjaScript are just tools written in C# that NinjaTrader has pre-created for you to use, like OnBarUpdate(), AddChartIndicator(), AddDataSeries(), BarsInProgress, calling an indicator, etc.

        Below is a link to a forum post with helpful information about getting started with C# and NinjaScript.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello Chelsea.
          >> Yes, the host script must be coded for every indicator it would call.

          That's what I was afraid of.
          Anyway, thanks for the links.

          Comment

          Latest Posts

          Collapse

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