Sorry, I've found it.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Instruments added amount
Collapse
X
-
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.Tags: None
-
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
-
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
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
368 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
571 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment