Skip to Content
FINSREXDocs
FINSREX LockEA

MQL5 Reference

รายละเอียดฟังก์ชันทั้งหมดของ FNX_LockEA.mqh v3.0, ค่าพารามิเตอร์, Macros และการจัดการสิทธิ์การเทรด

เอกสารอ้างอิงสำหรับนักพัฒนาและ AI Agents ในการเรียกใช้งาน FNX_LockEA.mqh เวอร์ชัน 3.0.0

ฟังก์ชันหลัก (Public API)

ฟังก์ชันเรียกใช้ในหน้าที่
FnxLockInit(...)OnInit()ตั้งค่าเริ่มต้น ตั้ง Timer และตรวจสอบสิทธิ์ครั้งแรก
FnxLockOnTimer()OnTimer()ส่ง Heartbeat และซิงค์ Telemetry ตามรอบเวลาที่เซิร์ฟเวอร์กำหนด
FnxLockDeinit()OnDeinit()หยุด Timer และบันทึกสถานะการปิด EA
FnxLockAllowed()OnTick()คืนค่า true เมื่อบัญชีได้รับอนุญาต (หรืออยู่ในช่วง Offline Grace)
FnxLockMessage()จุดใดก็ได้คืนข้อความสถานะล่าสุดจากเซิร์ฟเวอร์ (เช่น ข้อความรอการอนุมัติ)

Signature ของ FnxLockInit

int FnxLockInit(
   const string product_key,
   const int    timer_seconds = 10,
   const bool   alert_allowed_on_verify = true,
   const bool   log_enabled = true,
   const bool   history_debug_enabled = true
);
  • product_key: Product Key จากหน้า LockEA Product Detail
  • timer_seconds: รอบการทำงานของ OnTimer() (ค่าเริ่มต้น 10 วินาที)
  • alert_allowed_on_verify: แสดง Alert() เมื่อตรวจสอบสิทธิ์ผ่านครั้งแรก (true โดยค่าเริ่มต้น)
  • log_enabled: เปิดการเขียนไฟล์ Debug ที่ MQL5/Files/FNX/ea-lock-debug-{account}.log

Preprocessor Macros (กำหนดก่อน #include)

#define FNX_EA_VERSION "3.0.0"            // เวอร์ชัน EA ของคุณ
#define FNX_WEBREQUEST_TIMEOUT_MS 10000   // Timeout ของ WebRequest (ms)

สำหรับ Environment ทดสอบ (Preview/Dev) สามารถกำหนด #define FNX_LOCK_DEFAULT_HOST "dev.ea.finsrex.com" ก่อนบรรทัด #include <FNX_LockEA.mqh> เพื่อยิงเข้าเซิร์ฟเวอร์ Dev ได้

ตัวอย่างการแสดงสถานะบน Chart

void OnTick()
{
   if(!FnxLockAllowed())
   {
      Comment("LockEA: ", FnxLockMessage());
      return;
   }

   Comment("");
   // Trading logic...
}

On this page