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 geddyisodin, Today, 05:20 AM
    6 responses
    34 views
    0 likes
    Last Post geddyisodin  
    Started by trilliantrader, Today, 03:01 PM
    0 responses
    3 views
    0 likes
    Last Post trilliantrader  
    Started by pechtri, 06-22-2023, 02:31 AM
    9 responses
    122 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by frankthearm, 04-18-2024, 09:08 AM
    16 responses
    67 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by habeebft, Today, 01:18 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X