CSetFileReader - MetaTrader 5 Library | MT5 EA Download - MetaTrader 5 Resources


Class providing a simple MetaTrader settings file reading mechanism.
//+------------------------------------------------------------------+ //| CSetFileReader class. | //| Appointment: Class that provides a mechanism for reading from settings files. | //+------------------------------------------------------------------+ Class CSetFileReader { people : CSetFileReader( blank ) { } ~CSetFileReader( blank ) { } //--- Method to load settings file boolean load( const string filename); //--- Methods to access protected data string filename ( blank ) const { return (m_name); }; int count( blank ) const { return ( array_size (m_entries)); } boolean contains key( const stringkey ) constant ; //--- Method to copy data from collection integer copy to ( string &dst_keys[], const boolean with value = 0 ) const ; //--- Method template for accessing data < type name > boolean Try to get the value ( const stringkey , T and return value) const ; Boolean Try to get the value ( const StringKey , StringReturnValue (&ReturnValue) const ; }; //+------------------------------------------------------------------+
Usage scenarios:
The Expert Advisor will be added to multiple charts with different symbols or time frames.
In addition to certain settings, each instance of the EA must have different settings from other instances, depending on the current chart symbol and other settings common to all charts.
Copy the settings files from "MQL5\Presets" to the "MQL5\Files" folder and modify them using a text editor.
Each instance of the expert advisor will then have its new settings initialized event applied.
To start initializing events, simply switch the current chart timeframe.
Include an expert testing consultant to explain the idea.
Settings of multiple running instances of the Expert Advisor can be easily changed using a text editor.
You edit the .set file and then switch the chart time range for the new settings to take effect.
Multi-trading EA trading:
Extensive settings for multiple symbols cannot be easily managed from the user interface.
https://www.mql5.com/en/articles/650
https://www.mql5.com/en/code/24777
https://www.mql5.com/en/docs/standardlibrary/generic/chashmap
https://github.com/EA31337/EA31337-classes/blob/eddf613bd81fbf9e001f5622c358ac1e76aeb2b3/SetFile.mqh
Attachment download
📎 csetfilereader.mqh (13.77 KB)
📎 settingsreader_ea.mq5 (9.47 KB)
📎 audusd.set (0.46 KB)
📎eurusd.set (0.46 KB)
Source: MQL5 #27741
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •