SetBarMode(1);
// RSI function (for RSI指標)
//
input: price(numericseries), length(numericsimple);
variable: sumUp(0), sumDown(0), up(0), down(0);
if CurrentBar = 1 then
begin
sumUp = Average(maxlist(price - price[1], 0), length);
sumDown = Average(maxlist(price[1] - price, 0), length);
end
else
begin
up = maxlist(price - price[1], 0);
down = maxlist(price[1] - price, 0);
sumUp = sumUp[1] + (up - sumUp[1]) / length;
sumDown = sumDown[1] + (down - sumDown[1]) / length;
end;
if sumUp + sumDown = 0 then
RSI = 0
else
RSI = 100 * sumUp / (sumUp + sumDown);
想要修改RSI函數,COPY了 RSI函數要做修改
結果 0226-RSI242變數 "RSI" 沒有宣告,請用 Vars: 的方式宣告,冒號後面是變數名稱再用括號填入預設值。例如: Vars:varA(100); 如果要宣告陣列請用 Arrays: 冒號後面是名稱再用 [] 設定維度與大小,括號填入預設值。例如 Arrays:arr1[10](0);。
請問要如何修改 置換 函數 請示範 謝謝
1 評論