binance-futures-connector
Advanced tools
Comparing version 1.3.1 to 1.3.2
{ | ||
"name": "binance-futures-connector", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "binance-futures-spot 币安-合约+现货-sdk,持续更新,欢迎PR一起完善。微信:wkc19891", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -635,11 +635,13 @@ const Std = { | ||
/** | ||
* SAR 抛物线指标 标识趋势 以及 趋势反转 TA.SAR(数据,加速步长,最大加速因子) 默认为(0.02,0.2)。 | ||
* SAR 抛物线指标 标识趋势 以及 趋势反转 TA.SAR(数据,加速步长,最大加速因子,初始因子) 默认为(0.02,0.2,0.02)。 | ||
* @param {*} records | ||
* @param {*} accelerationStep | ||
* @param {*} maxAccelerationFactor | ||
* @param {*} initialFactor | ||
* @returns | ||
*/ | ||
const SAR = (records, accelerationStep, maxAccelerationFactor) => { | ||
const SAR = (records, accelerationStep, maxAccelerationFactor,initialFactor) => { | ||
accelerationStep = typeof (accelerationStep) === 'undefined' ? 0.02 : accelerationStep; | ||
maxAccelerationFactor = typeof (maxAccelerationFactor) === 'undefined' ? 0.2 : maxAccelerationFactor; | ||
initialFactor = typeof (initialFactor) === 'undefined' ? 0.02 : initialFactor; | ||
let length = records.length; | ||
@@ -653,3 +655,3 @@ let results = Std._zeros(length); | ||
} | ||
let accelerationFactor = accelerationStep; | ||
let accelerationFactor = initialFactor; | ||
let extremePoint = q0.High; | ||
@@ -675,3 +677,3 @@ let priorSar = q0.Low; | ||
isRising = false; | ||
accelerationFactor = accelerationStep; | ||
accelerationFactor = initialFactor; | ||
extremePoint = q.Low; | ||
@@ -698,3 +700,3 @@ } else { | ||
isRising = true; | ||
accelerationFactor = accelerationStep; | ||
accelerationFactor = initialFactor; | ||
extremePoint = q.High; | ||
@@ -701,0 +703,0 @@ } |
256609
7357