版主看看sma函數(shù)哪里出錯(cuò)了 [開(kāi)拓者 TB]
-
咨詢內(nèi)容:
Params
? ?? ???Numeric Length(14);? ?? ?? ?? ?? ?? ?? ???
? ?? ???Numeric SlowLength(3);? ?? ?
? ?? ???Numeric SmoothLength(3);
Vars
? ?? ???NumericSeries HighestValue;? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?
? ?? ???NumericSeries LowestValue;? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?
? ?? ???NumericSeries K1;
? ?? ???NumericSeries D1;
? ?? ???NumericSeries RSV1;
Begin
? ?? ???HighestValue = HighestFC(High, Length);? ?
? ?? ???LowestValue = LowestFC(Low, Length);? ?
? ?? ???RSV1 = (Close-LowestValue)/(HighestValue-LowestValue)*100;
? ?? ???K1 =??SMA(RSV1,SlowLength,1);
? ?? ???D1 =??SMA(K1,SmoothLength,1);? ?
? ?? ???PlotNumeric("K",K1);
? ?? ???PlotNumeric("D",D1);
? ?? ???PlotNumeric("RSV",RSV1);
? ?? ???Commentary("K1"+text(k1));? ?
End
很簡(jiǎn)單的kd指標(biāo)公式,rsv1值正常顯示,但是k1,d1不顯示,用??Commentary("K1"+text(k1));??查看k1值,發(fā)現(xiàn)k1值是n/a,到底哪里出問(wèn)題了啊??
?來(lái)源:CXH99.COM
-
TB技術(shù)人員:
換成日線圖上看看是什么效果,還會(huì)有無(wú)效值嗎?
?
-
TB客服:
如下改動(dòng):
? ?? ???K1 =??SMA(IntPart(RSV1),SlowLength,1);?
-
網(wǎng)友回復(fù):
謝謝小米和Yuen_Lee,我找到原因了,如果出現(xiàn)了漲停和跌停,在日線之下的周期就會(huì)出現(xiàn)那個(gè)問(wèn)題。
?
- 網(wǎng)友回復(fù):
有思路,想編寫(xiě)各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫(xiě)!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容