Try Catch is a pretty standard feature of programming languages. I don't need to justify why it is important or useful, I'm just making the note here for anyone searching for documentation on "mql try" that it doesn't exist.
- Not the Grail, just a regular one - Bablokos!!!
- Multi timeframe Indicator
- 'Close all'/'Open' tools
Matthew Colter:
Try Catch is a pretty standard feature of programming languages. I don't need to justify why it is important or useful, I'm just making the note here for anyone searching for documentation on "mql try" that it doesn't exist.
Try Catch is a pretty standard feature of programming languages. I don't need to justify why it is important or useful, I'm just making the note here for anyone searching for documentation on "mql try" that it doesn't exist.
There was discussion about that on Russian forum, it seems Metaquotes don't want to include them, not really sure why.
Why don't you make your "TryCatch" yourself like:
#define foreach(_I,all) int _I= all; while(_I-->0)
#define TryContinue(_TRY) ResetLastError(); if (!_TRY) { continue; }
void OnStart() {
foreach(o,OrdersHistoryTotal()) {
TryContinue( OrderSelect(o,SELECT_BY_POS,MODE_HISTORY) );
Comment(OrderTicket(),", ",OrderSymbol(),", ",OrderOpenTime());
DebugBreak();
}
DebugBreak();
}
#define TryContinue(_TRY) ResetLastError(); if (!_TRY) { continue; }
void OnStart() {
foreach(o,OrdersHistoryTotal()) {
TryContinue( OrderSelect(o,SELECT_BY_POS,MODE_HISTORY) );
Comment(OrderTicket(),", ",OrderSymbol(),", ",OrderOpenTime());
DebugBreak();
}
DebugBreak();
}
As easy to read as a short story. ;)
Carl Schreiber:
Why don't you make your "TryCatch" yourself like:
You are hilarious :) do you have any funny ways for creating async methods?
Why don't you make your "TryCatch" yourself like:
int _I;
#define foreach(_I,all) int _I= all; while(_I-->0)
bool _TRY;
#define TryContinue(_TRY) ResetLastError(); if (!_TRY) { continue; }
void OnStart() {
foreach(o,OrdersHistoryTotal()) {
TryContinue( OrderSelect(o,SELECT_BY_POS,MODE_HISTORY) );
Comment(OrderTicket(),", ",OrderSymbol(),", ",OrderOpenTime());
}
}
#define foreach(_I,all) int _I= all; while(_I-->0)
bool _TRY;
#define TryContinue(_TRY) ResetLastError(); if (!_TRY) { continue; }
void OnStart() {
foreach(o,OrdersHistoryTotal()) {
TryContinue( OrderSelect(o,SELECT_BY_POS,MODE_HISTORY) );
Comment(OrderTicket(),", ",OrderSymbol(),", ",OrderOpenTime());
}
}
As easy to read as a short story. ;)
Matthew Colter:
You are hilarious :) do you have any funny ways for creating async methods?
You are hilarious :) do you have any funny ways for creating async methods?
I just shortened my suggestion.
But what do you mean: "do you have any funny ways for creating async methods?"
Carl Schreiber:
I just shortened my suggestion.
I just shortened my suggestion.
XD nice
I know try-catch as well as foreach from Powershell. But #define is not creating async methods!
Please use the link button (control-K.) for links See the
difference: http://www.ossp.org/pkg/lib/ex/
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