Skip to content

Latest commit

Β 

History

History
77 lines (52 loc) Β· 2.91 KB

README.md

File metadata and controls

77 lines (52 loc) Β· 2.91 KB

GoMT5 SDK

Official MetaTrader 5 Go SDK for high-performance trading automation and market data streaming via gRPC.

Docs License: MIT

πŸ“„ Full Documentation: https://metarpc.github.io/GoMT5/


πŸ“¦ Installation

go get github.com/MetaRPC/GoMT5/package

πŸƒ How to Run Examples

Clone the repository and run the examples out-of-the-box:

git clone https://github.com/MetaRPC/GoMT5.git
cd GoMT5/examples/demos
go mod download

# 1. Run with default TRIAL key:
go run main.go lowlevel01

# 2. Or pass your MetaRPC API key directly as an argument:
go run main.go lowlevel01 your_api_key_here

# 3. Or use the MRPC_API_KEY environment variable:
export MRPC_API_KEY="your_api_key_here"        # Windows CMD: set MRPC_API_KEY=your_api_key_here
go run main.go lowlevel01                      # Windows PowerShell: $env:MRPC_API_KEY="your_api_key_here"

πŸ”‘ API Key & Authentication

Connecting to MetaRPC production endpoints (mt5.mrpc.pro:443) requires an API key:

  1. Sign Up: Create an account for free at https://mrpc.pro/signup.
  2. Generate API Key: In your MetaRPC Portal dashboard at https://mrpc.pro/my, go to API Keys to generate and copy your personal API token.
  3. Configure Connection: Pass your API key / token along with the server address (mt5.mrpc.pro:443) in your connection settings.

πŸ†” Automatic Account ID & Authentication

MetaRPC endpoints route calls using a terminal session identifier (id):

  • When connecting via Connect / ConnectEx, the server automatically generates and returns a session GUID (terminalInstanceGuid).
  • The SDK automatically captures this session ID and attaches both the id and APIKey headers on all subsequent calls (AccountSummary, OrderSend, streaming, etc.) β€” no manual GetId or curl calls required.
  • Pass your API key directly to the Account/Client constructor or via the MRPC_API_KEY environment variable.

🌐 Production Endpoints

Environment Host Port Protocol
Production mt5.mrpc.pro 443 TLS / gRPC
Direct API UI (Swagger) https://mt5.mrpc.pro/apiui 443 HTTPS
Portal Dashboard https://mrpc.pro/my 443 HTTPS
Registration / API Key https://mrpc.pro/signup 443 HTTPS

πŸ“„ Documentation & Guides

Explore comprehensive documentation at https://metarpc.github.io/GoMT5/:

  • πŸš€ Quick Start & First Project
  • πŸ”‘ Authentication & API Keys
  • πŸ“‘ Live Market Data & gRPC Streaming
  • πŸ’Ό Account Management & Order Execution
  • πŸ“Š Return Codes & Error Handling Reference