How to include a Set file for each currency pair?

 

Hi everyone,

I  wrote a general project for trading on currency pairs. The project format is as seen in the attached picture. It contains an expert file in the source folder, some include files and some set files. I have prepared a set file for each of the currency pairs including input variables and some other definitions for each of the pairs. I can only include one of these files to the other files of the project at the same time ex. #include "EURUSD.set".

Is there any solution that, when I run the expert to a specific chart, the relevant set file will be added and used by different parts of the project automatically? I tried to use if-then or switch-case on a global include file and the error is "'if' - expressions are not allowed on a global scope". I am rather new to mql5 and I am wondering if not possible, so what is the advantage of using set files? are they only for using by strategy tester

Also if you think this way of using set file is not correct, is there any other way to have some separate parameter adjustments for each pair in an expert  project, so that by running on a pair, the related parameters will be used automatically? I mean the adjustments will be in different include files which are globally accessible by project sections.

Thank you guys in advance.


Files:
sami.jpg  38 kb
 

You are trying to drive a boat down a highway; that will not work. A set file only changes the input variables (all inputs) when the Human applies it. There is no partial, there is no automatic. Stop thinking set files.

Have your EA read a file on initialization, containing symbol, variable, and value. Or create an array of a struct with the same data, internally.