Table of Contents

Constructor ViiSyncAccountApi

Namespace
ViiSync.AccountApi
Assembly
ViiSync.AccountApi.dll

ViiSyncAccountApi()

Create an API without connection details; set User, Password, Host (and Port) before Connect().

public ViiSyncAccountApi()

Remarks

MT5 equivalent

  • MT5API.MT5API() — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)
  • MT5API.MT5API(ulong user, string password, string host, int port, byte[] pfxFile, string pfxFilePassword) — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)
  • MT5API.MT5API(ulong user, string password, string server, byte[] pfxFile, string pfxFilePassword) — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)
  • MT5API.MT5API(ulong user, string password, string host, int port) — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)
  • MT5API.MT5API(ulong user, string password, string host, int port, string proxyHost, int proxyPort, string proxyUser, string proxyPassword, ProxyTypes type) — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)

ViiSyncAccountApi(ulong, string, string, int)

MT5-style: login, password, host and port. Port 443 connects over TLS (wss://host/ws); any other port connects to ws://host:port/ws. Pass a full ws:///wss:// URL as host to set the endpoint exactly.

public ViiSyncAccountApi(ulong user, string password, string host, int port = 443)

Parameters

user ulong
password string
host string
port int

Remarks

MT5 equivalent

  • MT5API.MT5API() — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)
  • MT5API.MT5API(ulong user, string password, string host, int port, byte[] pfxFile, string pfxFilePassword) — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)
  • MT5API.MT5API(ulong user, string password, string server, byte[] pfxFile, string pfxFilePassword) — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)
  • MT5API.MT5API(ulong user, string password, string host, int port) — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)
  • MT5API.MT5API(ulong user, string password, string host, int port, string proxyHost, int proxyPort, string proxyUser, string proxyPassword, ProxyTypes type) — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)

ViiSyncAccountApi(ulong, string, Uri)

Connect to an explicit endpoint: a WebSocket URL (wss://server.example.com/ws), an access server's TCP+TLS address (tls://access-1.example.com:4431) or, for development and internal hosts only, a plain TCP address (tcp://127.0.0.1:7101).

public ViiSyncAccountApi(ulong user, string password, Uri endpoint)

Parameters

user ulong
password string
endpoint Uri

Remarks

MT5 equivalent

  • MT5API.MT5API() — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)
  • MT5API.MT5API(ulong user, string password, string host, int port, byte[] pfxFile, string pfxFilePassword) — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)
  • MT5API.MT5API(ulong user, string password, string server, byte[] pfxFile, string pfxFilePassword) — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)
  • MT5API.MT5API(ulong user, string password, string host, int port) — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)
  • MT5API.MT5API(ulong user, string password, string host, int port, string proxyHost, int proxyPort, string proxyUser, string proxyPassword, ProxyTypes type) — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)

ViiSyncAccountApi(ulong, string, IEnumerable<Uri>)

Connect through a list of access points — tls://host:port, wss://host/ws (or tcp:// / ws:// for development). Every Connect() and every automatic reconnect probes the TCP connect time of each candidate in parallel (about 300 ms at most), connects to the fastest and fails over to the next when a connect fails; refused credentials (INVALID_ACCOUNT) and an unsupported protocol (OLD_VERSION) are not retried elsewhere. The list grows with the access points the server advertises, in the same transport family (AccessPointPolicy; a list client takes them under the default Auto).

public ViiSyncAccountApi(ulong user, string password, IEnumerable<Uri> accessPoints)

Parameters

user ulong
password string
accessPoints IEnumerable<Uri>

Remarks

MT5 equivalent

  • MT5API.MT5API() — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)
  • MT5API.MT5API(ulong user, string password, string host, int port, byte[] pfxFile, string pfxFilePassword) — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)
  • MT5API.MT5API(ulong user, string password, string server, byte[] pfxFile, string pfxFilePassword) — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)
  • MT5API.MT5API(ulong user, string password, string host, int port) — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)
  • MT5API.MT5API(ulong user, string password, string host, int port, string proxyHost, int proxyPort, string proxyUser, string proxyPassword, ProxyTypes type) — full: pfx-certificate and proxy overloads are N/A (TLS via wss://; proxy -> see ProxyHost)

Exceptions

ArgumentException

The list is empty, or an entry is not a tls/tcp address with a port or a ws/wss URL.