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
Victor, I think the switch is better here - it's faster and more visual.
Oh, by the way -- reasonable optimization of work in the tester -- I've been using it lately.
By the way, the function is called FindLastOpenTime and returns a ticket.
May be it is better so?
Victor, I think the switch is better here - it's quicker and clearer.
It's really clearer.
TheXpert:
By the way, the function is called FindLastOpenTime, ...
if (lOrderOpenTime<OrderOpenTime()) { lOrderOpenTime=OrderOpenTime(); Res=OrderTicket(); }
it may start working right at -1, I'm not quite sure why it needs an external if...else. Return, imho, is really better lOrderOpenTime, then return -1 will allow to catch the error.is it logical to use this kind of thing?
always killed the logic of such a construction in cyclic operands :
if (!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue;
if (OrderSymbol() != Symbol()) continue;
if (OrderMagicNumber() != imagic) continue;
if (!(tip==-1 || isOrderType(tip))) continue;
see help :
The continue statement transfers control to the beginning of the nearest external while or for statement, causing the beginning of the next iteration. This operator is the opposite of break.
It is not clear at all, and if an order doesn't pass the conditions then what? Exit the loop? if continue operator is directly opposite to break operator ...
For me, the standard logic is clearer and more understandable :
Puncture #2. Logic (logic) and brevity have little correlation.
A prime example right out of MQL, which, by the way, many people are not squeamish about using.
This is not logic -- it's a murder of logic. In addition, it is a potential breeding ground for implicit errors.
Not sure where the puncture is? And why the second one? If it is the second, where is the first?
For those who don't have an office or zip.
Dima add something for those who don't have metaeditor.exe :-)
Victor, congratulations again !