量化交易入门

上传人:ba****u 文档编号:140962724 上传时间:2022-08-23 格式:DOCX 页数:10 大小:47.58KB
收藏 版权申诉 举报 下载
量化交易入门_第1页
第1页 / 共10页
量化交易入门_第2页
第2页 / 共10页
量化交易入门_第3页
第3页 / 共10页
资源描述:

《量化交易入门》由会员分享,可在线阅读,更多相关《量化交易入门(10页珍藏版)》请在装配图网上搜索。

1、化交易入门译者:HorseHour 原作者:MichaelHalls-Moore发表时间:2014-07-10浏览量:1861评论数:1挑错数:0量化交易(QuantitativeTrading )与传统证券交易机制存在极大的差异,一度有人神侃,量化交易就是让机器赚钱,你躺那儿数钱。本文是一篇入门文章,带您一睹量 化交易的剪影,并非说笑,真容难觅啊,吼破嗓子不如甩开膀子,一切还得你自己去创造!我将通过这篇文章向你介绍端到端的量化交易系统的一些基本概念。本文主要面向两类读者,第一类是正在努力寻找一份基金管理公司量化交易员工作的求职 者,第二类是期望尝试开启自己散户”算法交易事业的人士。量化交易是

2、数量金融学(注1)中一个极其艰深复杂的领域。若要通过面试或构造你自己的交易策略,就需要你投入大量的时间学习一些必备知识。不仅如此, 它还需要你在MATLAB、R或Python至少一门语言上具备丰富的编程经验。随着策略交易频率的增加,技术能力越来越重要。因此,熟悉C/C + +是重中之重。一个量化交易系统包括四个主要部分:策略识别:搜索策略、挖掘优势(注2)、确定交易频率。回溯测试:获取数据、分析策略性能、剔除偏差。交割系统:连接经纪商、使交易自动化、使交易成本最小化。风险管理:最优资本配置、最优赌注或凯利准则、交易心理学。我们首先来谈谈如何识别一个交易策略。策略识别所有量化交易流程都肇始于一个

3、初期研究。这个研究流程包括搜索一个策略、检验它是否适合你可能正在运作的策略组合、获取任何测试策略时所需数据、努 力优化策略使其收益更高且(或)风险更低。如果你是一个散户”交易员,一定要清楚自己的资金是否充足,以及交易成本对策略的影响。通过各种公开数据搜索可盈利的策略实际上十分简单,并没有大家想的那么难。研究学者会定期发表理论交易结果(虽然大多为交易成本总额)。一些数量金 融学主题博文也会详细讨论策略。交易期刊还会简报一下基金管理公司使用的一些策略。你可能会问,个人与公司怎么可能愿谈他们的可盈利策略,特别是当他们知道,如果其他人复制相同的策略,长期而言它终将失效。原因就在于,他们通 常不会透露具

4、体的参数以及他们所使用的调参方法,而这些优化技能才是把一个表现平庸的策略调成一个回报丰厚的策略所需的关键技术。实际上,若要创建 你自己的、独一无二的策略,一个最好的法子就是寻找相似的方法,尔后执行你自己的优化程序。我这里提供几个网站,你可以藉此寻找策略性思想:SocialScienceResearchNetworkarXivQuantitativeFinanceSeekingAlphaEliteTraderNuclearPhynanceQuantivity你所看到的很多策略都可归入均值回归交易策略、趋势跟随或动量交易策略两类。均值回归策略试图利用这么一个事实:价格序列”(如两个关联资产的价 差

5、)存在一个长期均值,价格对均值的短期偏离终将回归。动量交易策略则试图搭上市场趋势的顺风车”,利用投资心理和大基金结构信息在一个方向积聚 动量,跟随趋势直至回归。定量交易还有一个重要方面,即交易策略的频率。低频交易(LowFrequencyTrading,LFT)通常指持有资产超过一个交易日的策略。相应地,高频交易(High FrequencyTradingHFT)通常指持有资产一个交易日的策略。超高频交易(Ultra-HighFrequencyTradingUHFT)指持有资产的时常达秒级与毫秒级的 策略。虽然散户可以进行HFT与UHFT交易,但也只是在你掌握了交易技术栈”(注3)与订单簿动力

6、学(注4)的详细知识后才有可能。本篇入门文章, 我们不会对这些问题做任何深入探讨。策略或策略集合一旦确定,现在就需要在历史数据上测试其盈利能力,这就进入了回溯测试的工作范围。回溯测试回溯测试的目标是提供证据,佐以证明通过以上流程所确定的策略,无论是应用于历史(训练)数据还是测试数据(注5)均可盈利。它可以反映该策略未来 在真实世界”中的预期表现。由于种种原因,回溯测试不能保证一定成功。这或许就是量化交易最为微妙之处,由于它包含了大量的偏差,我们必须尽尽力 仔细审查并剔除它们。我们将讨论几种常见类型的偏差,包括先窥偏差(注6)、幸存者偏差(注7)与优化偏差(亦称数据窥视偏差”,注8)。回溯测试

7、中其他几个重要方面,包括历史数据的可用性与清洁度、真实交易成本及可靠回测平台上的决定。我们会在后续“交割系统”一节深入讨论交易成本。策略一旦确定,我们就需要获取历史数据,并藉此展开测试,如有可能还可改进策略。现在卖数据的很多,所有资产类型的数据都有。通常,数据的质量、深 度、时间间隔不同,其价格也不同。刚入门的量化交易员(至少零售等级)最初使用雅虎金融板块(YahooFinance)的免费数据就行。对于数据供应商,这 里不再赘言。我想重点谈一谈处理历史数据时,时常遇到的问题。对于历史数据,人们主要关心的问题,包括数据精度或清洁度、幸存者偏差、应对如分发红利、拆分股票等公司行为的调整。精度与数据

8、整体质量有关,无论数据是否包含错误。有时错误容易识别,比如使用一个窄带滤波器(注9),就可以找出时间序列数据中的“窄 带”并更正它们。其他时候,错误又很难甄别,经常需要根据多个数据供应商提供的数据进行对比检查。幸存者偏差通常是免费数据集或廉价数据集的一个”特征。对于一个带有幸存者偏差的数据集,它不包含已经不再交易的资产数据。不再交易 的证券,则表示已经退市或破产公司的股票。如果数据集中含有此类偏差,策略在此数据集上的测试表现可能比在”真实世界里表现的更好, 毕竟历史”赢家“已经被预先筛选出来,作为训练数据使用。公司行为即公司开展的常引发原始价格阶梯形变化的”逻辑活动,它不应该计入价格收益。公司

9、分发红利和拆分股票行为是引发调整的两个常 见行为,二者无论发生哪一种,都需要进行一个回调的流程。我们一定要留心,不要把股票拆分和真实收益调整混为一谈。许多交易员在 处理公司行为时都碰过壁!为了开展回溯测试,我们必须使用一个软件平台。你可以选择一个专门的回测软件如Tradestation,一个数值平台如Excel或MATLAB,或者一个用Python 或C+完全自主实现的平台。对于Tradestation(或类似平台)、Excel或MATLAB,我不作过多介绍。我比较推崇的是创建一个内部技术栈。这么做的一个 好处是可以实现回溯测试软件与执行系统的无缝集成,甚至还可以添加一些高级的统计策略。对于H

10、FT策略,更应该使用自主实现的系统。在做系统回测时,一定要量化表示系统性能。定量策略的业界标准”度量为最大资金回挫与夏普比率。最大资金回挫表示一段时间(通常一年)内账户资金 曲线从波峰至波谷的最大跌幅,常使用百分比表示。由于大量的统计因素,LFT策略比HFT策略的资金回挫更高。历史回测会显示过去的最大资金回挫,它能 够较为贴切地反映策略的未来资金回挫情况。第二个度量指标是夏普比率,它被启发式地定义为超额收益均值与超额收益标准差的比值”。这里,超额收益 表示策略收益超出某个预定基准,如标普500或三月期短期国债(收益)的额度。注意人们通常不使用年化收益指标,因为它忽略了策略波动性的影响,而夏 普

11、比率却考虑到了这一点。如果经过回测,策略的夏普比率很高且其最大资金回挫已经最小化,则可以认为它趋于无偏,下一步就是要搭建一个交割系统。交割系统 交割系统是一个方法集合,由它来控制交易策略生成的交易列表的发送和经纪商的交割行为。事实上,交易可以半自动、甚至全自动生成,而执行机制可以手 动、半自动(即点击一次交割一项”)或者全自动。尽管如此,对于LFT策略,手动和半自动技术却比较常见;对于HFT策略,则必须创建一个全自动交割 机制,由于策略和技术彼此依赖,还要经常与交易指令生成器紧密相接。在搭建交割系统时,我们需要考虑几个关键因素:连接经纪商的接口、交易成本(包括佣金、滑动价差与价差)最小化、实时

12、系统与回测时系统性能的差异。联系经纪人的方法有很多,你可以直接电话联系他,也可以通过一个全自动高性能的应用程序接口(API)实现。理想情况,就是希望交割交易的自动化程度尽 可能高。这样一来,你不仅可以脱开身集中精力进行深入研究,还能运行多个策略、甚至HFT策略(实际上,如果没有自动化交割,HFT根本不可能)。前面 说过的几种常用回溯测试软件如MATLAB. Excel和Tradestation,对于LFT策略或简单策略都是不错的选择。但是,如果要做真正的HFT,你就必须要构造 一个用高性能语言(如C+)编写的内部交割系统。说个我的亲身经历,以前受聘于一家基金管理公司,我们有一个十分钟的交易周期

13、,每隔十分钟下载 一次新的市场数据,然后根据这十分钟的信息进行交割。这里用的是一个优化的hon脚本。对于任何处理分钟级或秒级频率数据的工作,我相信C + +更 哄在一家大型的基金管理公司,交割系统的优化通常不在量化交易员的工作范围。但是,在小点的公司或高频交易公司,交易员就是交割人,所以技术面越广越 好。你要想进一家基金管理公司,一定要记住这一点。你的编程能力不说比你的统计学和计量经济学禀赋更重要,至少也同样重要!另外一个属于交割系统的重要问题是交易成本最小化。一般地,交易成本由三部分构成:佣金(或税收)、损耗与价差。佣金是向经纪商、交易所和证券交易 委员会(或类似政府监管机构)支付的费用;滑

14、动价差是你的预期交割价位与真实交割价位的差值;价差则是待交易证券的卖出价与买入价之差。注意价差不 是常数,它依赖于市场当前流动性(即买单和卖单数量)。交易成本是决定一个策略是高夏普比率且盈利丰厚,还是低夏普比率且极不盈利的关键。根据回溯测试正确预测未来的交易成本很具有挑战性,你需要根据策 略频率,及时获取带有卖出价与买入价信息的历史交易数据。为此,大型基金管理公司量化交易的整个团队都专注于交割优化。当基金管理公司需要抛售大量 交易时(原因五花八门),如果向市场倾泻大批股票,会迅速压低价格,可能都来不及以最优价格交割。因此,纵使遭受损耗风险,基金管理公式也会选 择使用算法交易,通过打点滴的方式向

15、市场出单。此外,其他策略如若捕到这些必要性条件,也能利用市场失效(获利)。这是基金结构性套利的内 容。交割系统最后一个主要问题关系到策略的实时性能与回测性能的差异。这种差异由多种因素造成,比如我们在回溯测试一节已经深入讨论过的前窥偏差与 最优化偏差。然而,对于有些策略,在部署之前不易测得这些偏差。这种情况对于HFT最为常见。交割系统和交易策略本身均可能存在程序错误,回溯测试时 没有显现却在实时交易时出来捣乱。市场可能受到继交易策略部署后的一场政变的影响,而新的监管环境、投资者,情绪与宏观经济形势的变化也均可能导致现 实市场表现与回溯测试表现的差异,从而造成策略盈利性上的分歧。风险管理量化交易迷

16、宫的最后一块是风险管理程序。风险包含我们之前谈论的所有偏差。它包括技术风险,比如所有在交易所的月艮务器突然发生硬盘故障。它还包括经 纪风险,如经纪商破产(此说并非危言耸听,最近引发恐慌的明富环球就是一个例子,注10 )。总而言之,它覆盖了几乎所有可能干扰到交易实现的因素,而 其来源各不相同。目前已经有成套的书籍介绍量化交易策略的风险管理,本人也就不再对所有可能的风险来源做详细说明。风险管理还包括投资组合理论的一个分支,即所谓的最优资本配置,涉及到如何将资本分配给一组策略、如何将资本分配给策略内不同交易的方法。这是 个复杂的领域,依赖于一些高级数学知识。最优资本配置与投资策略杠杆通过一个名为凯利

17、准则(注11)的业界标准建立联系。本文是一篇入门文章,我在 此不详谈其计算。凯利准则对策略收益的统计性质做过一些假设,但是它们在金融市场中并不一定成立,交易员因此在实现时通常会有所保留。风险管理的另外一个关键成分涉及到交易员自身心理因素的处理。尽管大家都承认,算法交易若无人为干涉,不太容易出现问题。交易员在交易时,稍不留神 仍然可能会掺入许多认知偏差。一个常见的偏差是厌恶规避,当人发现损失已成定局,其所带来的痛苦,可能会麻痹人的行为,不能做到及时抛盘止损。类似 地,由于太过忧心已经到手的收益可能赔掉,人们可能也会过早抛盘收利。另外一个常见的偏差是所谓的近期偏好偏差:交易员太看重近期事件而非长远

18、地看 问题。此外,当然不能落下恐惧与贪婪”这对经典的,情绪偏差。这两种偏差常导致杠杆不足或杠杆过度,造成爆仓(账户资产净值近乎为零或更糟)或盈利 缩水的局面。总结由此观之,量化交易是数量金融学中一个虽趣味十足但极其复杂的领域。我对这个话题的讨论浅尝辄止,文章就已经这么长了!我在文中三言两句带过的问题, 已经有大量的相关书籍和论文出版。因此,在你申请量化基金交易职位前,务必要进行大量的基础调研,至少应当具有统计学和计量经济学的广泛背景,以及 使用MATLAB、Python或者R程序语言实现的丰富经验。如果应对的是更加复杂的高频端策略,你的技能组合可能还要包含Linux内核修改、C/C+、汇编 编

19、程和网络延迟优化。如果你有兴致创建自己的算法交易策略,我的头条建议就是练好编程。我偏向于尽可能多地自己实现数据采集器、策略回溯测试系统和交割系统。如果你自己 有投钱做交易,而你又了解系统是否已经通过充分测试,还知晓其存在的缺陷和特殊问题,你怎么可能夜里睡不踏实?如果把它外包出去,短期内也许节省了 时间,但长期来看可能成本巨大。译注:(01).数量金融学(QuantitativeFinance),也称金融工程学或金融数学,通过高级数学理论量化分析金融产品,为金融市场提供了多样性的金融衍生产 品,在丰富投资选择的同时也带来了隐患,比如2008年金融危机。从事数量金融工作的人常使用矿工”(Quant

20、)自嘲,由于使用大量的高级数学技术也 有人称他们火箭科学家。(02).挖掘优势(ExploitinganEdge)并无特别明确的上下文关系。如果以边界理解,也不恰当,毕竟常用于表达数学边界含义的是另外一个词,Bound。 所谓挖掘优势,即对搜索到的多个策略进行对比,选择最佳的一个使用。(03 ).技术栈(TechnologyStack)实际上是提供应用服务的系统所使用的各种技术,若从分层角度来看,各种技术层叠相连、彼此分工协作,好像一个栈。 如果有人对各种技术都有颇深造诣,那么他(她)就可称作是一名全栈工程师(FullStackEngineer ),通俗点就是一多面手、全才,在业界绝对炙手可

21、热。(04).根据交易机制,证券市场可以分成报价驱动市场(Quote-drivenMarket)、订单驱动市场(Order-drivenMarket)订单簿动力学(OrderBook Dynamics)则是根据订单驱动市场的信息,探索订单量、流动性与价格之间的动力关系。其主要目的是使用高频交易订单簿当前数据信息预测其短期状态,以 辅助做出最佳投资决策。(05).量化交易中使用的每种投资策略实际上就是一个数学模型。在搜索投资策略时,存在各种各样的模型,如何选择呢?可以对投资策略做回溯测试(Backtesting ),检测模型在历史数据中的表现。然而,这里就出现一个问题,模型中可能存在各种参数,选

22、择不同的参数对于模型性能的影响也是不同的, 为此就需要在测试之前进行一个模型参数调优的过程。典型的做法是将完整的历史数据分割成多份,最简单地是分成两份:一部分做训练样本,另外一部分作 为测试数据。如果首先抽样得到训练样本,那么余下的数据就是测试数据(Out-of-SampleData)。(06).由于利用历史数据回测时,策略在实际运作中使用的信息与历史数据回测时使用的信息不同,比如策略日均价达到10元卖出在实时运作时,只能 得到开盘至当前的价格数据,从而无从获得日均价的数据。它如同一部穿越剧,属于典型的先窥偏差(Look-aheadBias)。(07).用于回测的历史数据通常都会经历一个预处理

23、的过程,将部分数据删除。比如,由于私有化或收购的退市股票,只存在部分交易数据,可能会从数据 集中剔除,只使用那些一直处于交易状态的数据进行回测。这种只使用预先筛选的幸存者数据进行回测所产生的偏差称作幸存者偏差(SurvivorshipBias)。关于幸存者偏差,有个二战的故事读者可以读读(08).优化偏差(OptimisationBias),亦称数据窥视偏差”(Data-snoopingBias),从机器学习的角度来看,这即是过拟合,经过过度优化,策略虽 然在历史数据测试集上表现不错,然而在实际应用时却差强人意。(09).窄带滤波器(SpikeFilter)主要用于处理时间序列数据的大幅波动。

24、一般而言,时间序列数据的移动变化较为平缓,为了探测数据中可能包含的异常 数据,可以使用一个滤波器,将波动变化异常(设定阈值)的数据进行变换,恢复到正常范围,反之则保持不变。由于异常数据呈现扁平长窄带状,窄带滤波 器名称由此而来。(10).明富环球(MFGlobal)是全球最大的商品期货经纪商之一,数月之内在欧洲主权债券上的投资达到63亿美元,接近其资本的6倍,其杠杆率飙升至 40:1。由于欧债危机,其信用评级跌至垃圾级,2011年10月31日向法院提交破产保护申请。(11 ) .1956年,贝尔实验室的工程师约翰拉里凯利(JohnLarryKelly )在研究长距离电话通讯噪声问题时推导出的一

25、个公式,由于意外在21点、赌马等 博彩游戏中获得成功,后来广泛应用于证券投资领域,即凯利准则(KellyCriterion )。由于长距离通话存在随机噪声,凯利研究如何传输信号,从而保证传输 速率最大。如果将其应用于赌博,就可以确定每次的赌注大小从而赢的最多。BEGINNERS GUIDE TO QUANTITATIVE TRADINGBy Michael Halls-Moore on March 26th, 2013In this article Im going to introduce you to some of the basic concepts which accompany a

26、n end-to-end quantitative trading system. This post will hopefully serve two audiences. The first will be individuals trying to obtain a job at a fund as a quantitative trader. The second will be individuals who wish to try and set up their own retail algorithmic trading business.Quantitative tradin

27、g is an extremely sophisticated area of quant finance. It can take a significant amount of time to gain the necessary knowledge to pass an interview or construct your own trading strategies. Not only that but it requires extensive programming expertise, at the very least in a language such as MATLAB

28、, R or Python. However as the trading frequency of the strategy increases, the technological aspects become much more relevant. Thus being familiar with C/C+ will be of paramount importance.A quantitative trading system consists of four major components: Strategy Identification - Finding a strategy,

29、 exploiting an edge and deciding on trading frequency Strategy Backtesting - Obtaining data, analysing strategy performance and removing biases Execution System - Linking to a brokerage, automating the trading and minimising transaction costs Risk Management - Optimal capital allocation, bet size/Ke

30、lly criterion and trading psychologyWell begin by taking a look at how to identify a trading strategy.Strategy IdentificationAll quantitative trading processes begin with an initial period of research. This research process encompasses finding a strategy, seeing whether the strategy fits into a port

31、folio of other strategies you may be running, obtaining any data necessary to test the strategy and trying to optimise the strategy for higher returns and/or lower risk. You will need to factor in your own capital requirements if running the strategy as a retail trader and how any transaction costs

32、will affect the strategy.Contrary to popular belief it is actually quite straightforward to find profitable strategies through various public sources. Academics regularly publish theoretical trading results (albeit mostly gross of transaction costs). Quantitative finance blogs will discuss strategie

33、s in detail. Trade journals will outline some of the strategies employed by funds.You might question why individuals and firms are keen to discuss their profitable strategies, especially when they know that others crowding the trade may stop the strategy from working in the long term. The reason lie

34、s in the fact that they will not often discuss the exact parameters and tuning methods that they have carried out. These optimisations are the key to turning a relatively mediocre strategy into a highly profitable one. In fact, one of the best ways to create your own unique strategies is to find sim

35、ilar methods and then carry out your own optimisation procedure.Here is a small list of places to begin looking for strategy ideas: Social Science Research Network - arXiv Quantitative Finance - arxiv.org/archive/q-fin Seeking Alpha - Elite Trader - Nuclear Phynance - Quantivity - Many of the strate

36、gies you will look at will fall into the categories of mean-reversion and trend-following/momentum. A mean-reverting strategy is one that attempts to exploit the fact that a long-term mean on a price series (such as the spread between two correlated assets) exists and that short term deviations from

37、 this mean will eventually revert. A momentum strategy attempts to exploit both investor psychology and big fund structure by hitching a ride on a market trend, which can gather momentum in one direction, and follow the trend until it reverses.Another hugely important aspect of quantitative trading

38、is the frequency of the trading strategy. Low frequency trading (LFT) generally refers to any strategy which holds assets longer than a trading day. Correspondingly, high frequency trading (HFT) generally refers to a strategy which holds assets intraday. Ultra-high frequency trading (UHFT) refers to

39、 strategies that hold assets on the order of seconds and milliseconds. As a retail practitioner HFT and UHFT are certainly possible, but only with detailed knowledge of the trading technology stack and order book dynamics. We wont discuss these aspects to any great extent in this introductory articl

40、e.Once a strategy, or set of strategies, has been identified it now needs to be tested for profitability on historical data. That is the domain of backtesting.Strategy BacktestingThe goal of backtesting is to provide evidence that the strategy identified via the above process is profitable when appl

41、ied to both historical and out-of-sample data. This sets the expectation of how the strategy will perform in the real world. However, backtesting is NOT a guarantee of success, for various reasons. It is perhaps the most subtle area of quantitative trading since it entails numerous biases, which mus

42、t be carefully considered and eliminated as much as possible. We will discuss the common types of bias including look-ahead bias , survivorship bias and optimisation bias (also known as data-snooping bias). Other areas of importance within backtesting include availability and cleanliness of historic

43、al data, factoring in realistic transaction costs and deciding upon a robust backtesting platform. Well discuss transaction costs further in the Execution Systems section below.Once a strategy has been identified, it is necessary to obtain the historical data through which to carry out testing and,

44、perhaps, refinement. There are a significant number of data vendors across all asset classes. Their costs generally scale with the quality, depth and timeliness of the data. The traditional starting point for beginning quant traders (at least at the retail level) is to use the free data set from Yah

45、oo Finance. I wont dwell on providers too much here, rather I would like to concentrate on the general issues when dealing with historical data sets.The main concerns with historical data include accuracy/cleanliness, survivorship bias and adjustment for corporate actions such as dividends and stock

46、 splits:Accuracy pertains to the overall quality of the data - whether it contains any errors.Errors can sometimes be easy to identify, such as with a spike filter, which will pick out incorrect spikes in time series data and correct for them. At other times they can be very difficult to spot. It is

47、 often necessary to have two or more providers and then check all of their data against each other. Survivorship bias is often a feature of free or cheap datasets. A dataset with survivorship bias means that it does not contain assets which are no longer trading. In the case of equities this means d

48、elisted/bankrupt stocks. This bias means that any stock trading strategy tested on such a dataset will likely perform better than in the real world as the historical winners have already been preselected. Corporate actions include logistical activities carried out by the company that usually cause a

49、 step-function change in the raw price, that should not be included in the calculation of returns of the price. Adjustments for dividends and stock splits are the common culprits. A process known as back adjustment is necessary to be carried out at each one of these actions. One must be very careful

50、 not to confuse a stock split with a true returns adjustment. Many a trader has been caught out by a corporate action!In order to carry out a backtest procedure it is necessary to use a software platform. You have the choice between dedicated backtest software, such as Tradestation, a numerical plat

51、form such as Excel or MATLAB or a full custom implementation in a programming language such as Python or C+. I wont dwell too much on Tradestation (or similar), Excel or MATLAB, as I believe in creating a full in-house technology stack (for reasons outlined below). One of the benefits of doing so is

52、 that the backtest software and execution system can be tightly integrated, even with extremely advanced statistical strategies. For HFT strategies in particular it is essential to use a custom implementation.When backtesting a system one must be able to quantify how well it is performing. The indus

53、try standard metrics for quantitative strategies are the maximum drawdown and the Sharpe Ratio. The maximum drawdown characterises the largest peak-to-trough drop in the account equity curve over a particular time period (usually annual). This is most often quoted as a percentage. LFT strategies wil

54、l tend to have larger drawdowns than HFT strategies, due to a number of statistical factors. A historical backtest will show the past maximum drawdown, which is a good guide for the future drawdown performance of the strategy. The second measurement is the Sharpe Ratio, which is heuristically define

55、d as the average of the excess returns divided by the standard deviation of those excess returns. Here, excess returns refers to the return of the strategy above a pre-determined benchmark, such as the S&P500 or a 3-month Treasury Bill. Note that annualised return is not a measure usually utilised,

56、as it does not take into account the volatility of the strategy (unlike the Sharpe Ratio).Once a strategy has been backtested and is deemed to be free of biases (in as much as that is possible!), with a good Sharpe and minimised drawdowns, it is time to build an execution system.Execution SystemsAn

57、execution system is the means by which the list of trades generated by the strategy are sent and executed by the broker. Despite the fact that the trade generation can be semi- or even fully-automated, the execution mechanism can be manual, semi-manual (i.e. one click) or fully automated. For LFT st

58、rategies, manual and semi-manual techniques are common. For HFT strategies it is necessary to create a fully automated execution mechanism, which will often be tightly coupled with the trade generator (due to the interdependence of strategy and technology).The key considerations when creating an exe

59、cution system are the interface to the brokerage, minimisation of transaction costs (including commission, slippage and the spread) and divergence of performance of the live system from backtested performance.There are many ways to interface to a brokerage. They range from calling up your broker on

60、the telephone right through to a fully-automated high-performance Application Programming Interface (API). Ideally you want to automate the execution of your trades as much as possible. This frees you up to concentrate on further research, as well as allow you to run multiple strategies or even stra

61、tegies of higher frequency (in fact, HFT is essentially impossible without automated execution). The common backtesting software outlined above, such as MATLAB, Excel and Tradestation are good for lower frequency, simpler strategies. However it will be necessary to construct an in-house execution sy

62、stem written in a high performance language such as C+ in order to do any real HFT. As an anecdote, in the fund I used to be employed at, we had a 10 minute trading loop where we would download new market data every 10 minutes and then execute trades based on that information in the same time frame.

63、 This was using an optimised Python script. For anything approaching minute- or second-frequency data, I believe C/C+ would be more ideal.In a larger fund it is often not the domain of the quant trader to optimise execution. However in smaller shops or HFT firms, the traders ARE the executors and so

64、 a much wider skillset is often desirable. Bear that in mind if you wish to be employed by a fund. Your programming skills will be as important, if not more so, than your statistics and econometrics talents!Another major issue which falls under the banner of execution is that of transaction cost minimisation. There are generally three components to transaction costs: Commissions (or tax), which are the fees charged by the brokerage, the exchange and the SEC (or similar governmental regulatory body); slippage, which is the difference between what you intended your order to be filled at ver

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!