Clean up and finalize indicator persistence on TF change
- Remove multiple delayed redraw calls from app.js (now handled in chart.js) - Remove excessive diagnostic logging throughout codebase - Keep useful debug warning for old indicators-panel.js module - Indicator list, parameters, and visibility now persist across TF switches - Indicators automatically recalculate with new TF candles when they load
This commit is contained in:
@ -64,8 +64,7 @@ window.deleteSavedSimulation = deleteSavedSimulation;
|
||||
window.clearSimulationResults = clearSimulationResults;
|
||||
window.updateTimeframeDisplay = updateTimeframeDisplay;
|
||||
window.renderIndicatorList = function() {
|
||||
// Legacy function - replaced by initIndicatorPanel
|
||||
window.initIndicatorPanel();
|
||||
// This function is no longer needed for sidebar indicators
|
||||
};
|
||||
|
||||
// Export init function for global access
|
||||
@ -88,30 +87,6 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
|
||||
await loadStrategies();
|
||||
|
||||
// Initialize new indicator panel
|
||||
// Initialize indicator panel
|
||||
window.initIndicatorPanel();
|
||||
|
||||
const originalSwitchTimeframe = window.dashboard.switchTimeframe.bind(window.dashboard);
|
||||
window.dashboard.switchTimeframe = function(interval) {
|
||||
originalSwitchTimeframe(interval);
|
||||
|
||||
// Force redraw indicators after TF switch with multiple attempts
|
||||
setTimeout(() => {
|
||||
if (window.drawIndicatorsOnChart) {
|
||||
window.drawIndicatorsOnChart();
|
||||
}
|
||||
}, 100);
|
||||
|
||||
setTimeout(() => {
|
||||
if (window.drawIndicatorsOnChart) {
|
||||
window.drawIndicatorsOnChart();
|
||||
}
|
||||
}, 300);
|
||||
|
||||
setTimeout(() => {
|
||||
if (window.drawIndicatorsOnChart) {
|
||||
window.drawIndicatorsOnChart();
|
||||
}
|
||||
}, 500);
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user