第一部分 新手入门
- 一 量化投资视频学习课程
- 二 Python 手把手教学
- 量化分析师的Python日记【第1天:谁来给我讲讲Python?】
- 量化分析师的Python日记【第2天:再接着介绍一下Python呗】
- 量化分析师的Python日记【第3天:一大波金融Library来袭之numpy篇】
- 量化分析师的Python日记【第4天:一大波金融Library来袭之scipy篇】
- 量化分析师的Python日记【第5天:数据处理的瑞士军刀pandas】
- 量化分析师的Python日记【第6天:数据处理的瑞士军刀pandas下篇
- 量化分析师的Python日记【第7天:Q Quant 之初出江湖】
- 量化分析师的Python日记【第8天 Q Quant兵器谱之函数插值】
- 量化分析师的Python日记【第9天 Q Quant兵器谱之二叉树】
- 量化分析师的Python日记【第10天 Q Quant兵器谱 -之偏微分方程1】
- 量化分析师的Python日记【第11天 Q Quant兵器谱之偏微分方程2】
- 量化分析师的Python日记【第12天:量化入门进阶之葵花宝典:因子如何产生和回测】
- 量化分析师的Python日记【第13天 Q Quant兵器谱之偏微分方程3】
- 量化分析师的Python日记【第14天:如何在优矿上做Alpha对冲模型】
- 量化分析师的Python日记【第15天:如何在优矿上搞一个wealthfront出来】
第二部分 股票量化相关
- 一 基本面分析
- 1.1 alpha 多因子模型
- 1.2 基本面因子选股
- 1.3 财报阅读 • [米缸量化读财报] 资产负债表-投资相关资产
- 1.4 股东分析
- 1.5 宏观研究
- 二 套利
- 三 事件驱动
- 四 技术分析
- 4.1 布林带
- 4.2 均线系统
- 4.3 MACD
- 4.4 阿隆指标 • 技术指标阿隆( Aroon )全解析
- 4.5 CCI • CCI 顺势指标探索
- 4.6 RSI
- 4.7 DMI • DMI 指标体系的构建及简单应用
- 4.8 EMV • EMV 技术指标的构建及应用
- 4.9 KDJ • KDJ 策略
- 4.10 CMO
- 4.11 FPC • FPC 指标选股
- 4.12 Chaikin Volatility
- 4.13 委比 • 实时计算委比
- 4.14 封单量
- 4.15 成交量 • 决战之地, IF1507 !
- 4.16 K 线分析 • 寻找夜空中最亮的星
- 五 量化模型
- 5.1 动量模型
- 5.2 Joseph Piotroski 9 F-Score Value Investing Model
- 5.3 SVR
- 5.4 决策树、随机树
- 5.5 钟摆理论
- 5.6 海龟模型
- 5.7 5217 策略
- 5.8 SMIA
- 5.9 神经网络
- 5.10 PAMR
- 5.11 Fisher Transform
- 5.12 分型假说, Hurst 指数
- 5.13 变点理论
- 5.14 Z-score Model
- 5.15 机器学习
- 5.16 DualTrust 策略和布林强盗策略
- 5.17 卡尔曼滤波
- 5.18 LPPL anti-bubble model
- 六 大数据模型
- 6.1 市场情绪分析
- 6.2 新闻热点
- 七 排名选股系统
- 八 轮动模型
- 九 组合投资
- 十 波动率
- 十一 算法交易
- 十二 中高频交易
- 十三 Alternative Strategy
第三部分 基金、利率互换、固定收益类
- 一 分级基金
- 二 基金分析
- 三 债券
- 四 利率互换
第四部分 衍生品相关
- 一 期权数据
- 二 期权系列
- 三 期权分析
- 四 期货分析
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
通过神经网络进行交易
start = '2014-01-01' # 回测起始时间
end = '2015-05-25' # 回测结束时间
benchmark = 'HS300' # 策略参考标准
universe = set_universe('HS300') # 证券池,支持股票和基金
capital_base = 1000000 # 起始资金
freq = 'd' # 策略类型,'d'表示日间策略使用日线回测,'m'表示日内策略使用分钟线回测
refresh_rate = 1 # 调仓频率,表示执行handle_data的时间间隔,若freq = 'd'时间间隔的单位为交易日,若freq = 'm'时间间隔为分钟
import pybrain as brain
from pybrain.tools.shortcuts import buildNetwork
from pybrain.tools.customxml import NetworkReader
HISTORY = 10 # 通过前十日数据预测
fnn = buildNetwork(HISTORY, 15, 7, 1) # 初始化神经网络
def initialize(account): # 初始化虚拟账户状态
fnn = NetworkReader.readFrom('net.csv')
def handle_data(account): # 每个交易日的买入卖出指令
hist = account.get_attribute_history('closePrice', 10)
bucket = []
for s in account.universe:
sample = hist[s]
possibility = fnn.activate(sample)
bucket.append((possibility, s))
if possibility < 0 and s in account.valid_secpos:
order_to(s, 0)
bucket = sorted(bucket, key=lambda x: x[0], reverse=True)
print bucket[0][0]
if bucket[0][0] < 0:
raise Exception('Network Error')
for s in bucket[:10]:
if s[0] > 0.5 and s[1] not in account.valid_secpos:
order(s[1], 10000 * s[0] * 80000)
[ 1.44446298]
[ 1.57722526]
[ 1.44509945]
[ 1.44829344]
[ 1.48584942]
[ 1.60968867]
[ 1.61088618]
[ 1.43639898]
[ 1.43767639]
[ 1.43911414]
[ 1.43768517]
[ 1.43585662]
[ 1.43720968]
[ 1.43317016]
[ 1.43301566]
[ 1.42953404]
[ 1.42678559]
[ 1.43098489]
[ 1.42855878]
[ 1.42709837]
[ 1.42726163]
[ 1.42585347]
[ 1.42973957]
[ 1.42980622]
[ 1.43599317]
[ 1.44286782]
[ 1.57580564]
[ 1.59120978]
[ 1.6130606]
[ 1.59582232]
[ 1.5850841]
[ 1.61084701]
[ 1.59595849]
[ 1.52961191]
[ 1.50583099]
[ 1.46038687]
[ 1.44689328]
[ 1.5432668]
[ 1.55312445]
[ 1.44337678]
[ 1.44056972]
[ 1.50173311]
[ 1.59748366]
[ 1.4267731]
[ 1.47709901]
[ 1.62105239]
[ 1.60780394]
[ 1.53541989]
[ 1.60721757]
[ 1.58754631]
[ 1.5909996]
[ 1.60486746]
[ 1.48532045]
[ 1.56199286]
[ 1.42685994]
[ 1.42218871]
[ 1.42513733]
[ 1.42560821]
[ 1.42627889]
[ 1.42422753]
[ 1.42382572]
[ 1.42222283]
[ 1.41752142]
[ 1.41257471]
[ 1.41516891]
[ 1.41390184]
[ 1.58426403]
[ 1.53824457]
[ 1.45517987]
[ 1.500387]
[ 1.48309551]
[ 1.51026016]
[ 1.52573794]
[ 1.53639431]
[ 1.35975534]
[ 1.3949126]
[ 1.41854269]
[ 1.5371124]
[ 1.5318818]
[ 1.61626035]
[ 1.46463971]
[ 1.35377736]
[ 1.3781526]
[ 1.36485304]
[ 1.35738739]
[ 1.35879235]
[ 1.35848317]
[ 1.35674074]
[ 1.35842602]
[ 1.35549472]
[ 1.40440556]
[ 1.35685947]
[ 1.35700859]
[ 1.44201184]
[ 1.43235995]
[ 1.37015535]
[ 1.35396728]
[ 1.35545512]
[ 1.35623892]
[ 1.39545221]
[ 1.35725555]
[ 1.52999178]
[ 1.52399418]
[ 1.39365249]
[ 1.36779515]
[ 1.35482391]
[ 1.40293755]
[ 1.37213596]
[ 1.35738371]
[ 1.35808458]
[ 1.35662849]
[ 1.35528448]
[ 1.35510845]
[ 1.35379783]
[ 1.35430934]
[ 1.35312843]
[ 1.35581243]
[ 1.36879701]
[ 1.41158962]
[ 1.44027263]
[ 1.44380821]
[ 1.48272708]
[ 1.51507127]
[ 1.46605994]
[ 1.61084145]
[ 1.58922279]
[ 1.46771218]
[ 1.40289457]
[ 1.34716878]
[ 1.35043834]
[ 1.35590544]
[ 1.37653415]
[ 1.34764272]
[ 1.34831244]
[ 1.34689904]
[ 1.34150245]
[ 1.33927252]
[ 1.33978952]
[ 1.3470568]
[ 1.34433552]
[ 1.34484056]
[ 1.34160806]
[ 1.3407761]
[ 1.3424078]
[ 1.3433431]
[ 1.34328446]
[ 1.33992925]
[ 1.34388204]
[ 1.34802088]
[ 1.3453579]
[ 1.3428265]
[ 1.34329775]
[ 1.34191156]
[ 1.34611248]
[ 1.37349663]
[ 1.34815805]
[ 1.34014992]
[ 1.34521152]
[ 1.34456372]
[ 1.34089661]
[ 1.34023757]
[ 1.3410812]
[ 1.33807578]
[ 1.33572014]
[ 1.34433535]
[ 1.33505861]
[ 1.33827504]
[ 1.33755043]
[ 1.38559783]
[ 1.35527351]
[ 1.33053597]
[ 1.33701674]
[ 1.33273647]
[ 1.33668717]
[ 1.33941937]
[ 1.34060378]
[ 1.3372182]
[ 1.61340736]
[ 1.59055412]
[ 1.33505241]
[ 1.60308339]
[ 1.51156137]
[ 1.35797843]
[ 1.34580909]
[ 1.48117895]
[ 1.44494812]
[ 1.35293003]
[ 1.35665647]
[ 1.37410369]
[ 1.35666235]
[ 1.33729064]
[ 1.45931719]
[ 1.55375605]
[ 1.48339986]
[ 1.35060715]
[ 1.36146995]
[ 1.34245541]
[ 1.35342592]
[ 1.35796042]
[ 1.37098111]
[ 1.34045319]
[ 1.42147708]
[ 1.365122]
[ 1.4076879]
[ 1.39762825]
[ 1.34262013]
[ 1.38706403]
[ 1.33523713]
[ 1.33186205]
[ 1.33077059]
[ 1.3324637]
[ 1.33112122]
[ 1.32952302]
[ 1.33383435]
[ 1.32954544]
[ 1.33443469]
[ 1.33090967]
[ 1.33522262]
[ 1.33175321]
[ 1.49987289]
[ 1.51376666]
[ 1.4208718]
[ 1.49241705]
[ 1.36766608]
[ 1.36990194]
[ 1.33322159]
[ 1.34836793]
[ 1.34669257]
[ 1.36690579]
[ 1.37890552]
[ 1.59037649]
[ 1.60582728]
[ 1.61743431]
[ 1.62123338]
[ 1.61336502]
[ 1.60121318]
[ 1.62107838]
[ 1.41357384]
[ 1.61966948]
[ 1.51775743]
[ 1.33704794]
[ 1.37279934]
[ 1.34484306]
[ 1.3705884]
[ 1.41262748]
[ 1.44408315]
[ 1.52046936]
[ 1.38814136]
[ 1.38882472]
[ 1.35596408]
[ 1.52776999]
[ 1.55767315]
[ 1.33500518]
[ 1.33840795]
[ 1.34727997]
[ 1.43367698]
[ 1.35595655]
[ 1.34698186]
[ 1.59583696]
[ 1.374913]
[ 1.60214431]
[ 1.53554784]
[ 1.49221176]
[ 1.59822169]
[ 1.35287993]
[ 1.34985064]
[ 1.34512204]
[ 1.33554636]
[ 1.33612458]
[ 1.32905663]
[ 1.32990288]
[ 1.36225504]
[ 1.59836396]
[ 1.32984726]
[ 1.33153792]
[ 1.39786779]
[ 1.3416728]
[ 1.3547156]
[ 1.3417874]
[ 1.33787953]
[ 1.42237594]
[ 1.32939148]
[ 1.34560785]
[ 1.33542025]
[ 1.32921129]
[ 1.32924703]
[ 1.32956219]
[ 1.32953676]
[ 1.32962066]
[ 1.33064464]
[ 1.32916515]
[ 1.32946366]
[ 1.33199463]
[ 1.32940815]
[ 1.33035788]
[ 1.33158764]
[ 1.33103393]
[ 1.3312874]
[ 1.32907548]
[ 1.33131474]
[ 1.33113065]
[ 1.33056411]
[ 1.54542979]
[ 1.43053565]
[ 1.44441014]
[ 1.55239121]
[ 1.37602661]
[ 1.62125583]
[ 1.36640902]
[ 1.56636469]
[ 1.33713086]
[ 1.33348418]
[ 1.33584004]
[ 1.35366715]
[ 1.39788942]
[ 1.41189411]
[ 1.57317611]
[ 1.40385926]
[ 1.61962342]
[ 1.55777659]
[ 1.5813632]
[ 1.52487439]
[ 1.44917861]
[ 1.35809968]
[ 1.35031112]
[ 1.34328138]
[ 1.3453355]
[ 1.36096032]
[ 1.34087397]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论