CCI 跨周期函数 [开拓者 TB]
- 咨询内容:
Params
Numeric TimeFrame(1440);
Numeric BarsBack(1);
Numeric Length(84);
Numeric AvgLength(9);
NumericRef oCCIValue;
NumericRef oCCIAvg;
Vars
NumericSeries mtBarCnt;
Numeric refCurBar;
Numeric refOpen;
Numeric refHigh;
Numeric refLow;
Numeric refClose;
Numeric refVol;
Numeric refOpenInt;
Numeric mtHigh;
Numeric mtOpen;
Numeric mtLow;
Numeric mtClose;
Numeric SumValue(0);
Numeric i;
Numeric j(0);
NumericSeries TmpValue;
Numeric Mean;
Numeric AvgDev( 0 );
Numeric Counter( 0 ) ;
Numeric CCIValue;
Numeric CCIAvg;
Begin
mtBarCnt = MtBar(TimeFrame,BarsBack,refCurBar,refOpen,refHigh,refLow,refClose,refVol,refOpenInt);
mtHigh = refHigh;
mtOpen = refOpen;
mtLow = refLow;
mtClose = refClose;
TmpValue = mtHigh + mtLow + mtClose;
SumValue = MtSummation(TmpValue,mtBarCnt,Length);
Mean = SumValue/Length;
AvgDev =0;
for Counter = 0 to Length - 1
{
AvgDev = AvgDev + Abs( TmpValue[Counter] - Mean ) ;
}
AvgDev = AvgDev / Length ;
if( AvgDev == 0)
CCIValue = 0;
Else
CCIValue = ( TmpValue - Mean ) / ( 0.015 * AvgDev ) ;
SumValue = MtSummation(CCIValue,mtBarCnt,Length);
CCIAvg = SumValue/Length;
oCCIValue = CCIValue;
oCCIAvg = CCIAvg;
Return mtBarCnt;
End
我写的这个函数是有问题的,请大神帮忙,已有这个跨周期指标的大神可以共享给我一份吗?谢谢
MtBar,MtSummation 也是函数,在【跨周期内容集中贴】里面有
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容