Loading ...

自己写的RSI指标公式,有个错误的地方,请大家指导

Author: pu330619672, Created: 2020-04-13 23:35:26, Updated:

function RSI(records,N) { //LC:=REF(CLOSE,1) //RSI1:SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100 var v1 = [] var v2 = [] var MAX = [] var ABS = [] for (var i = N; i < records.length; i++) { //LC = records[i - 1].Close var ba = records.slice(i - N,i + 1) v1[i] = ba for (var k = N + 1; k < v1.length; k++) { for (var j = N; j > 0; j–) { var c = v1[k][j].Close - v1[k][j -1].Close v2[j] = c for (var b = 1; b < v2.length; b++) { var c = MAX(v2[b]) var c1 = ABS(v2[b]) //var b = SMA(MAX,N,1) //var b1 = SMA(ABS,N,1) } } } } return [c,c1] } 代码没写完,但差的不多,显示的是17行v2的值取不到,但是我测试工具弄有取到了的,所以也不知道哪里有问题,发出来请大家指导一下


More

小草 RSI可以看到看应的代码,FMZ也有公开

小草 https://www.fmz.com/bbs-topic/409

pu330619672 那有公开啊,我都找了,能给个链接不