
the learning road of a quant
文章平均质量分 81
云金杞
量化研究员\CTA量化基金经理,金融硕士,CIIA,CFP,FRM,CFA,擅长使用python进行数据分析和建模,熟练使用backtrader、tbquant等量化平台。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
empyrical 模块的学习与分析 note3
读了一遍utils.py文件的代码,其中获取数据的部分大部分因为谷歌、雅虎的数据接口变动,大部分已经不能使用。剩下的一些函数主要是rolling的函数。代码总体上写的比较好,值得一读。## Copyright 2016 Quantopian, Inc.## Licensed under the Apache License, Version 2.0 (the "License");# you ma...翻译 2018-06-03 11:53:20 · 1350 阅读 · 0 评论 -
empyrical 模块的学习与分析 note4
stats.py里面封装了大量的计算绩效和风险的指标,但是估计这个写的时间比较早,用了大量的numpy,而对pandas使用较少,如果使用pandas的高级功能来封装这些函数的话,总体的代码量可能大大较少###########################################################################从future模块引入division,在py...翻译 2018-06-03 15:24:57 · 3231 阅读 · 0 评论 -
empyrical 模块学习与分析 note5
最后一个文件是perd_attrib.py,这个文件主要是做绩效归因的,把股票的收益率归因为某些factor能解释的部分,就是common_returns,这些因素不能解释的部分,就是特别收益import pandas as pddef perf_attrib(returns, positions, factor_returns, ...翻译 2018-06-03 15:34:54 · 945 阅读 · 0 评论 -
emprical 模块学习与分析 note6
对于如何使用这个模块做了一些简单的例子,主要是调用empyrical里面的函数计算相应的指标import empyrical import numpy as npimport pandas as pdimport matplotlib.pyplot as plt#读取数据returns=pd.read_csv('C:/code/empyrical/empyrical/empyrical/tests...原创 2018-06-03 16:10:26 · 1884 阅读 · 0 评论 -
量化投资中收益率的计算方法
不同的平台,不同的交易策略,计算收益率的方法很可能不同。方法一:简单收益率 用最终资金减去初始资金就是所获得的盈利,然后用盈利除以初始资金就是收益率。这种方式比较简单直接,非常符合个人投资者的模式,最开始用了多少资金,最后变成了多少资金,比较清晰,也比较经典。缺点在于没有考虑资金成本和时间成本。方法二:净值收益法 在A时期用money_A获得了盈利profit_...原创 2018-06-08 16:47:14 · 11615 阅读 · 0 评论 -
empyrical 模块的学习与分析 note_1
empyrical is a Python library with performance and risk statistics commonly used in quantitative finance by Quantopian Inc. #empyrical是quantopian公司开发的用于量化金融领域的绩效和风险统计的python模块 github地址:https:...翻译 2018-06-02 11:55:17 · 3625 阅读 · 0 评论 -
empyrical 模块的学习与分析 note_2
period.py 这个文件里面主要设置了年化计算的时候的时间,比如,一年约252个交易日,一年12个月,一个月21个交易日等问题。APPROX_BDAYS_PER_MONTH = 21APPROX_BDAYS_PER_YEAR = 252MONTHS_PER_YEAR = 12WEEKS_PER_YEAR = 52DAILY = 'daily'WEEKLY = 'weekly'MONTHLY =...翻译 2018-06-02 15:30:34 · 1770 阅读 · 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 · 434 阅读 · 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 · 361 阅读 · 0 评论