Can't get values from dictionary

  • Thread starter theCryptoGuy388
  • Start date
T

theCryptoGuy388

Guest
I am new to c# and have some questions about dictionaries. I can't get some values out of it.

This is my code for getting this dictionary over api.

public string GetDataDaily()
{
var param = new Dictionary<string, string>();
param["symbol"] = "XBTUSD";
param["binSize"] = "1d";

param["count"] = "1";
param["reverse"] = "true";

return Query("GET", "/trade/bucketed", param);
}


This is the call for my method

var PivotLine = bitmex.GetDataDaily();

txtPriceLastDay.Text = PivotLine["Open"];


This is the output from api request:

[{"timestamp":"2019-10
06T00:00:00.000Z","symbol":"XBTUSD","open":8188.5,"high":8207.5,"low":8035.5,"
close":8170,"trades":41526,"volume":52477401,"vwap":8125.4571,"lastSize":2000,
"turnover":645864492821,"homeNotional":6458.644928209973,"foreignNotional":524
77401}]


I expected, that I can get open Price "8188.5, but I can't run my code. The error is cant convert string to int.

Continue reading...
 
Top