As for return and break - the point is that you have to develop a programming style that avoids "rake". That's why it is not desirable to use return inside the loop's body.
As for return and break - the point is that you have to develop a programming style that avoids "rake". That's why return should not be used inside the loop's body.
I am able to close trades like this: if(Hour()>=23) etc..... But i can't figure out -
How to write a function, so that the deal was closed not at a fixed time, but after some time had passed. I.e. a deal is opened, two hours pass after it is opened, the deal is closed.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Explain why: "it's better to exit a loop by break instead of return"?
I exit a function by return and only the loop by break. What is the trick?
Sorry, I don't check this thread often.
As for return and break - the point is that you have to develop a programming style that avoids "rake". That's why it is not desirable to use return inside the loop's body.
Sorry, I don't visit this thread often.
As for return and break - the point is that you have to develop a programming style that avoids "rake". That's why return should not be used inside the loop's body.
For the aesthetes:
http://c2.com/cgi/wiki?IsBreakStatementArchaic
for aesthetes:
Somebody...come forward....PLEASEZZZZZZZZ
Hello!
Please help a novice programmer to understand:
I am able to close trades like this: if(Hour()>=23) etc..... But i can't figure out -
How to write a function, so that the deal was closed not at a fixed time, but after some time had passed. I.e. a deal is opened, two hours pass after it is opened, the deal is closed.
Maybe there is a ready-made function of this kind, if you can tell me
Maybe there is a ready-made function of this kind, if you can tell me.
There is a function, but it's not Kim's. OrderOpenTime()
if (TimeCurrent() - OrderOpenTime() > 2*60*60)
{
// ........
OrderClose(...);
}
There is a function like this, only it's not Kim's. OrderOpenTime()
if (TimeCurrent() - OrderOpenTime() > 2*60*60)
{
// ........
OrderClose(...);
}
Thank you!