
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
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!