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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        67 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        36 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        60 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X