Audience
For MQL5 builders whose EA compiles but indicator values are empty, stale, inverted, or fail with array out of range around CopyBuffer.
MQL5 indicator blocker
Fix MQL5 CopyBuffer and indicator-handle errors by checking OnInit handles, copied counts, buffer indexes, ArraySetAsSeries, and runtime logs before manual retesting.
Common CopyBuffer evidence
CopyBuffer returned -1 CopyBuffer copied 0 values array out of range indicator handle is INVALID_HANDLE signal value stays 0.0
These are data-read and lifecycle failures, not proof that a strategy works or fails. Treat them as software diagnostics before the next manual test.
Audience
For MQL5 builders whose EA compiles but indicator values are empty, stale, inverted, or fail with array out of range around CopyBuffer.
Problem
CopyBuffer issues usually come from treating MQL5 indicators like MQL4 direct calls, recreating handles on every tick, reading indexes that were never copied, or skipping copied-count checks.
Outcome
Workfusionapp keeps the repair path narrow: create handles once, validate copied data, guard every buffer read, then route the code into the free desk with the smallest useful log bundle.
Support path
Start with the concrete blocker, keep the full EA context attached, then move to a reviewable output.
Indicator handles belong in OnInit, checked against INVALID_HANDLE, reused during OnTick, and released in OnDeinit when the EA shuts down.
If the EA reads buffer[2], CopyBuffer must return at least three values. Guard the count before every indexed read instead of assuming data exists.
Print handle status, copied count, buffer values, spread/session gates, and final signal state so signal bugs do not get confused with execution failures.
Workflow
The fix is not to guess a different indicator period. The fix is to prove that the handle is valid, CopyBuffer copied enough values, and the EA reads only indexes that exist.
Step 1
Paste the indicator block
Step 2
Check handle creation and release
Step 3
Guard CopyBuffer return counts
Step 4
Retest manually with signal logs
CopyBuffer handoff
Open the guide that matches the failed data-read pattern, then run the free desk with handle setup, CopyBuffer call, copied count, buffer indexes, and signal log.
Use this when the issue is handle creation, INVALID_HANDLE, MQL4-to-MQL5 indicator migration, or missing release logic.
Use this when CopyBuffer returns fewer values than the EA reads, or when current/previous-bar indexing is unsafe.
Use this when the EA needs clean signal logs before changing execution or risk controls.
Send me the CopyBuffer repair workflow
Opt in only if your MQL5 EA has CopyBuffer, indicator-handle, array-index, or signal-value problems. This captures the CopyBuffer source for conversion measurement.
Choose the workflow you want, then opt in only if you want Workfusionapp updates.
No. Create handles once in OnInit, reuse them, check CopyBuffer results, and release handles in OnDeinit.
No. It only proves the data-read layer works. Signal, risk, and execution checks still need separate review.
No. Use code, Strategy Tester or demo logs, handle status, copied counts, and buffer values. Workfusionapp does not need broker login.