Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1436

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
Then it seems that this is the case. Apparently, during genetic optimisation, the parameters responsible for turning oscillators on/off are strongly dominant with respect to oscillator parameters. That is, when breeding the next generation, one parent that has the gene for the switched off oscillator will kill a bunch of offspring from other parents with the switched on gene for this oscillator. That is, these descendants will be discarded by the condition of incorrect parameters, will not give offspring, and evolution will quickly come to a deadlock.
Try to look at the behaviour of the tester at full optimization on a short interval of the testing period. Will there be unnecessary omissions of combinations in this case?
Yes, the problem is in the combination: genetic algorithm + blocking of certain combinations. With full optimisation everything works correctly, but full optimisation will take an unrealistically long time.
I was hoping that I could somehow show the optimiser that such variants are unacceptable and that he should not even try to use them and focus on other variants. In fact, it happens as you wrote.
You can create a freelance job and choose from among the developers who apply for your job
https://www.mql5.com/fr/job
Hello!
How does the code that allows the Expert Advisor to trade at certain hours look like in MQL5? I can't port it from MQL4.
void OnTick()
{
double PriceBid=MarketInfo(0,MODE_BID);
double time = Hour() + Minute()*0.01;
Comment("datum ",inpoint,
"\n", "step ",iter,
"n", "time ",time,
"n," "price," Bid,
"\n", "price", PriceBid);
if(time <= Stop_work_time)
{
//if(Type==BUY || Type==ALL)newbuyorder();
//if(Type==SELL || Type==ALL)newsellorder();
in();
takestop();
stoporders();
connected();
delorders();
}
else
{
takestop();
delorders();
}
}
void OnTick()
{
double PriceBid=MarketInfo(0,MODE_BID);
double time = Hour() + Minute()*0.01;
Comment("datum ",inpoint,
"{n", "step ",iter,
"n", "time",time,
"n," "price," Bid,
"\n", "price", PriceBid);
if(time <= Stop_work_time)
{
//if(Type==BUY || Type==ALL)newbuyorder();
//if(Type==SELL || Type==ALL)newsellorder();
in();
takestop();
stoporders();
connected();
delorders();
}
else
{
takestop();
delorders();
}
}
The implementation of this task in mq5 can be repeated using
MqlDateTime
Good morning and good mood everyone!
Dear experts!!! Could you please tell me what is wrong in this code (the part where the error appears periodically is highlighted in yellow)?
Why periodically, then works in the strategy tester, then does not work and in the log appears this message:
Regards, Vladimir.
Good morning and good mood, everyone!
Dear experts!!! Please tell me what is wrong in this code (the part of the code where the error appears periodically is highlighted in yellow):
Why periodically, then works in the strategy tester, then does not work and in the log appears this message:
Regards, Vladimir.
Put a check after the line
if Data < 1 something, somehow shout.
Put a check after the line
if Data < 1 something, shout out somehow.
Good morning Alexey, thanks for the hint! I will try it now.
Regards, Vladimir.
Instead of:
I put it in:
and everything worked. It draws theline steadily and as it should, but only now at each new start of the Expert Advisor in the strategy tester messages appear periodically:
Will this, then will somehow negatively affect the code or can I "forget" about it?
Regards, Vladimir.
Will this, then, somehow negatively affect the code or can I "forget" about it?
Regards, Vladimir.
What prevents you from doing this
What's stopping you from doing this
Hello, Vladimir! It's age. Brains are not as flexible and fast as young ones. )))
Thank you for your option.
Regards, Vladimir.
P.S. Fixed. Everything works perfectly!!! Once again, thank you all very much for your help!