n8n node to fetch OHLCV data from crypto exchanges and MetaTrader (forex/commodities like Gold XAU/USD)
npm install n8n-nodes-ohlcv-metatraderbash
docker exec -u node npm install n8n-nodes-ohlcv-metatrader -g --prefix /usr/local/lib/node_modules
`
Replace with your container name.
2. Option B: Install via n8n Settings (if using community nodes)
- Go to Settings → Community Nodes
- Click Install
- Enter: n8n-nodes-ohlcv-metatrader
- Click Install
3. Option C: Local package installation
`bash
# Copy package into container
docker cp ./n8n-nodes-ohlcv-metatrader :/tmp/
# Install from local directory
docker exec -u node sh -c "cd ~/.n8n/nodes && npm install /tmp/n8n-nodes-ohlcv-metatrader"
`
4. Restart n8n
`bash
docker restart
`
$3
`bash
cd ~/.n8n/nodes
npm install n8n-nodes-ohlcv-metatrader
`
Restart n8n.
Usage
$3
`
Data Source: Crypto Exchange
Exchange: Binance
Mode: Spot
Symbol: BTC/USDT
Timeframe: 1h
Limit: 50
`
$3
`
Data Source: MetaTrader (Forex/Commodities)
Platform: MetaTrader 5
Connection Type: MetaAPI (Cloud)
MetaAPI Token: your-token-here
Account ID: your-account-id
Symbol: Gold (XAU/USD)
Timeframe: 1h
Limit: 100
`
$3
`
Data Source: MetaTrader
Symbol: EUR/USD
Timeframe: 15m
Limit: 200
`
MetaAPI Setup
For MetaTrader data, we recommend using MetaAPI.cloud:
1. Sign up at metaapi.cloud (free tier available)
2. Add your MT4/MT5 account
3. Copy your Auth Token and Account ID
4. Use them in the n8n node
Free Tier: 1 account, historical data access, real-time streaming.
Output Format
Returns OHLCV data in a standardized format:
`json
{
"dataSource": "metatrader",
"symbol": "XAUUSD",
"timeframe": "1h",
"count": 50,
"data": [
[2045.50, 2048.75, 2044.20, 2047.30, 1250, 1704711600000],
[2047.30, 2050.10, 2046.80, 2049.50, 1340, 1704715200000]
],
"metadata": {
"platform": "mt5",
"fetchTimestamp": "2025-01-08T12:00:00.000Z"
}
}
`
Each candle: [Open, High, Low, Close, Volume, Timestamp]
Workflow Ideas
$3
`
Get OHLCV (Gold)
→ Technical Indicators (RSI, MACD, Bollinger Bands)
→ Candlestick Pattern Detector
→ Support/Resistance Levels
→ Trading Strategy
→ Execute Trade
`
$3
`
Get OHLCV (Gold) ─┐
Get OHLCV (Oil) ─┼→ Merge → Analysis → Alert
Get OHLCV (BTC) ─┘
`
$3
`
Get OHLCV (EURUSD) ─┐
Get OHLCV (GBPUSD) ├→ Correlation Analysis → Dashboard
Get OHLCV (USDJPY) ─┘
`
Compatibility
- n8n version: 0.200.0+
- Node.js: 18.0.0+
- Compatible with Docker, native installations, and n8n cloud
Nodes Included
- Get OHLCV (Crypto + MetaTrader): Fetch OHLCV data from crypto exchanges or MetaTrader
Dependencies
- ccxt: ^4.5.17 (cryptocurrency exchange API)
- Built-in Node.js modules for MetaTrader API calls
Troubleshooting
$3
Different brokers use different symbol names:
- Gold: XAUUSD, XAUUSD., GOLD
- Oil: XTIUSD, USOIL, WTI`