Class MetatraderAccountClient
- java.lang.Object
-
- cloud.metaapi.sdk.clients.MetaApiClient
-
- cloud.metaapi.sdk.clients.meta_api.MetatraderAccountClient
-
public class MetatraderAccountClient extends MetaApiClient
metaapi.cloud MetaTrader account API client (see https://metaapi.cloud/docs/provisioning/)
-
-
Field Summary
-
Fields inherited from class cloud.metaapi.sdk.clients.MetaApiClient
host, httpClient, token
-
-
Constructor Summary
Constructors Constructor Description MetatraderAccountClient(HttpClient httpClient, String token)Constructs MetaTrader account API client instance with default domain agiliumtrade.agiliumtrade.aiMetatraderAccountClient(HttpClient httpClient, String token, String domain)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<MetatraderAccountIdDto>createAccount(NewMetatraderAccountDto account)Starts cloud API server for a MetaTrader account using specified provisioning profile (see https://metaapi.cloud/docs/provisioning/api/account/createAccount/).CompletableFuture<Void>deleteAccount(String id)Stops and deletes an API server for a specified MetaTrader account.CompletableFuture<Void>deployAccount(String id)Starts API server for MetaTrader account.CompletableFuture<MetatraderAccountDto>getAccount(String id)Retrieves a MetaTrader account by id (see https://metaapi.cloud/docs/provisioning/api/account/readAccount/).CompletableFuture<MetatraderAccountDto>getAccountByToken()Retrieves a MetaTrader account by token (see https://metaapi.cloud/docs/provisioning/api/account/readAccount/).CompletableFuture<List<MetatraderAccountDto>>getAccounts(AccountsFilter accountsFilter)Retrieves MetaTrader accounts owned by user (see https://metaapi.cloud/docs/provisioning/api/account/readAccounts/).CompletableFuture<Void>redeployAccount(String id)Redeploys MetaTrader account.CompletableFuture<Void>undeployAccount(String id)Stops API server for a MetaTrader account.CompletableFuture<Void>updateAccount(String id, MetatraderAccountUpdateDto account)Updates existing metatrader account data (see https://metaapi.cloud/docs/provisioning/api/account/updateAccount/).-
Methods inherited from class cloud.metaapi.sdk.clients.MetaApiClient
getTokenType, handleNoAccessError, isNotAccountToken, isNotJwtToken
-
-
-
-
Constructor Detail
-
MetatraderAccountClient
public MetatraderAccountClient(HttpClient httpClient, String token)
Constructs MetaTrader account API client instance with default domain agiliumtrade.agiliumtrade.ai- Parameters:
httpClient- HTTP clienttoken- authorization token
-
MetatraderAccountClient
public MetatraderAccountClient(HttpClient httpClient, String token, String domain)
- Parameters:
domain- domain to connect to- See Also:
MetatraderAccountClient(HttpClient, String, String)
-
-
Method Detail
-
getAccounts
public CompletableFuture<List<MetatraderAccountDto>> getAccounts(AccountsFilter accountsFilter)
Retrieves MetaTrader accounts owned by user (see https://metaapi.cloud/docs/provisioning/api/account/readAccounts/). Method is accessible only with API access token.- Parameters:
accountsFilter- optional filter ornull- Returns:
- completable future resolving with MetaTrader accounts found
-
getAccountByToken
public CompletableFuture<MetatraderAccountDto> getAccountByToken()
Retrieves a MetaTrader account by token (see https://metaapi.cloud/docs/provisioning/api/account/readAccount/). Completes exceptionally if account is not found. Method is accessible only with account access token- Returns:
- completable future resolving with MetaTrader account found
-
getAccount
public CompletableFuture<MetatraderAccountDto> getAccount(String id)
Retrieves a MetaTrader account by id (see https://metaapi.cloud/docs/provisioning/api/account/readAccount/). Completable future is completed with an error if account is not found.- Parameters:
id- MetaTrader account id- Returns:
- completable future resolving with MetaTrader account found
-
createAccount
public CompletableFuture<MetatraderAccountIdDto> createAccount(NewMetatraderAccountDto account)
Starts cloud API server for a MetaTrader account using specified provisioning profile (see https://metaapi.cloud/docs/provisioning/api/account/createAccount/). It takes some time to launch the terminal and connect the terminal to the broker, you can use the connectionStatus field to monitor the current status of the terminal. Method is accessible only with API access token.- Parameters:
account- MetaTrader account to create- Returns:
- completable future resolving with an id of the MetaTrader account created
-
deployAccount
public CompletableFuture<Void> deployAccount(String id)
Starts API server for MetaTrader account. This request will be ignored if the account has already been deployed. (see https://metaapi.cloud/docs/provisioning/api/account/deployAccount/)- Parameters:
id- MetaTrader account id to deploy- Returns:
- completable future resolving when MetaTrader account is scheduled for deployment
-
undeployAccount
public CompletableFuture<Void> undeployAccount(String id)
Stops API server for a MetaTrader account. Terminal data such as downloaded market history data will be preserved. (see https://metaapi.cloud/docs/provisioning/api/account/undeployAccount/)- Parameters:
id- MetaTrader account id to undeploy- Returns:
- completable future resolving when MetaTrader account is scheduled for undeployment
-
redeployAccount
public CompletableFuture<Void> redeployAccount(String id)
Redeploys MetaTrader account. This is equivalent to undeploy immediately followed by deploy. (see https://metaapi.cloud/docs/provisioning/api/account/deployAccount/)- Parameters:
id- MetaTrader account id to redeploy- Returns:
- completable future resolving when MetaTrader account is scheduled for redeployment
-
deleteAccount
public CompletableFuture<Void> deleteAccount(String id)
Stops and deletes an API server for a specified MetaTrader account. The terminal state such as downloaded market data history will be deleted as well when you delete the account (see https://metaapi.cloud/docs/provisioning/api/account/deleteAccount/). Method is accessible only with API access token- Parameters:
id- MetaTrader account id- Returns:
- completable future resolving when MetaTrader account is scheduled for deletion
-
updateAccount
public CompletableFuture<Void> updateAccount(String id, MetatraderAccountUpdateDto account)
Updates existing metatrader account data (see https://metaapi.cloud/docs/provisioning/api/account/updateAccount/). Method is accessible only with API access token- Parameters:
id- MetaTrader account idaccount- updated MetaTrader account- Returns:
- completable future resolving when MetaTrader account is updated
-
-