Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to assign array value to Series array

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

    How to assign array value to Series array

    Hi,
    I have created a series string array MyStockName.
    private Series<string[]>MyStockName;

    and created a string array symbol
    string [] symbol = new string[] { "V","AAPL","MA","IBM","MSFT"};

    In OnBarUpdate(),
    I would like to assign the string array symbol value to MyStockName[0] during every bar.
    How can I do?

    Is it the following code?
    MyStockName[0]= symbol;

    Thanks.


    Attached Files

    #2
    Hello heiheilau2000,

    Thanks for your post.

    You will need to create MyStockName = new Series<string[]>(this, MaximumBarsLookBack.Infinite); in state.DataLoaded as this is when you have the bars loaded.

    Reference: https://ninjatrader.com/support/help...tatechange.htm

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X