如何修改Zipline众数用于分类数据获取A股数据

如何利用程序(如python) 从新浪财经或者雅虎财经获取到所有A股数据(历史日线数据,实时股票数据)? - 知乎426被浏览38342分享邀请回答1添加评论分享收藏感谢收起您所在的位置:&&正文
对冲基金事件驱动交易策略A股思路分享
作者:&A股通&
量化投资-全文略读:If prices have not changed enough, the value traders will profit directly from acting on the new information...
又是对冲基金,又是事件驱动,散户看了估计茫然了,其实看似高大上的词,其原理爆弱了,殊不知中国老百姓天天都在接触这类交易,还记得SARS病毒吗?还记得每次禽流感吗?还记的口蹄疫、疯牛病吗?黄豆、绿豆、大蒜、食盐?哪次事件不是被炒作到新闻联播?受影响最直接的就是资本市场,股市、商品期货等,是不是最后老百姓都被坑了?股民都被坑了?而聪明的投机客却在资本市场赚足了腰包。没错,原理就是事件驱动策略,够土吧,散户挂在嘴头的『炒概念』『炒地图』『炒消息』都属于事件驱动,只是散户们更多的错误理解了和错误的应用了事件驱动交易策略而已。
为了做这个分享,我还特意去了逼格比较高的知乎看看了各路江湖大侠对于事件驱动交易策略的观点,看完之后我越发感觉这里就是一个装逼的地方,满嘴拽CFA中学到英文,各种让散户看不懂的策略名词,什么MA,什么FDA,什么Distressed,其实就是那么简单的东西,各种wikipedia上的资料和内容而已,其实我也能理解他们这帮人,他们认为知乎社区都是他们这样的精英,分享这些内容也是给精英看的,散户理解不了,你们不说普通话散户能懂吗?另外,你们都用『牛逼闪闪』的事件驱动策略赚到钱了吗?我想你们的业绩可能跟散户一个水平线吧。
我想能用大白话说清楚这种交易策略很关键,这还不是最关键的,最关键的是要找到A股目前市场使用的事件交易策略,你非要举个美国潘兴资本Bill Ackman这种激进基金进入上市公司董事会对公司资产进行处理,从而试图改变公司权益的这种例子,散户看了管鸟用?基本还是属于装逼用的玩意儿。
再比如,一些有毒资产的另类投资,都需要对标的资产进行资产重组,这些跟个人投资者根本没关系,即使A股今后有了CDS或者收益互换这类衍生品,散户也玩不了。所以,说点儿实际的,说点儿身边的,说点儿装逼的人看不起的事件驱动策略。中国散户虽然很说弱,但是一旦让中国散户掌握了本该掌握的技术和理念,散户绝对可以碾压一切所谓的专业机构和投资者。
对于『事件』的定义,其实很简单,但是事件多如牛毛,我这里只举一个例子,提供一个完整的事件驱动策略分析和创建方法,人脑的聪明之处就是可以举一反三,如果你还会编程,那就更好了,不仅可以举一反三,还可以大规模的提升交易策略创建的效率。
首先,事件驱动交易的核心思路是主动承担事件不确定带来的风险来获得超额收益。按照这一个思路,我们整理一下我们创建事件驱动交易策略的步骤:(A股相关的事件)
定义事件(宏观/微观/经常性/非经常性)
定义事件作用时间(提前/延迟)
用统计方法确定作用效果(有效/无效/不显著)
步骤1中的事件的类型,我在前面文章有贴过两张图,我把事件分两大类,然后在对其进行细分,比如微观或宏观,如下图:
步骤2和3定义事件作用时间和确定作用效果,目前市面上还没有免费给散户提供相关功能的软件或应用,相信我们在不久将来的可以提供。其实也不是什么高深莫测的黑科技,就是一个简单便捷的统计分析工具。像国外的Kensho已经开始为机构投资者提供类似的分析服务工具。
如上图,就是一个简单便捷的统计分析工具,统计的是好消息、坏消息、无消息分别与对上市公司【-20日~+20日】价格走势(这里用的是CAR累计异常收益率)的影响,当然这里的好消息、坏消息还是需要通过一些更加复杂的自然语言处理算法进行更加深入的分析判断的,这里就让大家简单理解一下,看图表就非常明显,轻松就完成了事件作用时间和效果的研究,最后就是按照研究出的规律进行策略创建了。当然,这里的统计的样本是某个时间某个市场(美国)某批样本的统计结果,这可不是对全市场规律的总结,事件驱动策略是非常个性化非常复杂多变的,一定要注意,这个研究方法放到A股某个时间段、某批样本数据统计来看,也许你会发现,很多消息都是异常的,很可能是存在大量的内幕交易。
步骤4就是创建策略了,其实这个环节意味着你已经完成了你交易策略创建的60%,剩下的就是将这些规律组织成算法模型弄成一个程序化或半程序化的交易策略了。其实这个领域很多公司都在做,比如美国的Quantopian以及国内一大堆抄袭Quantopian的公司,我们自己也有类似的策略平台,不过目前大家的策略平台都太皮毛了,大部分都是基于Quantopian的Zipline事件驱动引擎开发来的,当然将来这个领域会有很颠覆的发展,不会编程的散户照样轻松应用这种技术,让我们拭目以待。
最后还要说一句,交易策略已经100%创建完成了,但是这里完全的还有很大的距离,在我看来,创建交易策略只占这个环节的50%,剩下的还有非常重要的资金管理、风险控制、订单管理、等,这些貌似里A股还远了些,不赘述了。但是如果散户可以掌握我上面说的这个策略创建的方法,已经可让A股的市场结构发生颠覆的变化了。
最后摘抄一段文章,英文不错的可以读一下,可以更加深入了解事件驱动策略
from Trading and Exchanges
News traders collect and act upon new information about instrument values. They try to predict how instrument values will change, given the new information. If they think that values will change significantly, they then buy or sell instruments, depending on whether the news is good or bad.Material information is information that significantly affects instrument values. News traders try very hard to discover material information before other traders do. Successful news traders employ experts in data collection who can quickly filter public data sources for valuable information, researchers with strong investigative skills who can produce useful new information,and traders who can quickly and accurately analyze implications of new in-formation for instrument values.Unlike value traders, news traders do not estimate the value of an in-strument from first principles and all available data. Instead, they implicitly assume that current prices accurately reflect all information except their news. Their object is merely to estimate how values will change in response to their new information. They estimate total instrument values by adding to current prices their estimates of how their news changes values.Successful news traders must collect information and act on it before other traders do. Those who collect and respond to publicly available in-formation must be extremely quick, because much of the news that affects security and contract values is easy to obtain and interpret. These traders often compete with many other traders who simultaneously try to profit from trading on the same news. News traders who specialize in producing information through their own investigative research need not be so quick,but they still must be faster than their competitors. In either case, only traders who can trade before their news has its impact will profit.Traders who trade on inside information are news traders. Inside information is material information that traders directly or indirectly obtain from the management of a company and that is not yet publicly available. In the United States, and in many other countries, trading on inside information is illegal. We consider how the prohibition on insider trading affects the security markets and the managerial labor markets in chapter 29.Large money managers who pursue information-flow trading strategies usually have flat organizations with few management levels. In flat organizations, managers are allowed (within limits) to make whatever decisions are necessary to pursue the firm's objectives. Flat organizations can make quick decisions with little deliberation. This structure is well suited to firms that trade on the flow of information because their traders generally must act quickly in order to trade profitably on their information.Successful firms that trade on information flows use various systems to quickly collect and deliver information to portfolio managers, who analyze it and possibly trade upon it. These systems may include networks of re-porters, brokers, or analysts whom the firms reward for providing them with valuable information. They may also include computerized systems that read and interpret electronic news feeds produced by news services like the Dow Jones Broad Tape. News traders may also employ clipping services to summarize newspaper articles from around the nation and the world. In addition, many news traders have television monitors on their desks tuned to fi-nancial news channels as well as computer monitors that scroll information distributed by electronic news services.
To trade profitably, news traders must trade before prices adjust to reflect their information. A price reflects information if that information cannot be used to forecast future price changes. If that is the case, the information is in the price. Information gets into the price when all traders are aware of its significance or when informed traders push prices toward their estimates of fundamental value. Information that is already in the price is stale information. News traders cannot trade profitably on stale information.
The most common mistake that traders make is to trade on stale information. Economists call traders who trade on stale information pseudo-informed traders. Pseudo-informed traders think that they are well informed,but in fact they are not. They lose because they tend to buy when prices are already high and to sell when prices are already low. Pseudo-informed traders are actually uninformed traders.
Good news traders must know whether their information is already in the price before they trade. Unfortunately, they rarely know this. To answer the question directly, they must estimate instrument values from first principles. Although value traders routinely do these analyses, few news traders are well equipped to do so. However, traders often can make an educated guess about the quality of their information based on how they obtained it.If they are acting on unique information that others could not have anticipated, their information probably is not stale. If they have been slow to act, if their information is widely known, if others can obtain it cheaply,or if others could have reasonably anticipated it, their information probably is stale.
Since news traders generally do not estimate values as well as value traders do, they generally make more mistakes than value traders. Although news traders usually can accurately predict the direction in which values should change in response to their information, they often poorly estimate the sizes of the changes. In particular, they may under- or overestimate the implications of their information for instrument values. When they underestimate how much values should change, they lose the opportunity to make more money. When they overestimate how much values should change, they lose some, all, or even more than all, of what they gain as informed traders. In either case, value traders may recognize that prices do not accurately reflect values when they eventually learn the news and revise their value estimates accordingly. If prices have not changed enough, the value traders will profit directly from acting on the new information. If prices have changed too much, the value traders will profit by correcting the overreaction.&苹果/安卓/wp
积分 24, 距离下一级还需 21 积分
道具: 彩虹炫, 涂鸦板, 雷达卡, 热点灯, 金钱卡下一级可获得
道具: 显身卡
购买后可立即获得
权限: 隐身
道具: 金钱卡, 彩虹炫, 雷达卡, 热点灯, 涂鸦板
尴尬签到天数: 2 天连续签到: 1 天[LV.1]初来乍到
如题,想用来进行模型的回测,谢谢~~~
支持楼主:、
购买后,论坛将把您花费的资金全部奖励给楼主,以表示您对TA发好贴的支持
载入中......
要免费的数据接口吗?
http://quotes./trade/lsjysj_zhishu_000001.html?year=2014&season=1
http://stockhtm./sstock/quotpage/q/600030.htm#detail
其余的可以自己去新浪 雅虎 网易 腾讯去找
发表于10楼
通达信里可以通过数据导出功能导出
炒股软件都有吧,大智慧可以下
学校图书馆
总评分:&经验 + 5&
论坛币 + 5&
本帖被以下文库推荐
& |主题: 2346, 订阅: 28
& |主题: 2305, 订阅: 12
Ψ▄┳一大卫卍卐席尔瓦
wind数据库
学校的机房可能有
要向前复权的
同花顺 大智慧也行
fantuanxiaot 发表于
wind数据库
学校的机房可能有同花顺有没有方便的方法可以批量导出所有股票的数据?导出后如何转为excel或者其他格式的数据以供matlab或者Python分析?
鼓励积极发帖讨论
总评分:&论坛币 + 5&
Ψ▄┳一大卫卍卐席尔瓦
硅步鸭 发表于
同花顺有没有方便的方法可以批量导出所有股票的数据?导出后如何转为excel或者其他格式的数据以供matlab或 ...向您推荐一个帖子
fantuanxiaot 发表于
向您推荐一个帖子
http://bbs.pinggu.org/thread--1.html谢谢~~不过还是希望有更有效的办法。
Ψ▄┳一大卫卍卐席尔瓦
硅步鸭 发表于
谢谢~~不过还是希望有更有效的办法。要免费的数据接口吗?
其余的可以自己去新浪 雅虎 网易 腾讯去找
总评分:&经验 + 5&
论坛币 + 20&
学术水平 + 1&
热心指数 + 1&
信用等级 + 1&
学校图书馆& && && && && && && && &&&
总评分:&论坛币 + 5&
guowy67 发表于
学校图书馆谢谢。
炒股软件都有吧,大智慧可以下
总评分:&论坛币 + 5&
通达信里可以通过数据导出功能导出
总评分:&论坛币 + 15&
初级学术勋章
初级学术勋章
初级热心勋章
初级热心勋章
中级热心勋章
中级热心勋章
中级学术勋章
中级学术勋章
初级信用勋章
初级信用勋章
中级信用勋章
中级信用勋章
高级热心勋章
高级热心勋章
高级学术勋章
高级学术勋章
特级学术勋章
特级学术勋章
特级热心勋章
高级热心勋章
高级信用勋章
高级信用勋章
特级信用勋章
高级信用勋章
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
如有投资本站或合作意向,请联系(010-);
邮箱:service@pinggu.org
投诉或不良信息处理:(010-)
论坛法律顾问:王进律师

我要回帖

更多关于 中位数适用于分类数据 的文章

 

随机推荐