公式編譯一直提示錯誤是怎么回事? [開拓者 TB]
- 咨詢內容:
為什么我新建一個公示應用,直接復制了“求卡夫曼自適應移動平均”的公式,編譯就是通不過呢?一直提示參數聲明的數據類型錯誤,一個東西都沒有改動呀。
Params
NumericSeries Price(1);
Numeric EffRatioLength(10);
Numeric FastAvgLength(2);
Numeric SlowAvgLength(30);
Vars
Numeric NetChg(0);
Numeric TotChg(0);
Numeric EffRatio(0);
Numeric ScaledSFSqr(0);
NumericSeries AMAValue;
Numeric SFDiff;
Begin
if(CurrentBar == 0)
{
AMAValue = Price;
}Else
{
NetChg = Abs( Price - Price[EffRatioLength] );
TotChg = Summation( Abs( Price - Price[1] ), EffRatioLength );
EffRatio = IIF(TotChg > 0, NetChg / TotChg, 0);
SFDiff = 2 / ( FastAvgLength + 1 ) - 2 / ( SlowAvgLength + 1 );
ScaledSFSqr = Sqr( 2 / ( SlowAvgLength + 1 ) + EffRatio * SFDiff );
AMAValue = AMAValue[1] + ScaledSFSqr * ( Price - AMAValue[1] );
}
Return AMAValue;
End
- TB技術人員: 我知道原因了,原來是函數只能用函數,不能在公式應用中調用
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 511411198 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容