Skip to content

Latest commit

 

History

803 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Topics: metatrader5, mql5, pine-script, expert-advisor, mql4, metatrader, forex-trading, automated-trading, webhook, tradingview, tradingview-webhook, alert-bot, auto-trading, mt4, mt5, trading-bot, tradingview-to-mt5, mt5-webhook-bridge, pine-script-mt5

Information

TradingView to MT5 / MT4 webhook bridge for traders who design strategies in Pine Script and want them executed on a real broker account. The project receives TradingView alerts as JSON, validates them, applies risk rules, and routes them to MetaTrader as live orders, with full logging and a no-code template editor.

🌉 TradingView to MT5/MT4

Webhook-driven bridge that turns TradingView alerts into live MT5 / MT4 orders, with JSON templates, risk sizing, and full execution audit.


Stars Forks Issues Platform License

Preview


📸 Screenshot

Webhook bridge UI


🎬 Demo

Demo

Why a Bridge?

TradingView gives you the best charts and Pine Script gives you strategy logic, but MetaTrader is where the broker lives.

This project closes the gap with:

  • A local webhook listener
  • A JSON alert template editor
  • A direct route from alert to MT5 / MT4 fill

What It Does

TradingView to MT5/MT4 receives Pine Script alerts and converts them into broker orders with deterministic, auditable rules.

Module Description
Webhook Listener Local HTTPS endpoint for alerts
JSON Validator Schema-checked alert payloads
Template Engine Maps fields to order parameters
Risk Sizer Lot from balance / equity / fixed
Order Router Sends to MT5 / MT4 broker
Replay Log Every webhook stored & replayable

Features

Feature Description
Local Webhook TLS-ready endpoint
JSON Templates Visual field mapping
Multi-Strategy Per-strategy routing rules
Symbol Mapper TradingView symbol to broker
Lot Modes Fixed / % balance / Pine-supplied
MT4 / MT5 Support Platform selection system
Replay Tool Re-fire any past alert
Time Filter Block alerts outside session
Duplicate Guard Same alert ignored within N sec
Health LED Listener status indicator

System Behavior

  • Stateless per request, idempotent on retries
  • Rejects unsigned / malformed payloads
  • Replay never duplicates live orders
  • Survives platform reconnects cleanly

Quick Start

Requirements:

  • Windows 10 / 11
  • .NET 8+
  • Visual Studio 2022
git clone https://github.com/your-username/tradingview-to-mt5.git

Open solution → Press F5


How to Use

  1. Launch app
  2. Select MT4 / MT5
  3. Enter broker login
  4. Start webhook listener
  5. Copy URL into TradingView alert
  6. Paste JSON template body
  7. Click ARM ALERTS
  8. Fire alerts and watch fills

Interface Logic

[TV]    {"symbol":"EURUSD","side":"buy","sl":1.0830,"tp":1.0890}
[HOOK]  POST /alert  200 OK
[MAP]   broker symbol = EURUSD.r
[ORDER] #128973 FILLED 1.0852
  • Green row = filled
  • Yellow row = validated, waiting fill
  • Red row = invalid / rejected
  • Gray row = duplicate suppressed

Roadmap

  • Webhook listener
  • JSON templates
  • Order router
  • Real MT5 bridge
  • Cloud relay node
  • Multi-broker fan-out
  • Strategy stats dashboard

Contributing

1. Fork
2. git checkout -b feature/new-feature
3. git commit -m "Add feature"
4. git push
5. Open PR

License

MIT


TradingView to MT5/MT4 · v1.0

About

TradingView-to-MT5 webhook bridge. Receives MetaTrader JSON alerts from Pine Script strategies, validates each payload with a passphrase and forwards BUY / SELL orders to MT5 / MT4 via named pipe in milliseconds for automated alert execution.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages