Errors, bugs, questions - page 1520

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
There is no other way yet.
We have discussed introducing a new exit command that would immediately terminate the program, but there are unresolved issues here
That's too bad. Yes, an exit() like in C++ would be nice. Nowadays, pulling the response of nested functions into the calling one is rather problematic. And there are no universal libraries.
Alternatively, you can create a separate function to delete all the objects of the program and call it when the condition to delete the program from the terminal is met, followed byExpertRemove(), in this case it should terminate faster... though not for sure :)
As I've written before, and was suggested before in an article on this site, in case of an error in a deep nested function, you can call division by 0 or exit outside the array. But it is not nice.
Yes, and it's not only in OOP (as far as I understood, you mean it). Simply - if an error cannot be fixed, the program will be terminated.
Stops, but not immediately
I do not understand, is it correct to work with ExpertRemove() in indicators or not?
I think there is a function for indicators, or it is not relevant anymore
ChartIndicatorDelete();
I do not understand, is it correct to work with ExpertRemove() in indicators or not?
No. ExpertRemove() is overlapped in the indicators.
"Stops, but not immediately" is said about ExpertRemove in general. This function does not interrupt program operation.
No. ExpertRemove() is overlapped in the indicators.
"Stops, but not immediately" is said about ExpertRemove in general. This function does not interrupt the operation of the program.
Please give an example. Give the source code of the indicator to illustrate the problem
At the same time, the IsStopped function's help says that the program operation is stopped after 3 seconds if there is a command to terminate an mql-program.
And if while(true) is replaced with while(!IsStopped()), the indicator completes successfully when removed from the chart.
A funny reason for the Internal Compiler Error ( function used in the indicator):
void SaveData ( uint handle_, int wrdata_, int interv_, string dpath_, int tmode_, int tmult_, long ctime_, long& ltime_ )
{
int ierr, wrtint;
// ----
if ( interv_ > 0 ) // work mode
{
if ( MQLInfoInteger ( MQL_TESTER ) == 0 ) { wrtint = interv_; } // has no meaning
else{ wrtint = interv_ * tmult_; } // doesn't matter
//
if ( ( ctime_ - ltime_ ) >= ( wrtint * 60 ) ) // if this line is commented out, the error will disappear
{
// some code to save the data ... has no meaning - tested
//
ltime_ = ctime_; // in general does not matter either
} // if ( ( ctime_ - ltime_ ) >= ( wrtint * 60 )
} // if ( interv_ > 0 )
// ----
return;
} // void SaveData
( Sorry, I didn't use SRC button intentionally, because I can't select the necessary parts of the text with it )
The cure is obvious, but you should agree - it's a rather funny glitch. :)))
One brokerage company has a commission of 16x2 dollars for a turnover of 1 million. They have apparently set a commission of 16 dollars in the server settings. And now when testing on their server commission 16x2 is deducted from each transaction regardless of its lot size, i.e. adequate test can be done only with 10 lots.
Is it their lack of skill in setting servers or a real limitation of MT5? What exactly can I advise them to do on the servers, so that the commission is processed correctly in the tester?