Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kline Data not populating #4

Open
sharecodez opened this issue May 15, 2021 · 3 comments
Open

Kline Data not populating #4

sharecodez opened this issue May 15, 2021 · 3 comments

Comments

@sharecodez
Copy link

Kline data not populating due to the invalid json structure while serialize. Please update with below chnages.

namespace Binance.Client.Websocket.Responses.Kline
{
///


/// The current klines/candlestick
///

public class Klinedata : MessageBase
{
///
/// Kline start time
///

[JsonProperty("k")]
public Kline Kline { get; set; }

}

public class Kline : MessageBase
{
    /// <summary>
    /// Kline start time
    /// </summary>
    [JsonProperty("t")]
    public double StartTime { get; set; }

    /// <summary>
    /// Kline close time
    /// </summary>
    [JsonProperty("T")]
    public double CloseTime { get; set; }

    /// <summary>
    /// Symbol
    /// </summary>
    [JsonProperty("s")]
    public string Symbol { get; set; }

    /// <summary>
    /// Interval
    /// </summary>
    [JsonProperty("i")]
    public string Interval { get; set; }

    /// <summary>
    /// First trade ID
    /// </summary>
    [JsonProperty("f")]
    public double FirstTradeId { get; set; }

    /// <summary>
    /// Last trade ID
    /// </summary>
    [JsonProperty("L")]
    public double LastTradeId { get; set; }

    /// <summary>
    /// Open price
    /// </summary>
    [JsonProperty("o")]
    public double OpenPrice { get; set; }

    /// <summary>
    /// Close price
    /// </summary>
    [JsonProperty("c")]
    public double ClosePrice { get; set; }

    /// <summary>
    /// High price
    /// </summary>
    [JsonProperty("h")]
    public double HighPrice { get; set; }

    /// <summary>
    /// Low price
    /// </summary>
    [JsonProperty("l")]
    public double LowPrice { get; set; }

    /// <summary>
    /// Base asset volume
    /// </summary>
    [JsonProperty("v")]
    public double BaseAssetVolume { get; set; }

    /// <summary>
    /// Number of trades
    /// </summary>
    [JsonProperty("n")]
    public double NumberTrades { get; set; }

    /// <summary>
    /// Is this kline closed?
    /// </summary>
    [JsonProperty("x")]
    public bool IsClose { get; set; }

    /// <summary>
    /// Quote asset volume
    /// </summary>
    [JsonProperty("q")]
    public double QuoteAssetVolume { get; set; }

    /// <summary>
    /// Taker buy base asset volume
    /// </summary>
    [JsonProperty("V")]
    public double TakerBuyBaseAssetVolume { get; set; }

    /// <summary>
    /// Taker buy quote asset volume
    /// </summary>
    [JsonProperty("Q")]
    public double TakerBuyQuoteAssetVolume { get; set; }

    /// <summary>
    /// Ignore
    /// </summary>
    [JsonProperty("B")]
    public double Ignore { get; set; }
}

}

@Marfusios
Copy link
Owner

Hello @sharecodez, thanks for the comment, but feel free to open a PR

@azzars
Copy link

azzars commented Jun 7, 2021

Hi, It still doesn't work for me, anything I'm missing beside changing Kline to the code here?

@sporty81
Copy link

I had the same issue. Must change the Kline class because there is a "k" object and the fields are all sub properties of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants