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 andrewtrades, Today, 04:57 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    6 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    436 views
    0 likes
    Last Post Delerium  
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    9 views
    0 likes
    Last Post FAQtrader  
    Started by rocketman7, Today, 09:41 AM
    5 responses
    20 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X