• 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

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 stoner, Today, 09:13 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Tyler  
    Started by [email protected], Today, 08:56 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by itrader46, Today, 08:56 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by guidoisot, Today, 08:43 AM
    2 responses
    6 views
    0 likes
    Last Post guidoisot  
    Started by waldoalvarez, Today, 08:00 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Jim  
    Working...
    X