Class TradingClient
- java.lang.Object
-
- cloud.metaapi.sdk.clients.MetaApiClient
-
- cloud.metaapi.sdk.clients.copy_factory.TradingClient
-
public class TradingClient extends MetaApiClient
metaapi.cloud CopyFactory trading API (trade copying trading API) client (see https://trading-api-v1.project-stock.agiliumlabs.cloud/swagger/#/)
-
-
Field Summary
-
Fields inherited from class cloud.metaapi.sdk.clients.MetaApiClient
host, httpClient, token
-
-
Constructor Summary
Constructors Constructor Description TradingClient(HttpClient httpClient, String token)Constructs CopyFactory trading API client instance.TradingClient(HttpClient httpClient, String token, String domain)Constructs CopyFactory trading API client instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<List<CopyFactoryStrategyStopout>>getStopouts(String accountId)Returns subscriber account stopouts.CompletableFuture<Void>resetStopout(String accountId, String reason)Resets account stopout.CompletableFuture<Void>resynchronize(String accountId, List<String> strategyIds)Resynchronizes the account.-
Methods inherited from class cloud.metaapi.sdk.clients.MetaApiClient
getTokenType, handleNoAccessError, isNotAccountToken, isNotJwtToken
-
-
-
-
Constructor Detail
-
TradingClient
public TradingClient(HttpClient httpClient, String token)
Constructs CopyFactory trading API client instance. Domain is set toagiliumtrade.agiliumtrade.ai- Parameters:
httpClient- HTTP clienttoken- authorization token
-
TradingClient
public TradingClient(HttpClient httpClient, String token, String domain)
Constructs CopyFactory trading API client instance- Parameters:
httpClient- HTTP clienttoken- authorization tokendomain- domain to connect to
-
-
Method Detail
-
resynchronize
public CompletableFuture<Void> resynchronize(String accountId, List<String> strategyIds)
Resynchronizes the account. See https://trading-api-v1.agiliumtrade.agiliumtrade.ai/swagger/#!/default/post_users_current_accounts_accountId_resynchronize- Parameters:
accountId- account idstrategyIds- optional array of strategy ids to recynchronize, ornull. Default is to synchronize all strategies- Returns:
- completable future which resolves when resynchronization is scheduled
-
getStopouts
public CompletableFuture<List<CopyFactoryStrategyStopout>> getStopouts(String accountId)
Returns subscriber account stopouts. See https://trading-api-v1.agiliumtrade.agiliumtrade.ai/swagger/#!/default/get_users_current_accounts_accountId_stopouts- Parameters:
accountId- account id- Returns:
- completable future which resolves with stopouts found
-
resetStopout
public CompletableFuture<Void> resetStopout(String accountId, String reason)
Resets account stopout. See https://trading-api-v1.agiliumtrade.agiliumtrade.ai/swagger/#!/default/post_users_current_accounts_accountId_stopouts_reason_reset- Parameters:
accountId- account idreason- stopout reason to reset. One of yearly-balance, monthly-balance, daily-balance, yearly-equity, monthly-equity, daily-equity, max-drawdown- Returns:
- completable future which resolves when the stopout is reset
-
-