Change fx strength and add bb
This commit is contained in:
+1
-3
@@ -379,11 +379,9 @@ def analyze_chan(df):
|
||||
fx_strength_level = ""
|
||||
is_strong_fx = False
|
||||
|
||||
# 尝试调用分型强度计算方法
|
||||
# 统一使用cal_fx_strength函数
|
||||
if hasattr(klc, 'cal_fx_strength'):
|
||||
fx_strength = klc.cal_fx_strength()
|
||||
elif hasattr(klc, 'calculate_fx_strength'):
|
||||
fx_strength = klc.calculate_fx_strength()
|
||||
|
||||
# 尝试获取分型强度等级
|
||||
if hasattr(klc, 'get_fx_strength_level'):
|
||||
|
||||
@@ -861,6 +861,20 @@
|
||||
tooltipElement.className = 'point-tooltip';
|
||||
// document.body.appendChild(tooltipElement);
|
||||
|
||||
// 添加自定义十字线信息显示
|
||||
const crosshairTooltip = document.createElement('div');
|
||||
crosshairTooltip.className = 'crosshair-tooltip';
|
||||
crosshairTooltip.style.position = 'absolute';
|
||||
crosshairTooltip.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
|
||||
crosshairTooltip.style.color = 'white';
|
||||
crosshairTooltip.style.padding = '5px 10px';
|
||||
crosshairTooltip.style.borderRadius = '4px';
|
||||
crosshairTooltip.style.fontSize = '12px';
|
||||
crosshairTooltip.style.zIndex = '1000';
|
||||
crosshairTooltip.style.pointerEvents = 'none';
|
||||
crosshairTooltip.style.display = 'none';
|
||||
// document.body.appendChild(crosshairTooltip);
|
||||
|
||||
// 助手函数:转换UTC时间到所选时区
|
||||
function convertToTimezone(utcDate, timezone) {
|
||||
return new Date(utcDate).toLocaleString('zh-CN', {
|
||||
@@ -2915,7 +2929,7 @@
|
||||
const volumeChartRect = volumeChartContainer.getBoundingClientRect();
|
||||
const volumeLine = document.createElement('div');
|
||||
volumeLine.className = 'volume-crosshair-line';
|
||||
volumeLine.style.position = 'absolute';
|
||||
volumeLine.style.position = 'fixed'; // 改为fixed定位
|
||||
volumeLine.style.left = (volumeChartRect.left + volumeTimeCoordinate) + 'px';
|
||||
volumeLine.style.top = volumeChartRect.top + 'px';
|
||||
volumeLine.style.width = '1px';
|
||||
@@ -2934,7 +2948,7 @@
|
||||
const macdChartRect = macdChartContainer.getBoundingClientRect();
|
||||
const macdLine = document.createElement('div');
|
||||
macdLine.className = 'macd-crosshair-line';
|
||||
macdLine.style.position = 'absolute';
|
||||
macdLine.style.position = 'fixed'; // 改为fixed定位
|
||||
macdLine.style.left = (macdChartRect.left + macdTimeCoordinate) + 'px';
|
||||
macdLine.style.top = macdChartRect.top + 'px';
|
||||
macdLine.style.width = '1px';
|
||||
@@ -3240,7 +3254,7 @@
|
||||
|
||||
// 构建显示文本,包含分型类型和强度信息
|
||||
let displayText = `${fx.fx_strength.toFixed(1)}`;
|
||||
if (fx.fx_strength < 1.5) { // 降低阈值,让更多分型显示
|
||||
if (fx.fx_strength < 0) { // 降低阈值,让更多分型显示
|
||||
displayText = fx.fx_strength >= 0.8 ? '•' : '' // 0.8以上显示点,0.8以下不显示文本
|
||||
}
|
||||
|
||||
@@ -3966,7 +3980,7 @@
|
||||
const volumeChartRect = volumeChartContainer.getBoundingClientRect();
|
||||
const volumeLine = document.createElement('div');
|
||||
volumeLine.className = 'volume-crosshair-line';
|
||||
volumeLine.style.position = 'absolute';
|
||||
volumeLine.style.position = 'fixed'; // 改为fixed定位
|
||||
volumeLine.style.left = (volumeChartRect.left + volumeTimeCoordinate) + 'px';
|
||||
volumeLine.style.top = volumeChartRect.top + 'px';
|
||||
volumeLine.style.width = '1px';
|
||||
@@ -3985,7 +3999,7 @@
|
||||
const macdChartRect = macdChartContainer.getBoundingClientRect();
|
||||
const macdLine = document.createElement('div');
|
||||
macdLine.className = 'macd-crosshair-line';
|
||||
macdLine.style.position = 'absolute';
|
||||
macdLine.style.position = 'fixed'; // 改为fixed定位
|
||||
macdLine.style.left = (macdChartRect.left + macdTimeCoordinate) + 'px';
|
||||
macdLine.style.top = macdChartRect.top + 'px';
|
||||
macdLine.style.width = '1px';
|
||||
@@ -4801,6 +4815,19 @@
|
||||
// 初始化股票筛选表格
|
||||
initStockFilterTable();
|
||||
|
||||
// 添加页面滚动事件监听器,清除十字线延长线
|
||||
$(window).on('scroll', function() {
|
||||
try {
|
||||
// 清除所有十字线延长线,防止它们跟着页面滚动
|
||||
const existingVolumeLines = document.querySelectorAll('.volume-crosshair-line');
|
||||
existingVolumeLines.forEach(line => line.remove());
|
||||
const existingMacdLines = document.querySelectorAll('.macd-crosshair-line');
|
||||
existingMacdLines.forEach(line => line.remove());
|
||||
} catch (e) {
|
||||
console.debug('清除滚动中的十字线时出错:', e);
|
||||
}
|
||||
});
|
||||
|
||||
// 突出显示股票筛选tab (已禁用)
|
||||
setTimeout(function() {
|
||||
const stockFilterTab = $('#stock-filter-tab');
|
||||
@@ -6196,6 +6223,19 @@
|
||||
// 初始化股票筛选表格
|
||||
initStockFilterTable();
|
||||
|
||||
// 添加页面滚动事件监听器,清除十字线延长线
|
||||
$(window).on('scroll', function() {
|
||||
try {
|
||||
// 清除所有十字线延长线,防止它们跟着页面滚动
|
||||
const existingVolumeLines = document.querySelectorAll('.volume-crosshair-line');
|
||||
existingVolumeLines.forEach(line => line.remove());
|
||||
const existingMacdLines = document.querySelectorAll('.macd-crosshair-line');
|
||||
existingMacdLines.forEach(line => line.remove());
|
||||
} catch (e) {
|
||||
console.debug('清除滚动中的十字线时出错:', e);
|
||||
}
|
||||
});
|
||||
|
||||
// 突出显示股票筛选tab (已禁用)
|
||||
setTimeout(function() {
|
||||
const stockFilterTab = $('#stock-filter-tab');
|
||||
|
||||
Reference in New Issue
Block a user