public object run(LogicProcess process) { bool success = false; IMarketResponse response = process.comm.SendQueryMarketRequest(process.commodity); if (response.getType() == ResponseType.qCommodity) { MQCommodity resp = (MQCommodity)response; success = resp.getAsk() <= resp.getBid(); next(process, success); } return(response); }
public object run(LogicProcess process) { bool success = false; IMarketResponse response = process.comm.SendQueryMarketRequest(process.commodity); //myLogger.Info("BidCompare: Sent query"); if (response.getType() == ResponseType.qCommodity) { MQCommodity resp = (MQCommodity)response; success = resp.getBid() >= process.price; next(process, success); } return(response); }
public IMarketResponse SendQueryMarketRequest(int commodity) { QueryMarketRequest QMReq = new QueryMarketRequest(commodity); //create query market rquest MQCommodity marketResponse = new MQCommodity(); try { marketResponse = client.SendPostRequest <QueryMarketRequest, MQCommodity>(url, user, privateKey, QMReq); myLogger.Info("Sent Query Market Request{commodity:" + commodity + ", url:" + url + "}"); } catch (Exception e) { return(catchMethod(e)); } myHistory.Info("Sent Query Market Request-\r\ncommodity:" + commodity + "\nResponse: " + marketResponse.ToString()); return(marketResponse); }