一、交易量比重均值介绍1、原始策略概述 交易量比重均值(Volume-weighted Moving Average, VMA)策略于2001.7发布,是一个综合了价格预测、均值回归。趋势跟踪三种思路的系统。该系统利用成交量的信息对标的的短期走势进行预测,适用于交易量文档的品种,如股票、股指等。
其中最核心的部分是基于成交量的价格预测:
VMAt=RVt−1∗Closet−1+(1−RVt−1)∗VMAt−1(1)VMAt=RVt−1∗Closet−1+(1−RVt−1)∗VMAt−1(1)
VMAtVMAt实际上是基于过去的信息预测价格。VMAtVMAt的预测基于两个值:上一期的收盘价格Closet−1Closet−1和上一期预测的VMAt−1VMAt−1。上一期的收盘价是上一期真是发生的成交价,当上一期的相对成交量RVt−1RVt−1越大,我们相信这个成交价越具有参考价值,因为它是由市场上大量的买方、买方撮合而成的价格,这个价格收到了大量投资者的认可;相反则认为这个成交价不具代表性。因此,当上一期的相对成交量RVt−1RVt−1越大时,我们把越大的比重放在上一期真实发生的收盘价Closet−1Closet−1上,把较少的比重放在我们上一期的预测值VMAt−1VMAt−1上;反之亦然。在对短期的价格走势做出预测之后,当价格Closet−1Closet−1低于预测值VMAtVMAt时,我们认为价格短期有较大的概率会上涨,准备开多;反之则准备开空。
另外,交易量比重均值策略还综合了均值回归的思想。用来预测VMAtVMAt的公式(1)具有均值回归的特性,即当VMA较大时,他会有下跌的趋势;当VMA较小时,他会有上升的趋势。因此另一个开仓的比内条件是:只有当VMAtVMAt比上一期的VMAt−1VMAt−1小时,才准备开多,反之开空。
2、策略构造与交易规则变量定义:
(1)平均成交量<span class="MathJax" id="MathJax-Element-15-Frame" tabindex="0" data-mathml="AVt=Average(Volume,N)" role="presentation" style="box-sizing: border-box; display: inline-table; line-height: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">AVt=Average(Volume,N)AVt=Average(Volume,N),是过去N天的平均成交量。
(2)最高平均成交量<span class="MathJax" id="MathJax-Element-16-Frame" tabindex="0" data-mathml="HAVt=Max(AV,N)" role="presentation" style="box-sizing: border-box; display: inline-table; line-height: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">HAVt=Max(AV,N)HAVt=Max(AV,N),是过去N天平均成交量的最大值。
(3)最低平均成交量<span class="MathJax" id="MathJax-Element-17-Frame" tabindex="0" data-mathml="LAVt=Max(AV,N)" role="presentation" style="box-sizing: border-box; display: inline-table; line-height: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">LAVt=Max(AV,N)LAVt=Max(AV,N),是过去N天平均成交量的最小值。
(4)相对成交量<span class="MathJax" id="MathJax-Element-18-Frame" tabindex="0" data-mathml="RVt=AVt−LAVtHAVt−LAVt" role="presentation" style="box-sizing: border-box; display: inline-table; line-height: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">RVt=AVt−LAVtHAVt−LAVtRVt=AVt−LAVtHAVt−LAVt,该值越大,表示成交量相对过去一段时间越大。
计算交易量比重均值: VMAt=RVt−1∗Closet−1+(1−RVt−1)∗VMAt−1VMAt=RVt−1∗Closet−1+(1−RVt−1)∗VMAt−1
基于VMA的交易规则:
(1)无头寸时:如果Closet−1<VMAtCloset−1<VMAt和VMAt<VMAt−1VMAt<VMAt−1开多仓;如果Closet−1>VMAtCloset−1>VMAt和VMAt>VMAt−1VMAt>VMAt−1开空仓;
(2)持有多头时:如果Closet−1>=VMAtCloset−1>=VMAt平多仓; (3)持有空头时:如果Closet−1<=VMAtCloset−1<=VMAt平空仓;
二、修改后的策略因为平台是开盘交易,为适应平台运行,对原策略做了些更改,并改为单边交易,且增加买入判定条件:当前最高价突破前两天的最高价是买入。
具体策略如下:
(1)如果<span class="MathJax" id="MathJax-Element-26-Frame" tabindex="0" data-mathml="Closet−2<VMAt−1" role="presentation" style="box-sizing: border-box; display: inline-table; line-height: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">Closet−2<VMAt−1Closet−2<VMAt−1、<span class="MathJax" id="MathJax-Element-27-Frame" tabindex="0" data-mathml="VMAt−1<VMAt−2" role="presentation" style="box-sizing: border-box; display: inline-table; line-height: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">VMAt−1<VMAt−2VMAt−1<VMAt−2且<span class="MathJax" id="MathJax-Element-28-Frame" tabindex="0" data-mathml="Hight−1>=Max(Hight−2,Hight−3)" role="presentation" style="box-sizing: border-box; display: inline-table; line-height: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">Hight−1>=Max(Hight−2,Hight−3)Hight−1>=Max(Hight−2,Hight−3)开多仓;
(2)持多头时:如果<span class="MathJax" id="MathJax-Element-29-Frame" tabindex="0" data-mathml="Closet−2>=VMAt−1" role="presentation" style="box-sizing: border-box; display: inline-table; line-height: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">Closet−2>=VMAt−1Closet−2>=VMAt−1平多仓;
(3)根据大盘止损;
注:代码证PVMA是<span class="MathJax" id="MathJax-Element-30-Frame" tabindex="0" data-mathml="VMAt−2" role="presentation" style="box-sizing: border-box; display: inline-table; line-height: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">VMAt−2VMAt−2
|