Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Where/how to initiate an object list...

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

    Where/how to initiate an object list...

    Hello,

    I would like to understand where/how to initiate an object list within an indicator so that it doesn't get reset if it has collected any data when I change the chart paramaeters, e.g change the instrument or timeseries.

    I have tried declaring in the namspace and then instigating in State==State.configure using If logic e.g; if(xxx.Count<1) xxx= new List<Object>(); however it resets whenever I change chart parameters.

    #2
    Hello b16_aln,

    Thanks for your post.

    You would not be able to retain the information in the script when reloading the script. Please see the help guide in understanding a script life cycle: https://ninjatrader.com/support/help...fecycle_of.htm

    A solution would be to write your list data to a file and then read it back in when the script reloads. Here are links to writing and reading files:
    https://ninjatrader.com/support/help...o_read_fro.htm
    https://ninjatrader.com/support/help...o_write_to.htm
    https://ninjatrader.com/support/help..._propertie.htm
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bosajin, Today, 03:48 PM
    0 responses
    1 view
    0 likes
    Last Post bosajin
    by bosajin
     
    Started by Renorail, Today, 01:38 PM
    2 responses
    13 views
    0 likes
    Last Post bltdavid  
    Started by BrianARice, Today, 01:16 PM
    0 responses
    8 views
    0 likes
    Last Post BrianARice  
    Started by Ousher, Today, 09:08 AM
    0 responses
    6 views
    0 likes
    Last Post Ousher
    by Ousher
     
    Started by Unsuitable, Today, 08:41 AM
    0 responses
    14 views
    0 likes
    Last Post Unsuitable  
    Working...
    X