Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // hyrDefs.mqh
- // by 2025-2026 hyrolean
- //---------------------------------------------------------------------------
- // Local:: <DataFolder>\MQLx\Include\User\hyrDefs.mqh
- // URL:: https://pastebin.com/iHZKAWqC
- //---------------------------------------------------------------------------
- // オーダーフラグ
- #define FLAG_BUY 1
- #define FLAG_SELL 2
- #define FLAG_DUPLEX 4
- #define FLAG int
- // オープンポジション
- #ifdef __MQL5__
- #define OP_BUY 0
- #define OP_SELL 1
- #define OP_BUYLIMIT 2
- #define OP_SELLLIMIT 3
- #define OP_BUYSTOP 4
- #define OP_SELLSTOP 5
- #define OP_BUYSTOPLIMIT 6 // MT5 固有
- #define OP_SELLSTOPLIMIT 7 // MT5 固有
- #define OP_CLOSEBY 8 // MT5 固有
- #endif
- #define OP int
- FLAG inline OpToFlag(OP op) {
- switch(op) {
- case OP_BUY:
- case OP_BUYLIMIT:
- case OP_BUYSTOP:
- #ifdef __MQL5__
- case OP_BUYSTOPLIMIT:
- #endif
- return FLAG_BUY;
- case OP_SELL:
- case OP_SELLLIMIT:
- case OP_SELLSTOP:
- #ifdef __MQL5__
- case OP_SELLSTOPLIMIT:
- #endif
- return FLAG_SELL;
- #ifdef __MQL5__
- case OP_CLOSEBY:
- return FLAG_DUPLEX;
- #endif
- }
- return 0;
- }
- // チケット番号の型
- #ifdef __MQL4__
- #define TICKET int
- #else
- #define TICKET ulong
- #endif
- // マジック番号の型
- #ifdef __MQL4__
- #define MAGIC int
- #else
- #define MAGIC long
- #endif
- // 基軸時間の種類
- enum ENUM_TIMEBASE {
- TIMEBASE_GMT, // Greenwich Mean Time (GMT)
- TIMEBASE_LOCAL, // Local Time
- TIMEBASE_SERVER // Server Time
- };
- // タイムアクション
- enum ENUM_TIMEACT {
- TIMEACT_NONE, // None ( EA closes positions automatically )
- TIMEACT_FORCE_CLOSE_ALL, // Force Close All positions
- TIMEACT_FORCE_CLOSE_LONG, // Force Close Long positions
- TIMEACT_FORCE_CLOSE_SHORT, // Force Close Short positions
- TIMEACT_SOFT_CLOSE_ALL, // Close All positions if profits are Positive
- TIMEACT_SOFT_CLOSE_LONG, // Close Long positions if profits are Positive
- TIMEACT_SOFT_CLOSE_SHORT // Close Short positions if profits are Positive
- };
Advertisement
Add Comment
Please, Sign In to add comment