Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 873
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
We simply write functions into .mqh file, connect this file to Expert Advisor #include <file_name.mqh> if in the directory include, or #include "file_name.mqh" if in the folder with the main program (Expert Advisor, indicator, script). That is all. The functions that are in the file will be visible in the Expert Advisor/indicator/script. The main thing is to connect the file before calling any function from the Expert Advisor/indicator/script that is in the file.
Good. So, this EA will work, or something is missing?
What the hell - outputs the SRC in one line. I will repeat it by simple copying
We simply write functions into .mqh file, connect this file to the Expert Advisor #include <file_name.mqh> if in the directory include, or #include "file_name.mqh" if in the folder with the main program (Expert Advisor, indicator, script). That is all. The functions that are in the file will be visible in the Expert Advisor/indicator/script. The main thing is to connect the file before calling any function from the Expert Advisor/indicator/script that is in the file.
repetition:
//--------------------------------------------------------------------
#include "Variables.mqh" //Variables description
#include "CritOpen.
mgh" //Include "CritOpen.mgh" //include "Criteria for closing orders
//--------------------------------------------------------------------
int init()
{
Variables();//Function Variables Description
CritOpen(); //Function Criteria for opening of orders
CritClose();//Function Criteria for closing orders
return;
}
int start()
{
if (Orders==0) //If there are no open or pending orders
{
CritOpen();
}
else
{
CritClose();
}
return;
}
//---------------------------- end of code?--------------------------
Will it work?
Gentlemen, will the Expert Advisor described above work, or is there something else that must be included, and I have missed it?
Or, for example, I have doubts about correctness of initialization of included files - is init() function described correctly?
Thanks.
Gentlemen, will the Expert Advisor described above work, or is there something else that must be included, and I have missed it?
Or, for example, I have doubts about correctness of initialization of included files - is init() function described correctly?
Thanks.
It will be. You can write all functions in one inclusion, it will also work. You can leave the .mq4 extension and call it the same way, it will work just as well.
It will. You can write all functions in one inclusion, it will also work. You can leave the .mq4 extension and call it the same way, it will work just as well.
Oops! Something is missing. Says in the log that it can't load my EA and can't open the.ex4 file.
General error [2] .What does this mean?
Oops! Something is missing. Says in the log that it can't load my EA and can't open the .ex4 file.
General error [2] .What does this mean?
Help me retrieve the maximum value of an indicator in an EA. I have an indicator that calculates the maximal value through the array without any problems, but now I'm not sure how to pass it to the EA or to transfer the code of the indicator to the EA or something else ... in general, I'm stumped. :(
Did it compile?