0
mirror of https://github.com/valentineus/go-metatrader4.git synced 2025-07-08 01:40:27 +03:00

First version

This commit is contained in:
2025-06-04 12:08:19 +04:00
committed by GitHub
parent 76dc648f33
commit 7240595478
11 changed files with 444 additions and 1 deletions

25
examples/info/main.go Normal file
View File

@ -0,0 +1,25 @@
package main
import (
"context"
"fmt"
"log"
"time"
"go.popov.link/metatrader4/mt4"
)
func main() {
client := mt4.NewClient("127.0.0.1", 443,
mt4.WithDialTimeout(3*time.Second),
mt4.WithReadTimeout(5*time.Second),
mt4.WithWriteTimeout(5*time.Second),
)
ctx := context.Background()
// INFO does not require parameters
resp, err := client.Execute(ctx, "INFO", nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp)
}