HYROLEAN

hyrGlobal.mqh

Mar 17th, 2026 (edited)
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.89 KB | Money | 0 0
  1. // hyrGlobal.mqh
  2. //   by 2025-2026 (c)hyrolean
  3. //---------------------------------------------------------------------------
  4. // Local:: <DataFolder>\MQLx\Include\User\hyrGlobal.mqh
  5. // URL:: https://pastebin.com/2PdBW6NQ
  6. //===========================================================================
  7. #include <User/hyrDefs.mqh>   // https://pastebin.com/iHZKAWqC
  8. #ifdef __MQL5__
  9. #import "User/hyrGlobal.ex5"  // https://pastebin.com/Lw82F2MN
  10. #else
  11. #import "User/hyrGlobal.ex4"  // https://pastebin.com/hk9XfDiv
  12. #endif
  13. //---------------------------------------------------------------------------
  14.  
  15. //グローバル変数の設定
  16. void GlobalSettings(
  17.   string entryName,
  18.   int maxSlippage=10,
  19.   int maxSpread=50,
  20.   int orderRetry=10,
  21.   int orderRetrySleep=100,
  22.   uint orderRetryDuration=1000  );
  23.  
  24. #ifdef __MQL4__
  25. //注文の色設定
  26. void OrderColorSetting(
  27.   color colLongArrow=clrBlue,
  28.   color colShortArrow=clrRed  );
  29. #endif
  30.  
  31. //エラーログ出力
  32. void PrintLastError(string sender="");
  33.  
  34. //メッセージ出力
  35. void PrintMessage(string message, string sender="");
  36.  
  37. //vとcompの距離が1Pointのサイズに収まっているかどうか
  38. bool InnerPoint(double v, double comp);
  39.  
  40. //基軸時間の現在時刻を返す
  41. datetime BaseTime(ENUM_TIMEBASE TimeBase);
  42.  
  43. //マーケットで扱えるようにロットサイズを補正して返す
  44. double AdjustMarketLots(double lots);
  45.  
  46. //すでに注文済みかどうか
  47. FLAG AlreadyOrdered(FLAG orderFlag, MAGIC magic=-1);
  48.  
  49. //注文の発注
  50. TICKET MakeOrder(OP entryType, double lots, double sl, double tp, string detector,
  51.   MAGIC magic, double entryPrice=0.0, datetime expiration=0);
  52.  
  53. //注文発注サブルーチン
  54. TICKET MakeOrderSub(OP entryType, double entryPrice, double lots, double sl=0.0, double tp=0.0,
  55.   string comment=NULL, MAGIC magicNumber=0, datetime expiration=0, color orderColor=clrNONE);
  56.  
  57. #ifdef __MQL5__
  58. //リミット価格付き逆指値注文の発注
  59. TICKET MakeOrderStopLimit(double stopPrice, double limitPrice, double lots,
  60.   double sl, double tp, string detector, MAGIC magic, datetime expiration=0);
  61. #endif
  62.  
  63. //発注済オーダーのStoplossとTakeprofitの変更
  64. bool ModifyOrderSlTp(TICKET ticket, double sl, double tp);
  65.  
  66. //発注済予約注文の取消
  67. bool WithdrawOrder(TICKET ticket, color orderColor=clrNONE);
  68.  
  69. //注文の決済
  70. bool CheckoutOrder(OP orderType, TICKET orderTicket, double orderLots);
  71.  
  72. //注文の全決済
  73. bool CheckoutOrderAll(FLAG orderFlag, MAGIC magic=-1, double lotsDenom=1.0);
  74.  
  75. //時間動作制御(戻り値: 非0=アクティブ時間)
  76. bool ControlTimeAction(
  77.   datetime TimeTick, datetime TimeStart, datetime TimeEnd,
  78.   datetime &NextStartTime, MAGIC magic=-1, ENUM_TIMEACT TimeAction=TIMEACT_NONE);
  79.  
  80. //000,000,000表示
  81. string DoubleToAmount(double inputdata, int dig);
  82.  
  83. //---------------------------------------------------------------------------
  84. #import
  85.  
Tags: Mt4 Mt5
Advertisement
Add Comment
Please, Sign In to add comment