公式网-网站导航


网站搜索:  

公式指标网 发表于2015/10/23 6:14:12

超级日内组合 及 【日内策略】Dual Thrust范例策略发现了相同的错误[金字塔模型]

相关标签:


好几个范例都可能有类似的错误,这里举两个例子:

1、《超级日内组合》

代码中的:

10日平均波幅:=ref(MA(CALLSTOCK(STKLABEL,VTHIGH,6,0)-CALLSTOCK(STKLABEL,VTLOW,6,0),10),1);//AVERAGERANGE
 10日平均开收盘区间:=ref(MA(ABS(CALLSTOCK(STKLABEL,VTopen,6,0)-CALLSTOCK(STKLABEL,VTclose,6,0)),10),1);//AVERAGEOCRANGE

是错误的,在日内用ref(X,1)获得的是上一根K线的均值,而不是昨日的均值,在日内调用日线均值,或许得单独写一个指标,然后用stkindi来跨周期调用日线,求得指标值才行。当然也可以用笨办法(我经常用),

 例如:

10日平均开收盘区间:=(ABS(CALLSTOCK(STKLABEL,VTopen,6,-1)-CALLSTOCK(STKLABEL,VTclose,6,-1))+ABS(CALLSTOCK(STKLABEL,VTopen,6,-2)-CALLSTOCK(STKLABEL,VTclose,6,-2))
   +ABS(CALLSTOCK(STKLABEL,VTopen,6,-3)-CALLSTOCK(STKLABEL,VTclose,6,-3))+ABS(CALLSTOCK(STKLABEL,VTopen,6,-4)-CALLSTOCK(STKLABEL,VTclose,6,-4))+ABS(CALLSTOCK(STKLABEL,VTopen,6,-5)-CALLSTOCK(STKLABEL,VTclose,6,-5))
   +ABS(CALLSTOCK(STKLABEL,VTopen,6,-6)-CALLSTOCK(STKLABEL,VTclose,6,-6))+ABS(CALLSTOCK(STKLABEL,VTopen,6,-7)-CALLSTOCK(STKLABEL,VTclose,6,-7))+ABS(CALLSTOCK(STKLABEL,VTopen,6,-8)-CALLSTOCK(STKLABEL,VTclose,6,-8))
   +ABS(CALLSTOCK(STKLABEL,VTopen,6,-9)-CALLSTOCK(STKLABEL,VTclose,6,-9))+ABS(CALLSTOCK(STKLABEL,VTopen,6,-10)-CALLSTOCK(STKLABEL,VTclose,6,-10)))/10.0;

2、著名的公开策略:【日内策略】Dual Thrust 

几乎是相同的问题,其中的:

HH:=hhv(昨高,n);//N日high的最高价

HC:=hhv(昨收,n);//N日close的最高价

LC:=LLV(昨收,n);//N日close的最低价

LL:=LLV(昨低,n);//N日low的最低价

求出的也不是N日的最X价,而是N周期内的最X价,事实上这里的周期并不是日线,所以N周期也就不等于N日了,和第一个问题一样,作者似乎写着写着就忘记了公式是运行在日内周期的了

 



网站搜索:  



Copyright © 2009-2010 gszb.com ™,All Rights Reserved. 
公式网-www.gszx.com.cn-股票指标公式网