Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Howto access indicator data series

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

    Howto access indicator data series

    Hello,

    I'm writing an indicator script for NT8 which wants to access the input series selected by the user in the indicator property window of a chart window. E.g. opening indicator dialog of chart window, add new indicator and select for indicator "Input series" a nested indicator WMA(EURUSD(1 Minute), 14).
    Within my indicator script access to Input[0] seems to return the Close value, but not the WMA(14) as selected in the indicator properties.
    How can I access the configured input series w/o hardcoding WMA(14) in the script? "Input" series does not work.

    Thanks
    Frank
    Last edited by TraderFrank; 02-29-2016, 09:37 PM.

    #2
    Hello TraderFrank,

    Thank you for your note.

    The behavior you see is contrary to what should occur. Can you advise if this is NinjaTrader 7 or 8?

    Can you attach a screenshot of the settings in the Indicators menu of the chart?

    Comment


      #3
      Hi Patrick,
      thanks for your fast response. I think I did not tell the whole story, which might explain why it does not work.
      In my indicator I'm calling a function asynchronously from a button I have installed in the chart window.

      private
      void OnCallbackData(object action)
      {
      var delta = new double[inputSize];
      for(int bar = 0; bar < inputSize; bar++)
      delta[bar] = Input.GetValueAt(bar);
      }
      What I see is that Input seems to return CLOSE, but not WMA(EURUSD(1 Minute), 14) I have configured in the indicator property "Input series". I assume due to the asynchronous call, the WMA(EURUSD(1 Minute), 14) wasn't calculated when I want to access it? Can you confirm!
      If that's the case, what would be the right approach to access another indicator value from a asynchronous indicator function?

      Thanks
      Frank

      Comment


        #4
        Hello TraderFrank,

        Thank you for your patience.

        In this case we would need to hard code the indicator into the code.

        You could instantiate the indicator to help preserve performance. For example:
        Code:
        private WMA myWMA;
        Then in Initialize():
        Code:
        myWMA = WMA(14);
        And in OnBarUpdate:
        Code:
        myWMA.Update();
        myWMA[0];

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        574 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        333 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
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X