以上是TB版的卡夫曼自適應(yīng)均線求翻譯成金字塔版本 [金字塔]
- 咨詢內(nèi)容: Params
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)//當(dāng)前第一根K線金子塔barpos { AMAValue = close; }Else//從第二根K線開(kāi)始計(jì)算 { NetChg = Abs( close - close[EffRatioLength] );當(dāng)前收盤價(jià)與前十根K線的收盤價(jià)之差的絕對(duì)值 TotChg = Summation( Abs( Price - Price[1] ), EffRatioLength ); 前十個(gè)周期的前后收盤價(jià)之差的絕對(duì)值之和 EffRatio = IIF(TotChg > 0, NetChg / TotChg, 0); SFDiff = 2 / ( FastAvgLength + 1 ) - 2 / ( SlowAvgLength + 1 ); ScaledSFSqr = Sqr( 2 / ( SlowAvgLength + 1 ) + EffRatio * SFDiff );sqr是求平方 AMAValue = AMAValue[1] + ScaledSFSqr * ( Price - AMAValue[1] ); } End//[]指的是回溯周期數(shù)以上是TB版的卡夫曼自適應(yīng)均線求翻譯成金字塔版本謝謝! - 金字塔客服: 上面那一串是用來(lái)干什么的?
- 用戶回復(fù): 定義參數(shù)變量
- 網(wǎng)友回復(fù): Params下的是常量var 是變量Numeric是簡(jiǎn)單的數(shù)值變量NumericSeries序列變量類似全局變量
- 網(wǎng)友回復(fù): 比較急,求大俠幫助啊!!!!
有思路,想編寫(xiě)各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 262069696 進(jìn)行 有償 編寫(xiě)!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容