0
点赞
收藏
分享

微信扫一扫

 关于区块链合约量化系统开发技术讲解丨Python框架的合约量化技术开发方案

DAPP是去中心化的APP,DAPP和普通的App原理一样,除了他们是完全去中心化的,在以太坊网络本身自己的节点来运作的DAPP,不依赖于任何中心化的服务器,DAPP是去中心化的,可以完全自动地运行。


以太坊中一般会认为智能合约就是DAPP,当然更准确的可以认为智能合约相当于服务器后台,另外要实现用户体验,还需要UI交互界面,通过RPC与后台对接,那么DAPP就是包含完整的智能合约+用户UI交互界面。




  1.The most obvious feature of quantitative trading is to reduce the impact of investor sentiment fluctuations and avoid making irrational investment decisions in the case of extreme market fanaticism or pessimism,while quantitative trading robots avoid subjective assumptions and use programs to turn their ideas into quantifiable strategies,using only computing strategies and trading strategies through computers;


  2.History back test,realized by computer program,can verify the rationality of trading strategy by quantifying trading ideas;


  3.It can ensure the execution of transactions/profits,especially the quantitative analysis of medium and low frequency,without the need to mark the market


  进行“买入平空”操作,撮合成功后将减少空头仓位。


  import quandl


  import pandas as pd


  import numpy as np


  import matplotlib.pyplot as plt


  quandl.ApiConfig.api_key='INSERT YOUR API KEY HERE'


  selected=['CNP','F','WMT','GE','TSLA']


  data=quandl.get_table('WIKI/PRICES',ticker=selected,


  qopts={'columns':['date','ticker','adj_close']},


  date={'gte':'2011-1-1','lte':'2021-07-31'},paginate=True)


  clean=data.set_index('date')


  table=clean.pivot(columns='ticker')


  returns_daily=table.pct_change()


  returns_annual=returns_daily.mean()*250


  cov_daily=returns_daily.cov()


  cov_annual=cov_daily*250


  port_returns=[]


  port_volatility=[]


  sharpe_ratio=[]


  stock_weights=[]


  num_assets=len(selected)


  num_portfolios=90000


  np.random.seed(101)


  for single_portfolio in range(num_portfolios):


  weights=np.random.random(num_assets)


  weights/=np.sum(weights)


  returns=np.dot(weights,returns_annual)


  volatility=np.sqrt(np.dot(weights.T,np.dot(cov_annual,weights)))


  sharpe=returns/volatility


  sharpe_ratio.append(sharpe)


  port_returns.append(returns)


  port_volatility.append(volatility)


  stock_weights.append(weights)


区块链是一个去中心化计算协议,本文由整理发布,约定了不同的利益主体如何分散的创建和维护一个分布式的计算基础设施,从而实现“基础设施管理权”与“用户数据控制权”之间的分离,防止单一平台通过计算基础设施管理权力,实现对用户数据、用户资产和用户身份的控制。区块链还是一个透明可信的权利确认与追溯系统,一份权利一旦数字化为区块链上的通证,可以得到可靠的确权,并且可全程追踪其流转、交易、转换、变形的全过程。区块链是协议创造和自动执行平台。智能合约是这一能力的集中体现。通过智能合约,权利与价值的分配协议可以无需借助可信第三方,即得到高效、准确、可信的执行,并且全过程可审计。

举报

相关推荐

0 条评论