BerelzBridge
- Utilities
-
Barend Willem Van Den Berg
"Disciplined trader with a background in education management and assessment. Now fully dedicated to systematic trading during my pension. I leverage my experience in structured evaluation to test and optimize trading strategies. My current focus is on integrating Artificial Intelligence (AI) tools - Version: 2.0
- Updated: 21 February 2026
- Activations: 5
BerelzBridge Pro
Read also comment sectie above for more.
MT5-to-JSON data bridge for all timeframes with account information.
Overview
BerelzBridge Pro is an MT5 indicator that exports live market data to a JSON file on disk. It writes bid and ask prices, spread, tick volume, daily statistics, account information and OHLCV bars for all 9 timeframes. The file is updated at a configurable interval with a default of 2 seconds.
The indicator runs alongside Expert Advisors on the same chart without conflict. It does not use DLLs, WebRequest or any external dependencies. Multiple instances can be run on different charts to export data for several instruments at the same time.
What It Exports
- Bid and Ask prices with full digit precision
- Spread in points
- Tick volume for the current bar
- Daily high, low and open
- OHLCV bars for M1, M5, M15, M30, H1, H4, D1, W1 and MN1
- Up to 500 bars per timeframe, configurable
- Account data: balance, equity, margin, free margin, floating profit, leverage and currency
- Broker data: company name and server name
How It Works
- Drag BerelzBridge Pro onto any chart in MetaTrader 5.
- The indicator writes a JSON file to the MQL5/Files/ folder at the configured interval.
- Read the JSON file from any external application.
Output file: symbol_stream.json (for example xaueur_stream.json).
Location: MQL5/Files/.
Output Format
The exported JSON file contains the following fields:
{ "symbol": "XAUEUR", "updated": "2025-01-15 14:32:07", "version": "pro", "platform": "MetaTrader 5", "bid": 1923.45, "ask": 1923.67, "spread": 22, "tick_volume": 14, "daily_high": 1931.20, "daily_low": 1910.85, "daily_open": 1915.30, "bars_m5": [ {"time": "2025-01-15 14:25:00", "o": 1921.10, "h": 1923.80, "l": 1920.50, "c": 1923.45, "v": 312}, {"time": "2025-01-15 14:30:00", "o": 1923.45, "h": 1924.10, "l": 1922.90, "c": 1923.67, "v": 198} ], "account": { "balance": 10000.00, "equity": 10234.50, "margin": 500.00, "free_margin": 9734.50, "profit": 234.50, "leverage": 100, "currency": "USD" }, "broker": { "name": "Broker Name Ltd", "server": "BrokerName-Live" }, "_end": true }
Bars are ordered oldest to newest. The spread field is in broker points. Each enabled timeframe adds its own bars array: bars_m1, bars_m5, bars_m15, bars_m30, bars_h1, bars_h4, bars_d1, bars_w1, bars_mn1.
The daily_high, daily_low and daily_open fields are present only when InpExportDailyStats is enabled. The daily_open field may be absent on the first export after the indicator is attached, until the daily bar history is available.
The _end field is always the last field in the file. External applications can check for its presence to confirm that the file was fully written and is not truncated.
Use Cases
- Read live prices and account data from Python, Node.js or any programming language
- Build custom dashboards that display price, equity and margin information
- Log price history to a database for research purposes
- Create alert systems that monitor price levels or spread changes
- Calculate position sizes based on current balance and risk parameters
- Monitor margin usage and equity changes in external applications
- Feed multi-timeframe OHLCV data into pattern analysis applications
Input Parameters
- InpSymbol - symbol to stream (leave empty for current chart symbol)
- InpUpdateSeconds - export interval in seconds (default: 2)
- InpBarsCount - number of bars per timeframe (default: 500)
- InpExportM1 through InpExportMN1 - enable or disable each timeframe individually
- InpExportAccount - export account information (default: on)
- InpExportBroker - export broker information (default: on)
- InpExportDailyStats - export daily high, low and open (default: on)
Installation
- Purchase and download from MQL5 Market.
- The indicator appears in Navigator under Indicators and Market.
- Drag BerelzBridge Pro onto any chart.
- Configure timeframes and data options, then click OK.
- The JSON file appears in the MQL5/Files/ folder.
Dashboard Template included
A free open-source dashboard template is available on GitHub. It reads the BerelzBridge JSON output and displays price, account metrics and technical data. Request the repository link in the product comments section.
Code Examples
Read exported data (Python):
import json, time while True: with open("path/to/MQL5/Files/xaueur_stream.json") as f: data = json.load(f) print(f"Bid: {data['bid']} Ask: {data['ask']} Spread: {data['spread']}") print(f"Equity: {data['account']['equity']} Margin: {data['account']['margin']}") time.sleep(2)
Calculate a moving average from OHLCV bars:
import json with open("path/to/MQL5/Files/xaueur_stream.json") as f: data = json.load(f) bars = data["bars_m5"] average = sum(b["c"] for b in bars[-20:]) / 20 print(f"20-bar average close: {average:.2f}")
Calculate position size from account data:
equity = data["account"]["equity"] risk_fraction = 0.02 stop_loss_points = 150 point_value = 1.0 risk_amount = equity * risk_fraction position_size = risk_amount / (stop_loss_points * point_value) print(f"Position size: {position_size:.2f}")
Requirements
- MetaTrader 5
- Compatible with any broker and any instrument
- Runs on Windows, macOS (via Wine) and Linux
Disclaimer
Berelz Capital Engineering is a private project and not a registered company. All products are provided as-is without any guarantee or warranty. Use at your own discretion.
