|
inputs:
Len(NumericSimple);
variable: x(0), positivers(0), negativers(0), RS(0), NRSI(0);
rs = 0;
positivers = 0;
negativers = 0;
For x = 0 to Len - 1 begin
if close[x] > close[x+1] then begin
positivers = close[x] - close[x+1] + close[x] - low[x] ; {and}
negativers = high[x] - close[x];
end ;
if close[x] < close[x+1] then {begin}
positivers = close[x] - low[x] ; {and}
negativers = close[x+1] - close[x] + high[x] - close[x];
end ;
RS = average(+rs,14)/average(-rs,14);
NRSI = 100-(100/(1+RS));
end;
// if 判斷式加上 Begin .... end , 拿掉 and
// 或是把 and 換成 ; 也可以編譯
因為 positivers & negativers 宣告為數值變數 , 句子內使用了 and 為邏輯變數, 所以型態不符 |
|