27 lines
1.4 KiB
MQL5
27 lines
1.4 KiB
MQL5
//+------------------------------------------------------------------+
| |||
//| ErrorCodes.mqh |
| |||
//| Synthetic Test Harness for MetaTrader 5 |
| |||
//| Institutional Architecture in MQL5 - Part 1 Series |
| |||
//+------------------------------------------------------------------+
| |||
#ifndef SYNTHETIC_TEST_HARNESS_ERROR_CODES_MQH
| |||
#define SYNTHETIC_TEST_HARNESS_ERROR_CODES_MQH
| |||
| |||
//+------------------------------------------------------------------+
| |||
//| Named error constants for synthetic test scenarios. |
| |||
//+------------------------------------------------------------------+
| |||
#define SYNTH_ERR_NONE 0 // No error - execution succeeded
| |||
#define SYNTH_ERR_REQUOTE 10004 // TRADE_RETCODE_REQUOTE
| |||
#define SYNTH_ERR_REJECT 10006 // TRADE_RETCODE_REJECT
| |||
#define SYNTH_ERR_TIMEOUT 10012 // TRADE_RETCODE_TIMEOUT
| |||
#define SYNTH_ERR_PRICE_OFF 10021 // TRADE_RETCODE_PRICE_OFF
| |||
| |||
//+------------------------------------------------------------------+
| |||
//| IsExecutionError: guard function replacing raw int comparisons. |
| |||
//+------------------------------------------------------------------+
| |||
bool IsExecutionError(const int error_code)
| |||
{
| |||
return(error_code != SYNTH_ERR_NONE);
| |||
}
| |||
| |||
//+------------------------------------------------------------------+
| |||
#endif
|