I keep getting an error after running the code for a few minutes
Newtonsoft.Json.JsonSerializationException: 'Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[BitMEX.Order]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3])
Can you please help me?
public List<Position> GetOpenPositions(string symbol)
{
var param = new Dictionary<string, string>();
string res = Query("GET", "/position", param, true);
return JsonConvert.DeserializeObject<List<Position>>(res)
.Where(a => a.Symbol == symbol && a.IsOpen == true)
.OrderByDescending(a => a.TimeStamp)
.ToList();
}