電子工程網(wǎng)
標(biāo)題: 區(qū)塊鏈合約量化系統(tǒng)開發(fā)技術(shù)方案丨量化合約系統(tǒng)開發(fā)技術(shù)原理 [打印本頁]
作者: a1271916008 時(shí)間: 2022-11-18 10:48
標(biāo)題: 區(qū)塊鏈合約量化系統(tǒng)開發(fā)技術(shù)方案丨量化合約系統(tǒng)開發(fā)技術(shù)原理
Features of Quantitative Trading Robot:
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
區(qū)塊鏈?zhǔn)且粋(gè)去中心化計(jì)算協(xié)議,本文由V_StPv888整理發(fā)布,約定了不同的利益主體如何分散的創(chuàng)建和維護(hù)一個(gè)分布式的計(jì)算基礎(chǔ)設(shè)施,從而實(shí)現(xiàn)“基礎(chǔ)設(shè)施管理權(quán)”與“用戶數(shù)據(jù)控制權(quán)”之間的分離,防止單一平臺(tái)通過計(jì)算基礎(chǔ)設(shè)施管理權(quán)力,實(shí)現(xiàn)對(duì)用戶數(shù)據(jù)、用戶資產(chǎn)和用戶身份的控制。區(qū)塊鏈還是一個(gè)透明可信的權(quán)利確認(rèn)與追溯系統(tǒng),一份權(quán)利一旦數(shù)字化為區(qū)塊鏈上的通證,可以得到可靠的確權(quán),并且可全程追蹤其流轉(zhuǎn)、交易、轉(zhuǎn)換、變形的全過程。區(qū)塊鏈?zhǔn)菂f(xié)議創(chuàng)造和自動(dòng)執(zhí)行平臺(tái)。智能合約是這一能力的集中體現(xiàn)。通過智能合約,權(quán)利與價(jià)值的分配協(xié)議可以無需借助可信第三方,即得到高效、準(zhǔn)確、可信的執(zhí)行,并且全過程可審計(jì)。
進(jìn)行“買入平空”操作,撮合成功后將減少空頭倉(cāng)位。
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)
合約量化的因素有那些呢?
應(yīng)該具備如下要素:
1,大數(shù)據(jù)
2,算法模型
3,入場(chǎng)擇時(shí)
4,倉(cāng)位管理
5,風(fēng)險(xiǎn)控制
6,檢驗(yàn)策略,策略的歷史數(shù)據(jù)回測(cè)等數(shù)據(jù)進(jìn)行檢驗(yàn)
合約量化策略類型及玩法詳細(xì)講解
交易類型分為兩類,開倉(cāng)和平倉(cāng)。開倉(cāng)和平倉(cāng),又分買入和賣出兩個(gè)方向:
買入開多(看漲)是指當(dāng)用戶對(duì)指數(shù)看多、看漲時(shí),新買入一定數(shù)量的某種合約。進(jìn)行“買入開多”操作,撮合成功后將增加多頭倉(cāng)位。
賣出平多(多單平倉(cāng))是指用戶對(duì)未來指數(shù)行情不再看漲而補(bǔ)回的賣出合約,與當(dāng)前持有的買入合約對(duì)沖抵消退出市場(chǎng)。進(jìn)行“賣出平多”操作,撮合成功后將減少多頭倉(cāng)位。
賣出開空(看跌)是指當(dāng)用戶對(duì)指數(shù)看空、看跌時(shí),新賣出一定數(shù)量的某種合約。進(jìn)行“賣出開空”操作,撮合成功后將增加空頭倉(cāng)位。
買入平空(空單平倉(cāng))是指用戶對(duì)未來指數(shù)行情不再看跌而補(bǔ)回的買入合約,與當(dāng)前持有的賣出合約對(duì)沖抵消退出市場(chǎng)。
歡迎光臨 電子工程網(wǎng) (http://www.54549.cn/) |
Powered by Discuz! X3.4 |