npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-ohlcv-metatrader

v1.0.0

Published

n8n node to fetch OHLCV data from crypto exchanges and MetaTrader (forex/commodities like Gold XAU/USD)

Readme

n8n-nodes-ohlcv-metatrader

npm version License: MIT

This is an n8n community node that lets you fetch OHLCV (Open, High, Low, Close, Volume) data from:

  • Cryptocurrency Exchanges (Binance, Bybit, Kraken, OKX, etc.)
  • MetaTrader (Forex, Commodities like Gold/Silver, Indices)

Perfect for algorithmic trading, technical analysis, and market data workflows!

Features

🪙 Cryptocurrency Support

  • 7+ major exchanges (Binance, Bybit, Kraken, KuCoin, MEXC, OKX, Gate.io)
  • Spot and Futures trading modes
  • 1000+ trading pairs
  • Real-time and historical data

💰 Commodities & Forex Support (MetaTrader)

  • Precious Metals: Gold (XAUUSD), Silver (XAGUSD), Platinum, Palladium
  • Energy: Crude Oil (WTI), Brent Oil, Natural Gas
  • Forex: All major pairs (EURUSD, GBPUSD, USDJPY, etc.)
  • Indices: US30, S&P500, Nasdaq, DAX, FTSE
  • Custom symbol support

⚙️ Connection Methods

  • Crypto: Direct API via CCXT library
  • MetaTrader: MetaAPI.cloud (recommended) or Custom REST API

📊 Timeframes

  • 1m, 3m, 5m, 15m, 30m
  • 1h, 2h, 4h, 6h, 8h, 12h
  • 1d, 3d, 1w, 1M

Installation

In n8n (Docker)

  1. Option A: Using npm install command in n8n

    docker exec -u node <your-n8n-container> npm install n8n-nodes-ohlcv-metatrader -g --prefix /usr/local/lib/node_modules

    Replace <your-n8n-container> with your container name.

  2. Option B: Install via n8n Settings (if using community nodes)

    • Go to SettingsCommunity Nodes
    • Click Install
    • Enter: n8n-nodes-ohlcv-metatrader
    • Click Install
  3. Option C: Local package installation

    # Copy package into container
    docker cp ./n8n-nodes-ohlcv-metatrader <container>:/tmp/
    
    # Install from local directory
    docker exec -u node <container> sh -c "cd ~/.n8n/nodes && npm install /tmp/n8n-nodes-ohlcv-metatrader"
  4. Restart n8n

    docker restart <your-n8n-container>

In n8n (Native/Self-hosted)

cd ~/.n8n/nodes
npm install n8n-nodes-ohlcv-metatrader

Restart n8n.

Usage

Example 1: Fetch Bitcoin Price from Binance

Data Source: Crypto Exchange
Exchange: Binance
Mode: Spot
Symbol: BTC/USDT
Timeframe: 1h
Limit: 50

Example 2: Fetch Gold Price from MetaTrader

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

Example 3: Fetch EUR/USD Forex Pair

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:

{
  "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

Gold Trading Bot

Get OHLCV (Gold)
  → Technical Indicators (RSI, MACD, Bollinger Bands)
  → Candlestick Pattern Detector
  → Support/Resistance Levels
  → Trading Strategy
  → Execute Trade

Multi-Asset Monitoring

Get OHLCV (Gold) ─┐
Get OHLCV (Oil)  ─┼→ Merge → Analysis → Alert
Get OHLCV (BTC)  ─┘

Forex Correlation Analysis

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

MetaAPI "Symbol not found"

Different brokers use different symbol names:

  • Gold: XAUUSD, XAUUSD., GOLD
  • Oil: XTIUSD, USOIL, WTI

Use the "Custom Symbol" option to enter your broker's exact symbol name.

Container restart loses changes

If installing manually in Docker, use volume mounts or rebuild the container. See Docker Deployment Guide.

Support

License

MIT

Contributing

Contributions are welcome! Please open an issue or pull request.

Credits

  • Built for the n8n community
  • Uses CCXT for cryptocurrency data
  • Integrates with MetaAPI for forex/commodities

Keywords

n8n, trading, forex, commodities, gold, silver, oil, cryptocurrency, bitcoin, OHLCV, candlestick, technical-analysis, metatrader, mt4, mt5, binance, bybit, kraken