Skip to content

Commit

Permalink
Merge pull request #5 from igofed/main
Browse files Browse the repository at this point in the history
Support all fields for Candlestick channel
  • Loading branch information
JKorf authored Sep 23, 2023
2 parents 4a8ca37 + 6cef5d1 commit 7dac3e3
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 10 deletions.
23 changes: 20 additions & 3 deletions OKX.Net/OKX.Net.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 28 additions & 7 deletions OKX.Net/Objects/Market/OKXCandlestick.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,35 @@ public class OKXCandlestick
public decimal ClosePrice { get; set; }

/// <summary>
/// Trading volume
/// Trading volume, with a unit of contract.
/// If it is a derivatives contract, the value is the number of contracts.
/// If it is SPOT/MARGIN, the value is the quantity in base currency.
/// </summary>
[ArrayProperty(5)]
public decimal Volume { get; set; }

/// <summary>
/// Quote volume
/// Trading volume, with a unit of currency.
/// If it is a derivatives contract, the value is the number of base currency.
/// If it is SPOT/MARGIN, the value is the quantity in quote currency.
/// </summary>
[ArrayProperty(6)]
public decimal QuoteVolume { get; set; }
public decimal VolumeCurrency { get; set; }

/// <summary>
/// Trading volume, the value is the quantity in quote currency
/// e.g. The unit is USDT for BTC-USDT and BTC-USDT-SWAP;
/// The unit is USD for BTC-USD-SWAP
/// </summary>
[ArrayProperty(7)]
public decimal VolumeCurrencyQuote { get; set; }

/// <summary>
/// The state of candlesticks.
/// false represents that it is uncompleted, true represents that it is completed.
/// </summary>
[ArrayProperty(8), JsonConverter(typeof(OKXBooleanConverter))]
public bool Confirm { get; set; }

/// <inheritdoc />
public override bool Equals(object obj)
Expand All @@ -70,10 +89,12 @@ public override bool Equals(object obj)
return Time == stick.Time
&& Symbol == stick.Symbol
&& OpenPrice == stick.OpenPrice
&& QuoteVolume == stick.QuoteVolume
&& QuoteVolume == stick.QuoteVolume
&& QuoteVolume == stick.QuoteVolume
&& HighPrice == stick.HighPrice
&& LowPrice == stick.LowPrice
&& ClosePrice == stick.ClosePrice
&& Volume == stick.Volume
&& QuoteVolume == stick.QuoteVolume;
&& VolumeCurrency == stick.VolumeCurrency
&& VolumeCurrencyQuote == stick.VolumeCurrencyQuote
&& Confirm == stick.Confirm;
}
}

0 comments on commit 7dac3e3

Please sign in to comment.