HYROLEAN

hyrDefs.mqh

Mar 17th, 2026 (edited)
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.16 KB | Money | 0 0
  1. // hyrDefs.mqh
  2. //   by 2025-2026 hyrolean
  3. //---------------------------------------------------------------------------
  4. // Local:: <DataFolder>\MQLx\Include\User\hyrDefs.mqh
  5. // URL:: https://pastebin.com/iHZKAWqC
  6. //---------------------------------------------------------------------------
  7.  
  8. // オーダーフラグ
  9. #define FLAG_BUY      1
  10. #define FLAG_SELL     2
  11. #define FLAG_DUPLEX   4
  12. #define FLAG int
  13.  
  14. // オープンポジション
  15. #ifdef __MQL5__
  16. #define OP_BUY              0
  17. #define OP_SELL             1
  18. #define OP_BUYLIMIT         2
  19. #define OP_SELLLIMIT        3
  20. #define OP_BUYSTOP          4
  21. #define OP_SELLSTOP         5
  22. #define OP_BUYSTOPLIMIT     6 // MT5 固有
  23. #define OP_SELLSTOPLIMIT    7 // MT5 固有
  24. #define OP_CLOSEBY          8 // MT5 固有
  25. #endif
  26. #define OP int
  27.  
  28. FLAG inline OpToFlag(OP op) {
  29.   switch(op) {
  30.     case OP_BUY:
  31.     case OP_BUYLIMIT:
  32.     case OP_BUYSTOP:
  33. #ifdef __MQL5__
  34.     case OP_BUYSTOPLIMIT:
  35. #endif
  36.       return FLAG_BUY;
  37.     case OP_SELL:
  38.     case OP_SELLLIMIT:
  39.     case OP_SELLSTOP:
  40. #ifdef __MQL5__
  41.     case OP_SELLSTOPLIMIT:
  42. #endif
  43.       return FLAG_SELL;
  44. #ifdef __MQL5__
  45.     case OP_CLOSEBY:
  46.       return FLAG_DUPLEX;
  47. #endif
  48.   }
  49.   return 0;
  50. }
  51.  
  52. // チケット番号の型
  53. #ifdef __MQL4__
  54. #define TICKET int
  55. #else
  56. #define TICKET ulong
  57. #endif
  58.  
  59. // マジック番号の型
  60. #ifdef __MQL4__
  61. #define MAGIC int
  62. #else
  63. #define MAGIC long
  64. #endif
  65.  
  66. // 基軸時間の種類
  67. enum ENUM_TIMEBASE {
  68.   TIMEBASE_GMT,               // Greenwich Mean Time (GMT)
  69.   TIMEBASE_LOCAL,             // Local Time
  70.   TIMEBASE_SERVER             // Server Time
  71. };
  72.  
  73. // タイムアクション
  74. enum ENUM_TIMEACT {
  75.   TIMEACT_NONE,               // None ( EA closes positions automatically )
  76.   TIMEACT_FORCE_CLOSE_ALL,    // Force Close All positions
  77.   TIMEACT_FORCE_CLOSE_LONG,   // Force Close Long positions
  78.   TIMEACT_FORCE_CLOSE_SHORT,  // Force Close Short positions
  79.   TIMEACT_SOFT_CLOSE_ALL,     // Close All positions if profits are Positive
  80.   TIMEACT_SOFT_CLOSE_LONG,    // Close Long positions if profits are Positive
  81.   TIMEACT_SOFT_CLOSE_SHORT    // Close Short positions if profits are Positive
  82. };
  83.  
  84.  
Tags: Mt4 Mt5
Advertisement
Add Comment
Please, Sign In to add comment