Loading…

Buffer Export Button

Reading raw indicator values off the chart one bar at a time is slow and error prone. This tool attaches a single "Export buffers to CSV" button; clicking it reads a named custom indicator's buffer(s) via iCustom across exactly the bars currently visible on the chart (so scrolling and zooming the chart first controls what gets exported) and writes them, one row per bar, to a timestamped CSV file. iCustom's calling convention needs to know an indicator's parameter list in advance, and this tool has no way to discover an arbitrary indicator's inputs at runtime - MQL4 has no reflection over another program's input set. It therefore calls the target indicator with NO extra parameters, meaning whatever defaults are compiled into that indicator's own inputs are what gets exported. This is stated plainly rather than pretending the tool can pass through custom settings it has no way to know about. Notes and limitations - Only exports buffers of an already-compiled custom indicator reachable by name under MQL4\Indicators; it cannot export the chart's own built-in indicators (Moving Average, RSI, etc. drawn via the terminal's native tools rather than a custom .ex4). - Calls the target indicator with its own default input values only - see above for why. To export with different settings, change the target indicator's own compiled defaults and recompile it first. - Maximum 8 buffers per export; a target with more buffers needs two passes with different InpBufferCount/manual column selection. - The CSV lands in the terminal's sandboxed MQL4\Files folder, not a user-chosen path - MQL4 file functions cannot write outside that sandbox.

Indicator · MT4 · v1.0 · Free

About Buffer Export Button

Buffer Export Button is an indicator for MetaTrader 4. It has 5 settings, such as Indicator name, Buffer count and File prefix. MQL source code included.

Files in the download: BufferExportButton.ex4, BufferExportButton.mq4, BufferExportButton.txt.

Settings

SettingDefaultWhat it does
Indicator nameExamples\\AwesomeTarget indicator (path under MQL4\Indicators, no extension)
Buffer count1Number of buffers to export (1-8)
File prefixBufferExportOutput filename prefix (goes in MQL4\Files)
X offset10Button horizontal offset
Y offset20Button vertical offset

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria