public class HistoricalMarketDataClient
extends cloud.metaapi.sdk.clients.MetaApiClient
| Constructor and Description |
|---|
HistoricalMarketDataClient(cloud.metaapi.sdk.clients.HttpClient httpClient,
String token)
Constructs historical market data API client instance with default domain agiliumtrade.agiliumtrade.ai
|
HistoricalMarketDataClient(cloud.metaapi.sdk.clients.HttpClient httpClient,
String token,
String domain)
Constructs historical market data API client instance
|
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<List<MetatraderCandle>> |
getHistoricalCandles(String accountId,
String symbol,
String timeframe,
cloud.metaapi.sdk.clients.models.IsoTime startTime,
Integer limit)
Returns historical candles for a specific symbol and timeframe from a MetaTrader account.
|
CompletableFuture<List<MetatraderTick>> |
getHistoricalTicks(String accountId,
String symbol,
cloud.metaapi.sdk.clients.models.IsoTime startTime,
Integer offset,
Integer limit)
Returns historical ticks for a specific symbol from a MetaTrader account.
|
public HistoricalMarketDataClient(cloud.metaapi.sdk.clients.HttpClient httpClient,
String token)
httpClient - HTTP clienttoken - authorization tokenpublic CompletableFuture<List<MetatraderCandle>> getHistoricalCandles(String accountId, String symbol, String timeframe, cloud.metaapi.sdk.clients.models.IsoTime startTime, Integer limit)
accountId - MetaTrader account idsymbol - symbol to retrieve candles for (e.g. a currency pair or an index)timeframe - defines the timeframe according to which the candles must be generated.
Allowed values for MT5 are 1m, 2m, 3m, 4m, 5m, 6m, 10m, 12m, 15m, 20m, 30m, 1h, 2h, 3h, 4h,
6h, 8h, 12h, 1d, 1w, 1mn. Allowed values for MT4 are 1m, 5m, 15m 30m, 1h, 4h, 1d, 1w, 1mnstartTime - time to start loading candles from. Note that candles are loaded in backwards
direction, so this should be the latest time. Leave null to request latest candles.limit - maximum number of candles to retrieve, or null. Must be less or equal to 1000public CompletableFuture<List<MetatraderTick>> getHistoricalTicks(String accountId, String symbol, cloud.metaapi.sdk.clients.models.IsoTime startTime, Integer offset, Integer limit)
accountId - MetaTrader account idsymbol - symbol to retrieve ticks for (e.g. a currency pair or an index)startTime - time to start loading ticks from. Note that ticks are loaded in forward
direction, so this should be the earliest time. Leave null to request latest candles.offset - number of ticks to skip, or null (you can use it to avoid requesting
ticks from previous request twice)limit - maximum number of ticks to retrieve, or null. Must be less or equal to 1000Copyright © 2022. All rights reserved.