aboutsummaryrefslogtreecommitdiff
path: root/examples/info/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'examples/info/main.go')
-rw-r--r--examples/info/main.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/examples/info/main.go b/examples/info/main.go
new file mode 100644
index 0000000..260ecba
--- /dev/null
+++ b/examples/info/main.go
@@ -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)
+}