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 ldjaisohy, Today, 12:59 AM
    0 responses
    5 views
    0 likes
    Last Post ldjaisohy  
    Started by TheCatTrader, Yesterday, 04:52 PM
    1 response
    9 views
    0 likes
    Last Post s.kinra
    by s.kinra
     
    Started by oreameon, Today, 12:41 AM
    0 responses
    6 views
    0 likes
    Last Post oreameon  
    Started by tff2011, Today, 12:11 AM
    0 responses
    5 views
    0 likes
    Last Post tff2011
    by tff2011
     
    Started by Imnarjowps, Yesterday, 10:55 PM
    0 responses
    4 views
    0 likes
    Last Post Imnarjowps  
    Working...
    X