A question of style?... properties files and refactoring....

 

Hi

 

this is a general question about project patterns in MQL4. I got my first decent EA working. In the interest of expediency i stuck all logic in one ea file first. I then refactored it to be a bit more OO and created some classes but everything remained in the one file. Before I develop further I'm trying to put a bit of structure on my project and make it look like a proper s/w project and I am wondering about usual patterns in MQL4. for example ..... I had most variables set as input parameters so i could easily toggle them and test.business logic variables such as a moving average variable and non business logic ones such as perhaps a FLAG to turn on and off logging. When I refactored the first class into its own files it was missing variables of both types. These variables would be required by multiple files/classes if I refactored properly.

1. Is there a pattern similar to a properties file that could be made availability to all files without having to have a specific function for each one and manually declaring the class/function in the relevant class -- almost defeats the purpose.

2. Is there a way to make input variables be resolved at runtime time rather than compile time. Perhaps a better way of phrasing can i created place_holders for these in files/classes that would satisfy a compiler but would only be realised by the EA input dialog at runtime?

3. Is there a more standard MQL pattern that solves my above problem?

 

/W 

 
There are no implemented generic patterns. You may implement properties handling yourself, just the file access is limited to a sandbox.
 
Ovo:
There are no implemented generic patterns. You may implement properties handling yourself, just the file access is limited to a sandbox.
ok, thanks for the reply...
Reason: