Compile error ជាបញ្ហាដែល MetaEditor បង្ហាញមុន code អាចដំណើរការ។
សូម copy error list ពេញលេញ រួមទាំង line និង column ផ្ញើទៅ AI។
📌 Compile Error Debug Prompt
EN: Fix these MQL5 compile errors. I will paste the error list, line numbers, and the related code section. Explain the cause briefly, then provide the corrected code. Do not change the trading logic unless it is required to compile.
KH: ជួសជុល MQL5 compile errors ទាំងនេះ។ ខ្ញុំនឹងផ្ញើ error list, line numbers និង code section ពាក់ព័ន្ធ។ សូមពន្យល់មូលហេតុខ្លីៗ បន្ទាប់មកផ្តល់ code ដែលបានកែ។ កុំប្តូរ trading logic លុះត្រាតែចាំបាច់ដើម្បីឱ្យ compile បាន។
៥. Prompt សម្រាប់ Runtime Error និង Journal Log
Runtime error កើតឡើងពេល EA កំពុងដំណើរការ។ ឧទាហរណ៍ array out of range,
invalid indicator handle, division by zero ឬ order send failed។ អ្នកគួរយក log ពី Experts tab
និង Journal tab មកឱ្យ AI ពិនិត្យ។
📌 Runtime Log Debug Prompt
EN: Analyze this MT5 EA runtime error using the Experts and Journal logs. Find the likely cause, explain which function or condition is failing, and provide a safe fix with extra logging so I can test it again.
KH: វិភាគ runtime error នេះរបស់ MT5 EA ដោយប្រើ Experts និង Journal logs។ រកមូលហេតុដែលអាចកើតឡើង, ពន្យល់ថា function ឬ condition មួយណាបរាជ័យ ហើយផ្តល់ safe fix រួមជាមួយ logging បន្ថែម ដើម្បីឱ្យខ្ញុំ test ម្តងទៀត។
៦. Prompt សម្រាប់ Invalid Stops / Lot Size
បញ្ហា invalid stops និង invalid volume ជួបញឹកញាប់ក្នុង EA ព្រោះ broker មាន rule ផ្សេងៗ
ដូចជា minimum stop distance, lot step, min lot, max lot និង digits ខុសគ្នា។
📌 Broker Rule Debug Prompt
EN: Fix the invalid stops or invalid volume problem in this MQL5 EA. Add normalization for price and lot size, check SYMBOL_TRADE_STOPS_LEVEL, SYMBOL_VOLUME_MIN, SYMBOL_VOLUME_MAX, SYMBOL_VOLUME_STEP, and print clear debug messages before sending orders.
KH: ជួសជុលបញ្ហា invalid stops ឬ invalid volume ក្នុង MQL5 EA នេះ។ បន្ថែម normalization សម្រាប់ price និង lot size, ពិនិត្យ SYMBOL_TRADE_STOPS_LEVEL, SYMBOL_VOLUME_MIN, SYMBOL_VOLUME_MAX, SYMBOL_VOLUME_STEP និង print debug messages ឱ្យច្បាស់ មុនបញ្ជូន order។
៧. Debug Logic Error: EA មិនបើក Trade ឬបើកខុស
ពេល EA compile បាន ប៉ុន្តែមិនបើក trade អាចមកពី condition តឹងពេក, new bar filter,
spread filter, session filter, indicator value មិនទាន់ ready ឬ symbol/timeframe ខុស។
ត្រូវឱ្យ AI បន្ថែម Print log ដើម្បីដឹងថា condition មួយណាមិន pass។
📌 Logic Debug Prompt
EN: This EA compiles but does not open trades as expected. Add step-by-step debug Print messages for every entry condition, spread filter, session filter, indicator value, and trade permission check. Do not change the strategy yet; first help me identify which condition is blocking trades.
KH: EA នេះ compile បាន ប៉ុន្តែមិនបើក trade តាមដែលរំពឹងទុក។ សូមបន្ថែម debug Print messages ជាជំហានៗ សម្រាប់ entry condition នីមួយៗ, spread filter, session filter, indicator value និង trade permission check។ កុំទាន់ប្តូរ strategy; សូមជួយរកថា condition មួយណាកំពុង block trade។
៨. Debug Position ជាន់គ្នា និង MagicNumber
EA មួយចំនួនបើក position ជាន់គ្នា ព្រោះមិនបាន filter symbol, MagicNumber ឬ position type។
ក្នុង MT5 គណនី netting និង hedging ក៏មាន behavior ខុសគ្នា ដូច្នេះត្រូវឱ្យ AI បញ្ជាក់ logic ឱ្យត្រឹមត្រូវ។
📌 Duplicate Position Debug Prompt
EN: Fix the duplicate position problem in this MT5 EA. Add a reliable function that checks existing positions by symbol, MagicNumber, and position type. Support both hedging and netting account behavior where possible, and explain the logic clearly.
KH: ជួសជុលបញ្ហា position ជាន់គ្នា ក្នុង MT5 EA នេះ។ បន្ថែម function ដែលពិនិត្យ positions ដែលមានស្រាប់តាម symbol, MagicNumber និង position type ឱ្យបានត្រឹមត្រូវ។ សូមគាំទ្រ hedging និង netting account behavior តាមដែលអាចធ្វើបាន ហើយពន្យល់ logic ឱ្យច្បាស់។