無無明 發表於 12-3-22 10:28
先生:
去檢查一下 KDJ 的 原始程式碼
我已經全部用我自己寫的....
已經變一樣啦....
我在HTS的KD程式碼:(連J值都有)
==========================================
Parameters : HighLowTerm(9), OverSold(20), OverBought(80),OverSold2(0), OverBought2(100),AA(3),BB(2)
Variable : Factor(1/3)
Value1 = VALUE1[1] + (Factor * (FastK(High, Low, Close, HighLowTerm) - VALUE1[1]))
Value2 = 2/3*Value2[1]+Value1*1/3
value3=AA*value1-BB*value2
DrawBase1( OverBought, "Over Bought", DarkGray )
DrawBase2( OverSold, "Over Sold", DarkGray )
//DrawBase3( OverBought2, "Over Bought2", red )
//DrawBase4( OverSold2, "Over Sold2", red )
Draw2( Round( Value2,2), "Slow %D", Blue)
Draw1( Round( Value1,2), "Slow %K", Red)
Draw3( Round( Value3,2), "Slow 3K-2D", black)
============================================
在MC的寫法如下....邏輯一樣...........(FastK的參數寫法跟HTS有點差異....但結果一樣)
============================================
inputs : HighLowTerm(9), OverSold(20), OverBought(80),OverSold2(0), OverBought2(100),AA(3),BB(2);
Variable : Factor(1/3);
Value1 = VALUE1[1] + (Factor * (FastK( HighLowTerm) - VALUE1[1]));
Value2 = 2/3*Value2[1]+Value1*1/3;
value3=AA*value1-BB*value2;
plot1( OverBought, "Over Bought", DarkGray );
plot2( OverSold, "Over Sold", DarkGray );
plot3( Round( Value2,2), "Slow %D", Blue);
plot4( Round( Value1,2), "Slow %K", Red);
Plot5( Round( Value3,2), "Slow 3K-2D", white);
==================================================
|