请教各位老师一个问题,如何将交易开拓者里面的佳庆摆动指标转为金字塔公式,代码如下:
If(High > Low)
TmpValue = ((Close - Low) - ( High - Close))/(High - Low)*Vol;
If(CurrentBar==0)
{
ADValue = TmpValue;
}Else
{
ADValue = ADValue[1] + TmpValue;
}
COValue = XAverage(ADValue, FastCo ) - XAverage(ADValue, SlowCo);
if HIGH> LOW then TmpValue := ((Close - Low) - ( High - Close))/(High - Low)*Vol;
if CurrentBar=0 then ADValue := TmpValue;
else ADValue := ADValue[1] + TmpValue;
COValue := XAverage(ADValue, FastCo ) - XAverage(ADValue, SlowCo);
主要是修改if语句。
XAverage 这个函数pel中没有,如果是要去平均值的话可以使用——AVEDEV(X,N)
你的程序中还有些不符合的地方,程序不能拷过去直接用,如果需要可以直接写出意图,让热心人士直接完成您的程序功能。
主要意图就是求佳庆值COVALUE,
ADValue = ADValue[1] + TmpValue;这句代码不知道怎么转到金字塔上来