一個開拓者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請大蝦幫忙改下。。。。
[此貼子已經被作者于2013-2-27 13:37:15編輯過] - 金字塔客服:
直接貼這樣的代碼,要有人同時精通TB和金字塔,才能幫你改
你還是把每句話都給注釋一下
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 262069696 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容