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.

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)

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.

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.

References

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

See also