Web 加上资金面/情绪叠图,并收紧默认图面。

默认主/次/次次改为 45m/15m/5m、开始时间一周;SD/CD 按 hist 摆位置和箭头;去掉笔线段背驰与第四类勾选。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-09-12 02:25:44 +08:00
co-authored by Cursor
parent b301ad22c9
commit c22cd48f36
24 changed files with 1200 additions and 306 deletions
+16 -9
View File
@@ -26,10 +26,10 @@ function loadSymbols() {
});
}
// 设置默认时间范围:最近 1 个月
// 设置默认时间范围:现在倒退 1
function setDefaultTimeRange() {
const now = new Date();
const daysBack = 30;
const daysBack = 7;
const start = new Date(now.getTime() - (daysBack * 24 * 60 * 60 * 1000));
// 格式化为datetime-local输入框所需的格式 YYYY-MM-DDThh:mm
@@ -72,17 +72,20 @@ $(document).ready(function() {
window.astockStatusInterval = null;
}
loadSymbols();
if (window.ChanDeriv) ChanDeriv.setVisible(true);
} else if (dataSource === 'a_stock') {
$('#cryptoSymbolContainer').hide();
$('#astockSymbolContainer').show();
loadAStockSymbols();
startAStockStatusUpdater();
if (window.ChanDeriv) ChanDeriv.setVisible(false);
}
});
});
// 检查初始数据源设置
const initialDataSource = $('#dataSource').val();
if (window.ChanDeriv) ChanDeriv.setVisible(initialDataSource !== 'a_stock');
if (initialDataSource === 'a_stock') {
$.getJSON('/api/chart_metadata', { source: 'a_stock' })
.done(function(meta) {
@@ -404,6 +407,7 @@ function mapTimeframeToInterval(timeframe) {
'5m': '5',
'15m': '15',
'30m': '30',
'45m': '45',
'1h': '60',
'2h': '120',
'4h': '240',
@@ -547,6 +551,7 @@ function refreshChart(data, options) {
if (currentData && currentData.ema52_dict) {
updateEMA52Display(currentData);
}
if (window.ChanDeriv) ChanDeriv.sync({ overlay: false });
return;
} catch (e) {
console.warn('增量刷新失败,回退全量重建:', e);
@@ -584,6 +589,7 @@ function refreshChart(data, options) {
if (currentData && currentData.ema52_dict) {
updateEMA52Display(currentData);
}
if (window.ChanDeriv) ChanDeriv.sync({ overlay: true });
}
@@ -597,8 +603,8 @@ function refreshChartOnly() {
}
}
// 绑定主/次/次次周期笔背驰、线段背驰、笔面积、线段面积显示开关
$('#showMainMacdDiv, #showMainSegMacdDiv, #showElementMacdDiv, #showElementSegMacdDiv, #showSubSubMacdDiv, #showSubSubSegMacdDiv, #showMainBiArea, #showMainSegArea, #showElementBiArea, #showElementSegArea, #showSubSubBiArea, #showSubSubSegArea').change(function() {
// 绑定主/次/次次周期笔面积、线段面积显示开关
$('#showMainBiArea, #showMainSegArea, #showElementBiArea, #showElementSegArea, #showSubSubBiArea, #showSubSubSegArea').change(function() {
updateChartDisplay();
});
@@ -637,6 +643,12 @@ $('#toggleUOnElement').change(function() {
});
// 买卖点显示开关
$('#showOi').change(function() {
if (window.ChanDeriv) ChanDeriv.loadOverlays();
});
$('#showDeriv').change(function() {
updateChartDisplay();
});
$('#showMainBsp').change(function() {
updateChartDisplay();
});
@@ -644,11 +656,6 @@ $('#showElementBsp').change(function() {
updateChartDisplay();
});
// 第四类买卖点(B4/S4)显示开关与过滤模式
$('#showMainFastBsp, #showElementFastBsp, #showSubSubFastBsp, #fastBspFilterMode').change(function() {
updateChartDisplay();
});
// 在控制台输出当前显示状态
console.log('当前显示状态:', {
'showOriginalKline': $('#showOriginalKline').is(':checked'),