Skip to content

Latest commit

 

History

296 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SupabaseBridge Expert Advisor

A cross-platform Expert Advisor for MT4/MT5 that sends real-time trading metrics to Supabase via webhook.

🚀 Quick Start

  1. Compile the EA:

    • Open MetaEditor (F4 in MetaTrader)
    • Open SupabaseBridge.mq4 (for MT4) or SupabaseBridge.mq5 (for MT5)
    • Compile (F7) to generate .ex4 or .ex5 files
  2. Configure WebRequest URLs:

    • Go to Tools > Options > Expert Advisors
    • Enable "Allow WebRequest for listed URL"
    • Add: https://bhhrmriyuhqygmnzqjyr.supabase.co
  3. Set Parameters:

    • Drag EA to chart
    • Configure AccountID, UserID, and APIKey
    • Enable live trading
  4. Monitor:

    • Check Journal tab for "✅ Data sent successfully"
    • View data in your Supabase dashboard

📦 What's Included

  • SupabaseBridge.mq4 - MT4 source code
  • SupabaseBridge.mq5 - MT5 source code
  • EA_Installation_Guide.md - Detailed setup instructions
  • README.md - This overview

⚙️ Configuration

Parameter Description Example
AccountID Your unique account identifier "fusion123"
UserID Your Supabase user UUID "uuid-string"
APIKey Your MT_API_KEY from Supabase "your-api-key"
SendIntervalSeconds Data transmission frequency 60
SendOpenTrades Include open positions false
DebugMode Enable detailed logging true

📊 Data Transmitted

Account Metrics:

  • Balance, Equity, Margin, Free Margin
  • Profit/Loss, Growth, Drawdown
  • Margin Level, Broker Info

Trade History:

  • Last 50 closed trades
  • Trade details (symbol, lots, prices, times)
  • Profit/loss per trade
  • Optional: Open positions

Platform Info:

  • Auto-detects MT4 vs MT5
  • Broker name and account details

🔒 Security Features

  • HTTPS encryption for all data transmission
  • API key authentication
  • No trading permissions (read-only)
  • Local data processing only

🖥️ macOS Compatibility

Designed specifically for MetaTrader running natively on macOS:

  • No VPS required
  • No Windows dependencies
  • Lightweight and memory-efficient
  • Silent background operation

📝 JSON Payload Example

{
  "account_id": "fusion123",
  "user_id": "your-supabase-user-id",
  "broker_name": "FusionMarkets",
  "platform": "MT4",
  "balance": 1234.56,
  "equity": 1200.00,
  "margin": 100.00,
  "free_margin": 1100.00,
  "margin_level": 1100.00,
  "profit": -34.56,
  "drawdown": 2.5,
  "growth": 1.2,
  "trades": [
    {
      "trade_id": "78910",
      "symbol": "EURUSD",
      "action": "buy",
      "lots": 0.5,
      "open_price": 1.09123,
      "close_price": 1.09321,
      "open_time": "2025-05-31T10:00:00Z",
      "close_time": "2025-05-31T10:15:00Z",
      "profit": 20.50,
      "pips": 20,
      "comment": "Scalp trade"
    }
  ]
}

🔧 Troubleshooting

Common Issues:

  • WebRequest not allowed → Add URLs to whitelist
  • HTTP 401 → Check API key
  • No data in dashboard → Verify AccountID matches setup

Debug Steps:

  1. Enable DebugMode
  2. Check MetaTrader Journal
  3. Verify internet connection
  4. Test Supabase webhook manually

📞 Support

For issues:

  1. Check installation guide
  2. Review Journal/Experts tab
  3. Verify Supabase webhook status
  4. Test with debug mode enabled

Webhook URL: https://bhhrmriyuhqygmnzqjyr.supabase.co/functions/v1/mt-data

Header: X-API-KEY: your-mt-api-key

About

A cross-platform MT4/MT5 Expert Advisor that streams real-time trading account metrics and trade history to Supabase — built for FundedGateway's trader evaluation platform.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages