0
Follow
0
Followers
Há um erro na fórmula do indicador RSI que escrevi. Por favor, me oriente.
Created 2020-04-13 23:35:26
3
1648
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]
}
O código não está completo, mas não é muito ruim, e mostra que a linha 17 do v2 não foi obtida, mas o meu teste conseguiu, então não sei onde é o problema.
Related Recommendations
Advanced Tutorial for FMZ Quant platform Strategy WritingElementary Tutorial for FMZ Quant platform Strategy WritingGet Started with FMZ Quant PlatformSECURITY BUGI keep getting error: Exchange_GetAccount: Invalid ContractTypeWe have an incredibly profitable market making algorithm for sideways markets on Bitmex - but need expert to help eliminate wait times during downward volatility in the marketError with deribitLimitations of the backtesting engineHow to install ta-lib on linux docker?5.5 Trading strategy optimization
Comment
All comments (3)
- 1
