Loading…

Standalone HTML Chart Exporter

Sharing a chart usually means a screenshot, which is flat and fixed the moment it is taken - no zoom, no hover for exact values, no way to scroll back further. This script exports the same information as one HTML file that opens in any browser on any machine, including one with no MetaTrader and no internet connection at all: every script byte, every style rule and every line of chart-drawing JavaScript is written directly into the file, nothing is loaded from a CDN or any other external source. The exported chart draws candles on an HTML canvas, shows a crosshair tooltip with exact open/high/low/close on hover, zooms with the mouse wheel and pans by dragging - a small but genuinely interactive chart, not a static image wearing an HTML extension. Trade markers (buy/sell open and close, from this symbol's open and closed history) are drawn as coloured triangles at their exact time and price. Bar and trade data are embedded as plain numeric JavaScript array literals - [[time,open,high,low,close],...] - rather than JSON with quoted string fields. That choice is deliberate: every value in the whole payload is a number, so there is nothing to escape between the MQL4 string that builds the file and the JavaScript that reads it, which is what keeps a script like this from breaking the moment a comment or a symbol name contains a character JSON would need quoted. Notes and limitations - The chart is a snapshot at export time. It does not update live and does not reconnect to MetaTrader - that is the point, it is meant to be viewed anywhere, including offline. - Only this symbol's own trades are marked; a hedge or correlated position on a different symbol is not shown. - A trade marker's horizontal position snaps to the nearest exported bar at or before its own time, so a trade opened between two bars is drawn at the bar immediately preceding it, not at a sub-bar offset. - The chart window defaults to the most recent 120 of the exported bars; zooming out with the mouse wheel reveals the rest up to InpBarsToExport. - Very large InpBarsToExport values make a correspondingly larger HTML file, since every bar's four prices are embedded as text. A few thousand bars is still a small file; tens of thousands starts to add up.

Script · MT5 · v1.0 · Free

About Standalone HTML Chart Exporter

Standalone HTML Chart Exporter is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 6 settings, such as Bars to export, Include trade markers and History trades too. MQL source code included.

Files in the download: StandaloneHtmlChart.ex5, StandaloneHtmlChart.mq5, StandaloneHtmlChart.txt.

Settings

SettingDefaultWhat it does
Bars to export300Number of most recent bars to include
Include trade markerstrueDraw markers for this symbol's trades
History trades tootrueInclude closed trades, not just open ones
Magic filter0Only this magic (0 = all magics)
Magic filter onfalseApply the magic filter above
Output file nameOutput file, blank = auto name from symbol and period

How to install

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

Download the PDF guide

Tags: Alerts · MT5 Script · MQL5 Source Code

MQL4 & MQL5 scripts · PolyMaria