量化合约系统开发(开发源码)丨合约量化系统开发(demo及案例)

168 阅读1分钟

Quantitative trading refers to the trading method that is directly executed by computer through rigorous and complex mathematical or statistical models, through the analysis of a large number of historical data, and the selection of investment methods with excess returns on the approximate rate.

  

  double WtHftStraDemo::__tqz_getShortPrice(const std::string code,const int offsetTicks=0){

  WTSCommodityInfo*codeInfo=this->_ctx->stra_get_comminfo(code.c_str());

  关于区块链项目技术开发唯:MrsFu123,代币发行、dapp智能合约开发、链游开发、多链钱包开发

  交易所开发、量化合约开发、互助游戏开发、Nft数字藏品开发、众筹互助开发、元宇宙开发、swap开发、

  链上合约开发、ido开发、商城开发等,开发过各种各样的系统模式,更有多种模式、制度、案例、后台等,成熟技术团队,欢迎实体参考。

  double shortPrice=this->__tqz_getBidPrice(code)-codeInfo->getPriceTick()*offsetTicks;

  if(shortPrice<=this->__tqz_getLowerlimitPrice(code))

  shortPrice=this->__tqz_getLowerlimitPrice(code);

  if(shortPrice>=this->__tqz_getUpperlimitPrice(code))

  shortPrice=this->__tqz_getUpperlimitPrice(code);

  return shortPrice;

  }开发详细I35功能7O98模式O7I8

  void WtHftStraDemo::__tqz_receiveCodeOnlyCloseCode(const uint32_t localid,const std::string code,const double lots){

  switch(this->__tqz_getOrderType(localid)){

  case BUY_TYPE:{

  this->__tqz_cancelOrder(code,this->_code_short_order);

  if(this->_ctx->tqz_getLongPosition(code.c_str())>0)

  this->tqz_sell(code,lots,OPEN_CLOSE_POSITION_OFFSET_TICKS,"code_sellOrder_onlyClose");

  break;

  }case SELL_TYPE:{//close positions time.

  this->__unlockBuy();

  this->__unlockSell();

  this->_re_marketMaking=true;

  break;

  }case SHORT_TYPE:{

  this->__tqz_cancelOrder(code,this->_code_buy_order);

  if(this->_ctx->tqz_getShortPosition(code.c_str())>0)

  this->tqz_cover(code,lots,OPEN_CLOSE_POSITION_OFFSET_TICKS,"code_coverOrder_onlyClose");

  break;

  }case COVER_TYPE:{//close positions time.

  this->__unlockShort();

  this->__unlockCover();

  this->_re_marketMaking=true;

  break;

  }

  }

  }

  bool WtHftStraDemo::__isBelongToHft(const uint32_t orderId){

  bool isBelongToHft=false;

  if(this->_code_buy_orders.find(orderId)!=std::end(this->_code_buy_orders)){

  isBelongToHft=true;

  }else if(this->_code_sell_orders.find(orderId)!=std::end(this->_code_sell_orders)){

  isBelongToHft=true;

  }else if(this->_code_short_orders.find(orderId)!=std::end(this->_code_short_orders)){

  isBelongToHft=true;

  }else if(this->_code_cover_orders.find(orderId)!=std::end(this->_code_cover_orders)){

  isBelongToHft=true;

  }

  return isBelongToHft;

  }