Friends, this is the code that I’m trying to get running. I use F# here but do know some C#.
I basically follow the samples for binance connector dotnet:
#r "nuget: FSharp.Data"
#r "nuget: Binance.Spot"
open FSharp.Data
open Binance.Spot
open Binance.Spot.Models
open Binance.Common
open System;
open System.IO;
[<Literal>]
let Endpoint = "https://api.binance.com"
[<Literal>]
let Key = "Key"
[<Literal>]
let Secret = "SecretKey"
[<Literal>]
let Sample = """[{"KlineOpenTime":1499040000000,"OpenPrice":0.01634790,"HighPrice":0.80000000,"LowPrice":0.01575800,"ClosePrice":0.01577100,"Volume":"148976.11427815","KlineCloseTime":1499644799999,"QuoteAssetVolume":2434.19055334,"NumberOfTrades":308,"TakerBuyBaseAssetVolume":1756.87402397,"TakerBuyQuoteAssetVolume":28.46694368,"Ignore":0}]"""
type KlineCandleStick = JsonProvider<Sample, RootName="KlineCandleStick">
let market = new Market(Endpoint, Key, Secret)
let data =
market.KlineCandlestickData("BNBUSDT", Interval.ONE_DAY)
|> Async.AwaitTask
|> Async.RunSynchronously
|> KlineCandleStick.Parse
|> Seq.toList
|> Seq.map (fun f -> f.Volume)
data
This gives me the following error:
Error: System.Exception: '[0]/Volume' is missing
Basically, I try to serialize my Json-Data, but the individual Properties are missing.
Hope someone can help.
Thanks in advance.