0
mirror of https://github.com/valentineus/go-metatrader4.git synced 2025-08-12 09:26:40 +03:00
dependabot[bot] 991baa37a3 Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 04:12:26 +00:00
2025-06-03 20:01:32 +00:00
2025-08-12 04:12:26 +00:00
2025-06-05 02:38:50 +04:00
2025-08-11 10:57:49 +00:00
2025-08-11 10:57:49 +00:00

MT4 Client Library

Go Reference Go Report Card

A lightweight Go client library for interacting with a MetaTrader 4 (MT4) trading server over TCP.

Example Usage

import "github.com/digineat/go-metatrader4/mt4"

client := mt4.NewClient("127.0.0.1", 443,
    mt4.WithDialTimeout(3*time.Second),
    mt4.WithAutoClose(true),
)
ctx := context.Background()
params := map[string]string{
    "login":    "55555",
    "password": "_some_password_",
}
res, err := client.Execute(ctx, "WWAPUSER", params)

The Execute method sends a raw MT4 command. Parameters are encoded using base64 and Windows-1251. Use WithAutoClose(false) if you want to reuse the connection manually via client.Close().

Options

  • WithDialTimeout(d time.Duration): Sets the timeout for establishing a TCP connection. Default: 5s.
  • WithReadTimeout(d time.Duration): Sets the maximum time to wait for a server response. Default: 5s.
  • WithWriteTimeout(d time.Duration): Sets the maximum time to complete sending a request. Default: 5s.
  • WithAutoClose(enabled bool): If true, closes the connection after each Execute (default). Use false to reuse the session manually via client.Close().

Requirements

  • Go 1.24 or later
  • MetaTrader 4 server with TCP access

Project Info

  • Vanity import path: github.com/digineat/go-metatrader4/mt4
  • Issues and contributions: GitHub

Maintained by Valentin Popov.

License

This project is licensed under the MIT License.

Description
A lightweight Go client library for interacting with a MetaTrader 4 (MT4) trading server over TCP.
Readme 114 KiB
2025-06-09 15:07:16 +03:00
Languages
Go 100%