Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Instruments added amount

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

    Instruments added amount

    How can I request how many instruments I have added with Add() function?

    Sorry, I've found it.
    Last edited by nysetrader; 03-19-2012, 07:22 PM.

    #2
    Glad to hear nysetrader - thanks for the update here.

    Comment


      #3
      Please share what you have discovered.

      Here are my Dumb Questions about problems with the Add() method.

      I am glad that nysetrader was able to solve his problem, however it still has me stumped and I would appreciate some assistance with that question, and several related ones.

      (1) Is the answer to iterate through the collection of BarsArray objects? If so, what would this code look like? Also see item 3 below. How can you tell if a particular BarsArray object exists? if(BarsArray[i]==null) condition doesn't work, it returns an out of range exception if there is no BarsArray[i].

      (2) What happens if you try to Add a non-existent symbol? Is a trappable error generated/

      (3) If you try to Add several secondary series objects and some of the Adds fail while others succeed, how can you tell which ones have failed and which have succeeded? Is there a property of the BarsArray object that gives you its symbol name?

      (4) Suppose after having Added a non primary series in the Initialize method, I decide that I don't need it anymore. Is there a way to get rid of it in some place other than initialize? Would this be done by setting the BarsArray object to null?

      (5) If an indicator is reloaded with different settings, are the non primary series objects that were loaded with the previous settings retained? If so how can I get rid of them so that I will only have new non primary series objects based on the new settings?

      (6) Should Add-ed non primary series objects be disposed of in OnTerminate?
      Last edited by Ricam; 03-25-2012, 09:43 AM.

      Comment


        #4
        Hello Ricam, unfortunately NT could officially not support dynamic adding of series in the Initialize() - this is though already on our product management enhancement tracking list under #179.

        You would know for example how many series are present in a given script by the # of BarsInProgress seen in your OnBarUpdate().

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 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
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X