Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Settings Persistance - configuration files

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

    Settings Persistance - configuration files

    I get asked quite frequently how one can load settings from a file to set the parameters - public properties of an Indicator or a Strategy:

    Although you may jump at the chance to write a generic xml or json serialiser helper class- you really don't have to get too excited and do that...

    If you are to ignore strategy optmisation and multiple instrument setting persistance then you can easily use 1 .net config file to hold settings - using an official microsoft pattern / library of storage and retrieval.

    You can load settings on a constructor or use the initialise event and then write them back at some point later such as the destructor - or commit automatic saving of data changes- you can bind the properties to the settings file directly also...

    I have attached a simple c# console application which shows some of the approaches that can be used - I wrote this for a trader who asked for NinjaScript advice - so that they can use a very simple and effective c# .net XML config file pattern...

    This shows: specifying a config file, reading, adding, writing and saving configuration values programmatically at runtime.

    These methods would be easy to implement inside an indicator or strategy and extremely robust as well as easily customised, or maintained by any c# programmer or NinjaScript developer... however you need to remove the word "static" if you copy and paste...

    Please ask if you have any questions regarding this or using it with NinjaScript...
    Attached Files
    MicroTrends
    NinjaTrader Ecosystem Vendor - micro-trends.co.uk

    #2
    is there a sample code?

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by StockTrader88, 03-06-2021, 08:58 AM
    45 responses
    3,991 views
    3 likes
    Last Post johntraderuser2  
    Started by TAJTrades, Today, 09:46 AM
    0 responses
    7 views
    0 likes
    Last Post TAJTrades  
    Started by rhyminkevin, Yesterday, 04:58 PM
    5 responses
    62 views
    0 likes
    Last Post dp8282
    by dp8282
     
    Started by realblubb, Today, 09:28 AM
    0 responses
    8 views
    0 likes
    Last Post realblubb  
    Started by AaronKoRn, Yesterday, 09:49 PM
    1 response
    19 views
    0 likes
    Last Post Rikazkhan007  
    Working...
    X