How to add external parameters for EA with include files.

 
Dear all,
  I  want to add external parameters for my EA while adding include files, as shown below:
#include <test.mqh>
extern int       ExtParam1;
But with the "#include <test.mqh>" statement,  I cannot back test the EA while specifying the "ExtParam1" optimization parameters.I have to divide the EA into multi-modules and >MQH. It's necessary to have include statement as shown in the above snippet code.  How to add external parameters for EA with include files.

and at the same time, specifying the value. start. step and stop value in the backtester? Or Is there any other means to bypass this requirement?

Thanks a lot for your time and consideration, and, your prompt reply.

Your sincerely,

tzm..

 
tzm:
Dear all,
  I  want to add external parameters for my EA while adding include files, as shown below: But with the "#include <test.mqh>" statement,  I cannot back test the EA while specifying the "ExtParam1" optimization parameters.I have to divide the EA into multi-modules and >MQH. It's necessary to have include statement as shown in the above snippet code.  How to add external parameters for EA with include files.

and at the same time, specifying the value. start. step and stop value in the backtester? Or Is there any other means to bypass this requirement?

Thanks a lot for your time and consideration, and, your prompt reply.

I don't understand what your issue is ?    why can't you run it in the Strategy Tester ?  what doesn't happen that should ?  or what does happen that shouldn't ?
 
RaptorUK:
I don't understand what your issue is ?    why can't you run it in the Strategy Tester ?  what doesn't happen that should ?  or what does happen that shouldn't ?


Dear RaptorUK,


  Thanks a lot for your prompt reply. Sorry that I havenot explained my question clearly in the prvious post. My question is: Now I cannot set the "inputs" after clicking the Expert Properties in the strategy tester....THe prototype of the EA is simplified in the attached file "test.mq4". Hopfully, I have explained it clearly this time. ....

Files:
test.mqh  1 kb
 
tzm:

Dear RaptorUK,


  Thanks a lot for your prompt reply. Sorry that I havenot explained my question clearly in the prvious post. My question is: Now I cannot set the "inputs" after clicking the Expert Properties in the strategy tester....THe prototype of the EA is simplified in the attached file "test.mq4". Hopfully, I have explained it clearly this time. ....

Are you importing what is in test.mqh or including it ?  the mqh suggests you are importing it . . .

#property library

 but your mq4  file does not show the import but an include instead . . .  I've not worked with imports or includes but what you have looks wrong to me.

 

File.mql4 is a library (NOT a mqh include file)

you compile the library to ex4

You import the library in your testpparams.mq4

File.mqh is an include file

You include it in your main.mq4 just as if the code was actually inserted into your testpparams.mq4

You're not trying to make testpparams.mq4 a library are you?

 
WHRoeder:

File.mql4 is a library (NOT a mqh include file)

you compile the library to ex4

You import the library in your testpparams.mq4

File.mqh is an include file

You include it in your main.mq4 just as if the code was actually inserted into your testpparams.mq4

You're not trying to make testpparams.mq4 a library are you?


Dear RaptorUK and Dear WHRoeder,
  Thank you for your prompt and instructive reply. I made a test just now, if I use import statement instead of the original include statement, the extern variable can be set successfully in the backtester, so the problem can be closed....
  Test.mqh can be to store the shared functions for mutiple EAs. But in order to re-use the functions in test.mqh, i should use #import statement instead of the #include statement...
Reason: