• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Proper use cases for ISeries<T> vs plain vanilla variables/objects

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

    Proper use cases for ISeries<T> vs plain vanilla variables/objects

    Hi I've been working with NinjaTrader 8 for a little while now and things are going well. However, I'm wondering about best practices in and around the subject of employing ISeries<T> objects, namely when it's recommended to use them vs a plain-vanilla variable/object. I have a crude (and possibly grossly incorrect) recollection of reading that it's better to use a Series object than a plain-vanilla variable/object whenever multi-timeframe or multi-instrument is being used because it is guaranteed to sync properly. Is this true or am I just misinformed. I've been leaning heavily on using Series objects for just about everything out of ignorance and/or concern for data/syncing-integrity, but I'm starting to have enough of them that I'm worried about how expensive they are in terms of either memory or processing. Thanks for shedding any light on this dark corner for me.

    #2
    Hello Calebg,

    Thank you for the question.

    This is really going to depend on the use case. A series is a collection of values over time, just like the bars on your chart. A Variable depends on the scope where you defined it. A variable can only hold 1 value and depending on where it was defined that may or may not persist for greater than 1 bar. If a variable is defined in the class scope, the value will persist for each bar unless you set it to something else.

    Do you need a different value on each bar, or is this something more static like a period or number that is used frequently? This will determine if a series is needed or not. If a changing value needs to be recorded for each bar, a series is likely the best choice if you need to refer back to those bars of data. If you need a value that changes but do not need to refer back to historical values, a variable will likely work for that use case.

    Multi-series scripts can introduce additional complications however the above items still apply. The use case will still determine if you need to use a series or not.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by faisamtrader, Yesterday, 10:03 PM
    0 responses
    3 views
    0 likes
    Last Post faisamtrader  
    Started by johnnybegoode, Yesterday, 08:11 PM
    0 responses
    2 views
    0 likes
    Last Post johnnybegoode  
    Started by Bionian, Yesterday, 02:47 PM
    2 responses
    21 views
    0 likes
    Last Post Bionian
    by Bionian
     
    Started by RickB60, Yesterday, 01:55 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by filopearson, Yesterday, 01:18 PM
    6 responses
    11 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X