Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accessing Data from custom Indicator

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

    Accessing Data from custom Indicator

    Hi

    I have a custom indicator thar keeps various lists of data dynamically so I don't want to create a new instance of the indicator each time I want to access data from it ... the lists it maintains need to stay in memory and be updated in background and not reset each time I access the data series provided from the indicator

    so if I place the following code in the initialize function

    MyCustomIndicator myCustomIndicator = MyCustomIndicator(parm1, parm2, parm3);

    Will the indicator work away in background keeping all its internal data so when if I say

    if (myCustomIndicator.myDSName[0] == 1)

    the calc the indicator is doing will be based on the lists it is maintaining?

    Or even better can I access data from the indicator I have added to the strategy window via the Add(myIndicator) call?

    Thanks

    Paul

    #2
    Hi Paul, yes you can access internal indicator data for reference, for this please review this reference sample - http://www.ninjatrader-support2.com/...ead.php?t=4991

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hi Paul, yes you can access internal indicator data for reference, for this please review this reference sample - http://www.ninjatrader-support2.com/...ead.php?t=4991
      Hi Bertrand

      Thanks .. so by making the Add(myIndicator) call it sets my indicator up and running and puts it on my strategy chart and then making a series public I can access it in RT ... one thing how can I be sure the indicator is updated before the strategy looks at the data?

      Thanks

      Paul

      Comment


        #4
        The exposed dataseries objects will be in sync and updated, if you need this for a non dataseries one, just use Update() to make sure you get the current value returned.

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          The exposed dataseries objects will be in sync and updated, if you need this for a non dataseries one, just use Update() to make sure you get the current value returned.

          Bertrand

          many thanks

          Paul

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          56 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          143 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          160 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          96 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          276 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X