*後記:
Ergodic 這個字我曾經在美國唸統計機率模型的時候有看到過,當時教授用Ergodic Random Walk在解釋股市行情,後悔當時沒有認真聽課。
Inputs:
Price(close),
AvgLen(9),
r(7),
s(27),
u(1),
Zeroline(0),
SmthLen(7),
upcolor_1(green),
downcolor_1(red);
Variable:
_TSI (0),color(0),Numerator(0),
Denominator(0),AvgTSI(0),Avg2(0);
{ Numerator }
Numerator = 100*XAverage(XAverage(XAverage(Price-Price[1],r),s),u) ;
{ Denominator }
Denominator = XAverage(XAverage(XAverage(AbsValue(Price-Price[1]),r),s),u) ;
If Denominator <> 0 then
_TSI = Numerator / Denominator
else
_TSI = 0;
AvgTSI= XAverage(_TSI, SmthLen);
plot1(AvgTSI,"SigLin");
color = IFF(AvgTSI > AvgTSI[1],UpColor_1,cyan);
color = IFF(AvgTSI < AvgTSI[1],downColor_1,color);
SetPlotColor(1,color);
//calc xAvg
avg2 = xAverage(AvgTSI,AvgLen);
plot2(avg2,"avg");
Plot4(Plot1 - Plot2, "ErgDiff");
1 留言:
名類型的MACD改良版大多改善信號,但卻很難於少波幅的橫行市應用。
張貼留言
如果有私人問題想請教,請透過網站右方『與站長聯絡』之表單,謝謝!