Libraries: INI File

 

INI File:

A library to provide simple storage mechanism for expert advisors and indicators.


Library Functions

//---add new or update an existing key.
bool  SetIniKey        (string fileName, string section, string key, T value)

//--- If the key is not found, the returned value is NULL.
bool  GetIniKey        (string fileName, string section, string key, T &ReturnedValue)

bool  DeleteIniKey     (string fileName, string section, string key);
bool  DeleteIniSection (string fileName, string section);


Sample File 'my_orders.ini'

[EURUSD]
orders=4
lots=1.26
time=2018.05.20 21:10:21
comment=sell market
[USDJPY]
orders=6
lots=3.12
time=2018.05.18 02:46:03
comment=buy market

Author: amrali

 
This project would have been awesome if it had not required a DLL for it to function.
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
  • www.mql5.com
//| Expert initialization function                                   | //| Expert deinitialization function                                 | //| Expert tick function                                             | //| test1                                                            |...
 
I'm totally ok with usage of dll files specially when it's kernel32 from windows itself, however, there is a minor issue and that is if you want to write into C:\, windows permission system will become a problem, to compensate for that, if you don't want to change the permissions on windows root directory, you can use the local file address for the data folder's file subfolder.
 
Alireza Khodakarami:
I'm totally ok with usage of dll files specially when it's kernel32 from windows itself, however, there is a minor issue and that is if you want to write into C:\, windows permission system will become a problem, to compensate for that, if you don't want to change the permissions on windows root directory, you can use the local file address for the data folder's file subfolder.

This method tries to escape MT5 sandbox. It is not a complete solution, yet.

You are free to use whatever you like. Thanks.