欢迎光临散文网 会员登陆 & 注册

量化合约系统开发(逻辑及策略)丨合约量化系统开发(详情及源码)

2023-03-18 14:48 作者:bili_33032327742  | 我要投稿

  Quantitative trading refers to the use of advanced mathematical models instead of artificial subjective judgments,and the use of computer technology to select multiple"high probability"events that can bring excess returns from huge historical data to formulate strategies,greatly reducing the impact of investor sentiment fluctuations,and avoiding irrational investment decisions under extreme fanaticism or pessimism in the market.


  量化交易就是运用非常复杂统计学方法和数学模型,从庞大的历史数据中海选能带来超额收益的多种“大概率”事件以制定策略,用数量模型验证及固化这些规律和策略,然后用计算机来严格,高效地执行已固化的策略


  #from CTP.MdApi import*


  from AlgoPlus.CTP.FutureAccount import get_simnow_account,FutureAccount


  from AlgoPlus.CTP.FutureAccount import SIMNOW_SERVER,MD_LOCATION,TD_LOCATION


  from multiprocessing import Process,Queue


  from CTP.MdApi import run_bar_engine,run_tick_engine


  from CTP.TradeApi import run_trade_engine


  #账户配置


  future_account=FutureAccount(


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


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


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


  #server_dict={'TDServer':"180.168.146.187:10130",'MDServer':'180.168.146.187:10131'},#TEST


  server_dict={'TDServer':"218.202.237.33:10102",'MDServer':'218.202.237.33:10112'},#移动


  #TDServer为交易服务器,MDServer为行情服务器。服务器地址格式为"ip:port。"


  reserve_server_dict={},开发流程I59详细2OO7开发3O69


  investor_id="****************",


  password="****************"


  app_id='simnow_client_test',


  auth_code='0000000000000000'


  instrument_id_list=instrument_id_list,#订阅合约列表


  md_page_dir=MD_LOCATION,#MdApi流文件存储地址,默认MD_LOCATION


  td_page_dir=TD_LOCATION#TraderApi流文件存储地址,默认TD_LOCATION


  )


  #///深度行情通知


  def OnRtnDepthMarketData(self,pDepthMarketData):


  last_update_time=self.bar_dict[pDepthMarketData['InstrumentID']]["UpdateTime"]


  is_new_1minute=(pDepthMarketData['UpdateTime'][:-2]!=last_update_time[:-2])and pDepthMarketData['UpdateTime']!=b'21:00:00'#1分钟K线条件


  #is_new_5minute=is_new_1minute and int(pDepthMarketData['UpdateTime'][-4])%5==0#5分钟K线条件


  #is_new_10minute=is_new_1minute and pDepthMarketData['UpdateTime'][-4]==b"0"#10分钟K线条件


  #is_new_10minute=is_new_1minute and int(pDepthMarketData['UpdateTime'][-5:-3])%15==0#15分钟K线条件


  #is_new_30minute=is_new_1minute and int(pDepthMarketData['UpdateTime'][-5:-3])%30==0#30分钟K线条件


  #is_new_hour=is_new_1minute and int(pDepthMarketData['UpdateTime'][-5:-3])%60==0#60分钟K线条件


  ##新K线开始


  if is_new_1minute and self.bar_dict[pDepthMarketData['InstrumentID']]["UpdateTime"]!=b"99:99:99":


  for md_queue in self.md_queue_list:


  md_queue.put(self.bar_dict[pDepthMarketData['InstrumentID']])


  #将Tick池化为Bar


  tick_to_bar(self.bar_dict[pDepthMarketData['InstrumentID']],pDepthMarketData,is_new_1minute)


量化合约系统开发(逻辑及策略)丨合约量化系统开发(详情及源码)的评论 (共 条)

分享到微博请遵守国家法律