Ejemplo n.º 1
0
 public CallResult <List <FtxCandle> > GetFutureHistoricalIndex(string symbol, FtxCandleStickResolution resolution, int?limit = null,
                                                                DateTime? @from = null, DateTime?to = null)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 2
0
 public CallResult <List <FtxCandle> > GetCandles(string symbol, FtxCandleStickResolution resolution, int?limit = null, DateTime?from = null, DateTime?to = null) => GetCandlesAsync(symbol, resolution, limit, from, to).Result;
Ejemplo n.º 3
0
 public Task <CallResult <List <FtxCandle> > > GetFutureHistoricalIndexAsync(string symbol, FtxCandleStickResolution resolution, int?limit = null,
                                                                             DateTime? @from = null, DateTime?to = null, CancellationToken ct = default)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 4
0
        public async Task <CallResult <List <FtxCandle> > > GetCandlesAsync(string symbol, FtxCandleStickResolution resolution, int?limit = null, DateTime?from = null, DateTime?to = null, CancellationToken ct = default)
        {
            var param = new Dictionary <string, object>();

            param.AddParameter("resolution", (int)resolution);
            param.AddOptionalParameter("limit", limit);
            param.AddOptionalParameter("start_time", JsonConvert.SerializeObject(from, new TimestampSecondsConverter()));
            param.AddOptionalParameter("end_time", JsonConvert.SerializeObject(to, new TimestampSecondsConverter()));

            var req = await SendRequest <FtxApiCallResult <List <FtxCandle> > >(GetUrl(FillPathParameter(CandlesEnpoint, symbol)), HttpMethod.Get, ct, param);

            return(new CallResult <List <FtxCandle> >(req.Data?.Data, req.Error));
        }