File tree Expand file tree Collapse file tree 10 files changed +16
-16
lines changed
ExchangeSharpConsole/Options Expand file tree Collapse file tree 10 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ protected override async Task<IEnumerable<MarketCandle>> OnGetCandlesAsync(
121121 HighPrice = data [ 1 ] . ConvertInvariant < decimal > ( ) ,
122122 LowPrice = data [ 2 ] . ConvertInvariant < decimal > ( ) ,
123123 ClosePrice = data [ 3 ] . ConvertInvariant < decimal > ( ) ,
124- BaseCurrencyVolume = data [ 4 ] . ConvertInvariant < double > ( ) ,
124+ BaseCurrencyVolume = data [ 4 ] . ConvertInvariant < decimal > ( ) ,
125125 Timestamp = timestamp ,
126126 } ;
127127 result . Add ( candle ) ;
Original file line number Diff line number Diff line change @@ -330,7 +330,7 @@ protected override async Task<IEnumerable<MarketCandle>> OnGetCandlesAsync(
330330 Timestamp = CryptoUtility . UnixTimeStampToDateTimeSeconds (
331331 x [ 0 ] . ConvertInvariant < long > ( )
332332 ) ,
333- BaseCurrencyVolume = x [ 1 ] . ConvertInvariant < double > ( ) ,
333+ BaseCurrencyVolume = x [ 1 ] . ConvertInvariant < decimal > ( ) ,
334334 ClosePrice = x [ 2 ] . ConvertInvariant < decimal > ( ) ,
335335 HighPrice = x [ 3 ] . ConvertInvariant < decimal > ( ) ,
336336 LowPrice = x [ 4 ] . ConvertInvariant < decimal > ( ) ,
Original file line number Diff line number Diff line change @@ -305,7 +305,7 @@ protected override async Task<IEnumerable<MarketCandle>> OnGetCandlesAsync(
305305 candleToken [ 0 ] ,
306306 TimestampType . UnixSeconds
307307 ) ,
308- BaseCurrencyVolume = candleToken [ 1 ] . ConvertInvariant < double > ( ) ,
308+ BaseCurrencyVolume = candleToken [ 1 ] . ConvertInvariant < decimal > ( ) ,
309309 ClosePrice = candleToken [ 2 ] . ConvertInvariant < decimal > ( ) ,
310310 ExchangeName = Name ,
311311 HighPrice = candleToken [ 3 ] . ConvertInvariant < decimal > ( ) ,
Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ protected override async Task<IEnumerable<MarketCandle>> OnGetCandlesAsync(
371371 { "symbol" , marketSymbol } ,
372372 { "type" , periodString }
373373 } ;
374-
374+
375375 if ( startDate != null )
376376 {
377377 payload . Add ( "startAt" , ( long ) startDate . Value . UnixTimestampFromDateTimeSeconds ( ) ) ;
@@ -406,8 +406,8 @@ protected override async Task<IEnumerable<MarketCandle>> OnGetCandlesAsync(
406406 ClosePrice = token [ i ] [ 2 ] . ConvertInvariant < decimal > ( ) ,
407407 HighPrice = token [ i ] [ 3 ] . ConvertInvariant < decimal > ( ) ,
408408 LowPrice = token [ i ] [ 4 ] . ConvertInvariant < decimal > ( ) ,
409- BaseCurrencyVolume = token [ i ] [ 5 ] . ConvertInvariant < double > ( ) ,
410- QuoteCurrencyVolume = token [ i ] [ 6 ] . ConvertInvariant < double > ( )
409+ BaseCurrencyVolume = token [ i ] [ 5 ] . ConvertInvariant < decimal > ( ) ,
410+ QuoteCurrencyVolume = token [ i ] [ 6 ] . ConvertInvariant < decimal > ( )
411411 }
412412 ) ;
413413 }
Original file line number Diff line number Diff line change @@ -305,7 +305,7 @@ private List<MarketCandle> ParseMarketCandle(JToken array)
305305 HighPrice = item [ 2 ] . ConvertInvariant < decimal > ( ) ,
306306 LowPrice = item [ 3 ] . ConvertInvariant < decimal > ( ) ,
307307 ClosePrice = item [ 4 ] . ConvertInvariant < decimal > ( ) ,
308- BaseCurrencyVolume = item [ 5 ] . ConvertInvariant < double > ( )
308+ BaseCurrencyVolume = item [ 5 ] . ConvertInvariant < decimal > ( )
309309 } ;
310310
311311 candles . Add ( candle ) ;
Original file line number Diff line number Diff line change @@ -399,7 +399,7 @@ protected override async Task<IEnumerable<MarketCandle>> OnGetCandlesAsync(
399399 LowPrice = enumerable . ElementAt ( 2 ) . Value < decimal > ( ) ,
400400 OpenPrice = enumerable . ElementAt ( 3 ) . Value < decimal > ( ) ,
401401 ClosePrice = enumerable . ElementAt ( 4 ) . Value < decimal > ( ) ,
402- BaseCurrencyVolume = enumerable . ElementAt ( 5 ) . Value < double > ( ) ,
402+ BaseCurrencyVolume = enumerable . ElementAt ( 5 ) . Value < decimal > ( ) ,
403403 }
404404 )
405405 . Where ( candle => ! endDate . HasValue || candle . Timestamp <= endDate ) ;
Original file line number Diff line number Diff line change @@ -1096,8 +1096,8 @@ internal static MarketCandle ParseCandle(
10961096 out decimal baseVolume ,
10971097 out decimal convertVolume
10981098 ) ;
1099- candle . BaseCurrencyVolume = ( double ) baseVolume ;
1100- candle . QuoteCurrencyVolume = ( double ) convertVolume ;
1099+ candle . BaseCurrencyVolume = baseVolume ;
1100+ candle . QuoteCurrencyVolume = convertVolume ;
11011101 if ( weightedAverageKey != null )
11021102 {
11031103 candle . WeightedAverage = token [ weightedAverageKey ] . ConvertInvariant < decimal > ( ) ;
Original file line number Diff line number Diff line change @@ -66,12 +66,12 @@ public class MarketCandle
6666 /// <summary>
6767 /// Base currency volume (i.e. in BTC-USD, this would be BTC volume)
6868 /// </summary>
69- public double BaseCurrencyVolume { get ; set ; }
69+ public decimal BaseCurrencyVolume { get ; set ; }
7070
7171 /// <summary>
7272 /// Quote currency volume (i.e. in BTC-USD, this would be USD volume)
7373 /// </summary>
74- public double QuoteCurrencyVolume { get ; set ; }
74+ public decimal QuoteCurrencyVolume { get ; set ; }
7575
7676 /// <summary>
7777 /// The weighted average price if provided
Original file line number Diff line number Diff line change @@ -224,9 +224,9 @@ await api.GetCandlesAsync(
224224 && ! string . IsNullOrWhiteSpace ( candles [ 0 ] . Name )
225225 && candles [ 0 ] . ExchangeName == api . Name
226226 && candles [ 0 ] . PeriodSeconds == 86400
227- && candles [ 0 ] . BaseCurrencyVolume > 0.0
228- && candles [ 0 ] . QuoteCurrencyVolume > 0.0
229- && candles [ 0 ] . WeightedAverage >= 0m
227+ && candles [ 0 ] . BaseCurrencyVolume > 0
228+ && candles [ 0 ] . QuoteCurrencyVolume > 0
229+ && candles [ 0 ] . WeightedAverage >= 0
230230 ) ;
231231
232232 Console . WriteLine ( $ "OK ({ candles . Length } )") ;
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ public async Task ShouldGetCandleStick()
131131 candle . HighPrice . Should ( ) . Be ( 1665719m ) ;
132132 candle . LowPrice . Should ( ) . Be ( 1612861m ) ;
133133 candle . ClosePrice . Should ( ) . Be ( 1629941 ) ;
134- candle . BaseCurrencyVolume . Should ( ) . Be ( 5.8362 ) ;
134+ candle . BaseCurrencyVolume . Should ( ) . Be ( 5.8362m ) ;
135135 candle . Timestamp
136136 . Should ( )
137137 . Be ( DateTimeOffset . FromUnixTimeMilliseconds ( 1514160000000 ) . DateTime ) ;
You can’t perform that action at this time.
0 commit comments