Renko Series Exporter
Renko charting normally needs either a broker feed that streams ticks live or a dedicated Renko chart type most MT4 builds do not offer at all. This script rebuilds a Renko brick series after the fact, from a chosen symbol/timeframe's ordinary bar history, using each bar's close price against a moving brick-size anchor - the standard close-based Renko construction. Every confirmed brick's direction, open, close and the source bar time it formed on is exported to CSV. A close-based reconstruction is a deliberate, stated choice, not an accident: a native MQL4 script has no access to real tick history over a stretch of past time, so any attempt to guess which of a bar's high or low happened first (needed for a truly tick-accurate Renko) would be fabricating a path that was never actually observed. This script only ever tests each bar's close, which is honest about what it can and cannot know from bar data alone - see Notes And Limitations. Notes and limitations This is a close-based Renko, not a tick-based one - it only ever tests each source bar's close against the current brick anchor. A bar whose high or low would have formed one or more bricks that the close price alone does not reach is invisible to this reconstruction; using a finer InpTimeframe reduces how much intrabar movement is missed, at the cost of needing more history loaded to cover the same date range. This does not implement a two-brick reversal rule some Renko variants use (requiring double the brick size to flip direction after a run). Every brick-sized move from the anchor forms a brick in that direction, matching the simplest and most common definition of Renko. Export is limited to whatever bar history the terminal currently has loaded for the requested symbol/timeframe.
Script · MT5 · v1.0 · Free
About Renko Series Exporter
Renko Series Exporter is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Symbol, Timeframe and Brick size pips. MQL source code included.
Files in the download: RenkoSeriesExporter.ex5, RenkoSeriesExporter.mq5, RenkoSeriesExporter.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Symbol | Symbol to build from ("" = this chart's symbol) | |
| Timeframe | PERIOD_CURRENT | Source timeframe for closes |
| Brick size pips | 20 | Brick size, in pips |
| Bars to process | 0 | Most recent source bars to process (0 = all available) |
| File name | RenkoSeriesExporter.csv | Output file, written into MQL5\Files\ |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Renko · Alerts · MT5 Script · MQL5 Source Code