Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 habeebft, Today, 07:27 AM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_ChristopherS  
        Started by AveryFlynn, Today, 04:57 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Max238, Today, 01:28 AM
        4 responses
        37 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by r68cervera, Today, 05:29 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by geddyisodin, Today, 05:20 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X