/// <summary> /// req premium index kline /// </summary> /// <param name="contractCode"></param> /// <param name="period"></param> /// <param name="callbackFun"></param> /// <param name="from"></param> /// <param name="to"></param> /// <param name="id"></param> public void ReqEstimatedRateKLine(string contractCode, string period, _OnReqEstimatedRateResponse callbackFun, long from, long to, string id = _DEFAULT_ID) { string ch = $"market.{contractCode}.estimated_rate.{period}"; WSReqData reqData = new WSReqData() { req = ch, id = id, from = from, to = to }; Req(JsonConvert.SerializeObject(reqData), ch, callbackFun, typeof(ReqIndexKLineResponse)); }
/// <summary> /// req premium index kline /// </summary> /// <param name="contractCode"></param> /// <param name="period"></param> /// <param name="callbackFun"></param> /// <param name="from"></param> /// <param name="to"></param> /// <param name="id"></param> public void ReqEstimatedRateKLine(string contractCode, string period, _OnReqEstimatedRateResponse callbackFun, long from, long to, string id = WebSocketOp.DEFAULT_ID) { string ch = $"market.{contractCode}.estimated_rate.{period}"; WSReqData reqData = new WSReqData() { req = ch, id = id, from = from, to = to }; string sub_str = JsonConvert.SerializeObject(reqData); WebSocketOp wsop = new WebSocketOp(this.path, sub_str, callbackFun, typeof(ReqIndexKLineResponse), true, this.host); wsop.Connect(); }