修改bb取值
This commit is contained in:
@@ -3740,7 +3740,7 @@
|
||||
if (fx.fx_strength < 1.0){ // 调整小周期阈值
|
||||
displayText = fx.fx_strength >= 0.6 ? '' : '' // 0.6以上显示点
|
||||
}
|
||||
displayText = fx.fx_type.replace("TOP", "").replace("BOTTOM", "").replace("1", "").replace("2", "").replace("30", "");
|
||||
displayText = fx.fx_type.replace("TOP", "").replace("BOTTOM", "").replace("11", "").replace("21", "").replace("3", "");
|
||||
// 小周期分型标记配置
|
||||
const markerConfig = {
|
||||
time: timestamp,
|
||||
@@ -7003,12 +7003,13 @@
|
||||
.reduce((sum, val) => sum + val, 0) / length;
|
||||
break;
|
||||
case 'EMA':
|
||||
if (i === length - 1) {
|
||||
// 第一个EMA值使用SMA
|
||||
value = sourceData.slice(0, length)
|
||||
const multiplier = 2 / (length + 1);
|
||||
if (result.length === 0) {
|
||||
// 第一个EMA值使用SMA作为种子值
|
||||
value = sourceData.slice(i - length + 1, i + 1)
|
||||
.reduce((sum, val) => sum + val, 0) / length;
|
||||
} else {
|
||||
const multiplier = 2 / (length + 1);
|
||||
// 后续EMA值使用标准公式
|
||||
value = sourceData[i] * multiplier + result[result.length - 1].value * (1 - multiplier);
|
||||
}
|
||||
break;
|
||||
@@ -7052,11 +7053,13 @@
|
||||
.reduce((sum, item) => sum + item.value, 0) / smoothLength;
|
||||
break;
|
||||
case 'EMA':
|
||||
if (i === smoothLength - 1) {
|
||||
value = maData.slice(0, smoothLength)
|
||||
const multiplier = 2 / (smoothLength + 1);
|
||||
if (result.length === 0) {
|
||||
// 第一个EMA值使用SMA作为种子值
|
||||
value = maData.slice(i - smoothLength + 1, i + 1)
|
||||
.reduce((sum, item) => sum + item.value, 0) / smoothLength;
|
||||
} else {
|
||||
const multiplier = 2 / (smoothLength + 1);
|
||||
// 后续EMA值使用标准公式
|
||||
value = maData[i].value * multiplier + result[result.length - 1].value * (1 - multiplier);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user