MT5.Connect: Socket connection with MT5

Description Usage Arguments Details Value Author(s) References See Also

View source: R/Source_MT5.R

Description

The main function of mt5R, its make the connection by socket with MT5. Used in all mt5R functions.

This function was only viable by JC's package (Socket library for MT4 and MT5). See reference.

Usage

1
MT5.Connect(sReq, iPort = 23456, bMsg = FALSE, timeout = getOption("timeout"))

Arguments

sReq

character; requisition sent to MT5.

iPort

int; port used to create socket connection. (default 23456)

bMsg

bool; if TRUE it will print all return messages from MT5. (default FALSE)

timeout

int; timeout used in base::socketConnection(). (default 60)

Details

It uses <socket-library-mt4-mt5.mqh> library.

This function still has some experiments concepts, especially with delayed functions that MT5 requires time to run.

Value

Returns character, it will be entirely dependent of the function of the other side in the mt5R package running in MT5. Error due connection will be returned NULL.

Author(s)

Guilherme Kinzel, guikinzel@gmail.com

References

https://www.mql5.com/en/blogs/post/706665

See Also

MT5.ChangeDoorSocket()


Kinzel/mt5r documentation built on March 25, 2021, 9:57 p.m.