您好:
我使用K棒200根,但計算出來的EMA數值跟主圖疊加指標有落差
請問是哪邊有寫錯嗎?
以合一2月份目前的還原月線來說,我的EMA是171.512234,但主圖顯示為178.15
setbarfreq("AM");
// 週線均線組合
variable:ma5(0),ma8(0),ma13(0),ma21(0),ma34(0),ma55(0);
ma5 = EMA(Close, 5);
ma8 = EMA(Close, 8);
ma13 = EMA(Close, 13);
ma21 = EMA(Close, 21);
ma34 = EMA(Close, 34);
ma55 = EMA(Close, 55);
variable: bias5(0), bias8(0), bias13(0), bias21(0), bias34(0), bias55(0);
bias5 = absValue(low-ma5) / ma5 * 100;
bias8 = absValue(low-ma8) / ma8 * 100;
bias13 = absValue(low-ma13) / ma13 * 100;
bias21 = absValue(low-ma21) / ma21 * 100;
bias34 = absValue(low-ma34) / ma34 * 100;
bias55 = absValue(low-ma55) / ma55 * 100;
print(file("C:\Users\upen2\OneDrive\Documents\xq_debug\print.log"),date,symbol, close, ma55, bias55);
if bias55 < 1
and close > ma55 then ret = 1;
1 評論