我想請問一下 我想要修改 EMA的計算方式,是直接從函數內的EMA修改嗎?
SetBarMode(2);
input:thePrice(numericseries); //"價格序列"
input:Length(Numeric); //"計算期間"
variable: Factor(0);
if length + 1 = 0 then Factor = 1 else Factor = 2 / (Length + 1);
if CurrentBar = 1 then
EMA = thePrice
else if CurrentBar <= Length then
EMA = (thePrice + (EMA[1]*(CurrentBar-1)))/CurrentBar
else
EMA = EMA[1] + Factor * (thePrice - EMA[1]);
但我新建一個函數,複製原本內建的EMA,卻顯示EMA要宣告?? 請問是該從哪邊修改呢?
5 評論