
回测系统
云金杞
量化研究员\CTA量化基金经理,金融硕士,CIIA,CFP,FRM,CFA,擅长使用python进行数据分析和建模,熟练使用backtrader、tbquant等量化平台。
展开
-
我的python回测系统创建之路(1)
接触到了不少Python相关的开源项目,也接触到了不少回测框架,感觉这些框架都比较难懂,加上自己用pandas做回测,效率有点低,要建立一套自己的回测框架。 读了不少Python回测框架作者创建框架的思路与理念,觉得使用事件驱动型框架比较好,另外,我要创建的这个框架将会模仿文华财经或者TB进行创建。正好最近读master Python for finnace 这本书,第九章有讲怎原创 2017-09-16 15:47:38 · 12933 阅读 · 2 评论 -
backtrader回测框架学习笔记-1
#基于macd技术指标的策略from __future__ import (absolute_import, division, print_function, unicode_literals)import datetime # For datetime objectsimport os.path # To manage pathsi原创 2018-04-20 11:17:41 · 3352 阅读 · 0 评论 -
backtrader-学习笔记2
from __future__ import (absolute_import, division, print_function, unicode_literals)import datetime # For datetime objectsimport os.path # To manage pathsimport sys # T原创 2018-04-20 11:44:52 · 6775 阅读 · 3 评论 -
python回测与交易框架的order_id管理
一直比较头痛order_id应该怎么去管理,忽然想到了时间戳,可以很好的管理order_id,并且知道order发出去的时间,very gooddef get_order_id(): return str(round(time.time()*10000000)) 当回测的时候,可以以交易的时间作为时间戳。但是,这种情况下,如果同一时间下很多order,就会造成order_id重...原创 2018-11-14 14:27:45 · 1395 阅读 · 0 评论 -
pyalgotrade源码阅读:bar.py
""".. moduleauthor:: Gabriel Martin Becedillas Ruiz <gabriel.becedillas@gmail.com>"""import abcimport sixclass Frequency(object): """Enum like class for bar frequencies. Valid val...转载 2018-11-26 14:12:32 · 736 阅读 · 0 评论 -
pyalgotrade源码阅读:事件驱动的机制,observer.py
# PyAlgoTrade## Copyright 2011-2018 Gabriel Martin Becedillas Ruiz## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the Lice...转载 2018-11-26 14:53:12 · 588 阅读 · 0 评论 -
pyalgotrade源码阅读:utils里面单独的函数
""".. moduleauthor:: Gabriel Martin Becedillas Ruiz <gabriel.becedillas@gmail.com>"""def get_change_percentage(actual, prev): '''计算值变化的百分比 Arguments: actual {[number]}...转载 2018-11-26 15:02:33 · 316 阅读 · 0 评论 -
pyalgotrade源码阅读:事件分发机制dispatcher.py
from pyalgotrade import utilsfrom pyalgotrade import observerfrom pyalgotrade import dispatchprio# This class is responsible for dispatching events from multiple subjects, # synchronizing them ...转载 2018-11-26 15:14:49 · 427 阅读 · 0 评论 -
pyalgotrade源码阅读:时区的设定marketsession.py
""".. moduleauthor:: Gabriel Martin Becedillas Ruiz <gabriel.becedillas@gmail.com>"""## 已读,市场的时区import pytz# http://en.wikipedia.org/wiki/List_of_market_opening_timesclass MarketSessi...转载 2018-11-26 15:18:48 · 348 阅读 · 0 评论