随着信息技术和通信技术的不断进步,我们已经步入了智能工业时代。在这个时代,各种智能技术的应用正在推动着工业的升级和转型,人工智能技术、5G技术和工业互联网技术等新一代信息技术正在不断推进着时代进步和发展。
void WtHftStraDemo::__tqz_cancelOrder(const std::string code,const uint32_t orderId){
if(this->_ctx->tqz_getCancelCounts(code.c_str())>(this->_cancel_limit_counts+15)){
this->_ctx->stra_log_text("[WtHftStraDemo::__tqz_cancelOrder]out of cancel limit counts when cancel order,code:%s,orderId:%d,
return;
}
this->_ctx->stra_cancel(orderId);
}
void WtHftStraDemo::__tqz_cancelOrders(const std::string code,const IDSet orderIds){
for(auto&localid:orderIds)
this->__tqz_cancelOrder(code,localid);
}
void WtHftStraDemo::__tqz_cancelAllOrders(){
this->__tqz_cancelOrders(this->_code,this->_code_buy_orders);
this->__tqz_cancelOrders(this->_code,this->_code_sell_orders);
this->__tqz_cancelOrders(this->_code,this->_code_short_orders);
this->__tqz_cancelOrders(this->_code,this->_code_cover_orders);
}
TQZOrderType WtHftStraDemo::__tqz_getOrderType(const uint32_t orderId){
TQZOrderType orderType=DEFAULT_ORDER_TYPE;
if(this->_code_buy_orders.find(orderId)!=std::end(this->_code_buy_orders)){
orderType=BUY_TYPE;
}else if(this->_code_sell_orders.find(orderId)!=std::end(this->_code_sell_orders)){
orderType=SELL_TYPE;
}else if(this->_code_short_orders.find(orderId)!=std::end(this->_code_short_orders)){
orderType=SHORT_TYPE;
}else if(this->_code_cover_orders.find(orderId)!=std::end(this->_code_cover_orders)){
orderType=COVER_TYPE;
}else{
orderType=NO_TYPE;
}
return orderType;
}
double WtHftStraDemo::__tqz_getAskPrice(const std::string code){
return this->_ctx->stra_get_last_tick(code.c_str