indicator

How to Write a Custom MQL5 Indicator with Consistent Buffer Indexing

How to Write a Custom MQL5 Indicator with Consistent Buffer Indexing

Technical revision: 1 October 2026 · Educational materialOn this pageDefine the output and its unitsChoose one array conventionComplete indicator sourceWarm-up, updates and history changesVerify the numbers before interpreting the shapeA useful first custom indicator is the distance between a closing price and its simple moving average. It exposes the central implementation problem: every input array, output buffer and loop must agree on the direction of time. Define the output and its units For each bar, calculate the average of that bar's close and the preceding N-1 closes. Output close - average. A positive value means the close is above its…
Read More
MQL5 from Scratch: Build an Expert Advisor Step by Step

MQL5 from Scratch: Build an Expert Advisor Step by Step

Technical revision: 1 October 2026 · Educational materialOn this pageDefine the behavior before writing the entryCreate a small project in MetaEditorSeparate initialization, observation and executionAdd execution only after the log makes senseCheck observable behaviorA first Expert Advisor should help you see what the terminal is doing. Start with an observable program, then add one responsibility at a time. This guide takes you from event handlers to a moving-average demonstration whose order submission is disabled by default. Define the behavior before writing the entry Our example reads two exponential moving averages on the chart symbol and timeframe. A signal is a…
Read More