feat: Implement HTS (Higher Timeframe Trend System) strategy

- Add HTS strategy engine with crossover and alignment-based entries
- Implement Auto HTS feature (computes on TF/4 from 1m data)
- Add 1H Red Zone filter to validate long signals
- Add channel-based stop loss with RTL functionality
- Enhanced visualization with 30% opacity channel lines
- Fixed data alignment in simulation (uses htsData instead of mismatched indices)
- Fixed syntax errors in hts-engine.js (malformed template literals)
- Fixed duplicate code in simulation.js
- Added showSimulationMarkers to window object for global access
- Enhanced logging for trade signals and simulation results
- Fix missing prevFastHigh/currFastHigh in hts-visualizer.js
- Disable trend zone overlays to prevent chart clutter
- Implement client-side visualization for trade markers using line series
- MA strategy indicator configuration fixed (was empty during engine run)
- Made entry conditions more permissive for shorter timeframes
- Added comprehensive error handling and console logging
This commit is contained in:
DiTus
2026-02-27 09:30:43 +01:00
parent 286975b01a
commit e457ce3e20
9 changed files with 1080 additions and 100 deletions

View File

@ -58,6 +58,7 @@ window.performExport = performExport;
window.exportSavedSimulation = exportSavedSimulation;
window.runSimulation = runSimulation;
window.saveSimulation = saveSimulation;
window.showSimulationMarkers = showSimulationMarkers;
window.renderSavedSimulations = renderSavedSimulations;
window.loadSavedSimulation = loadSavedSimulation;
window.deleteSavedSimulation = deleteSavedSimulation;
@ -77,6 +78,12 @@ window.SimulationStorage = SimulationStorage;
window.IndicatorRegistry = IndicatorRegistry;
document.addEventListener('DOMContentLoaded', async () => {
// Attach toggle sidebar event listener
const toggleBtn = document.getElementById('sidebarToggleBtn');
if (toggleBtn) {
toggleBtn.addEventListener('click', toggleSidebar);
}
window.dashboard = new TradingDashboard();
restoreSidebarState();
restoreSidebarTabState();
@ -84,9 +91,9 @@ document.addEventListener('DOMContentLoaded', async () => {
setDefaultStartDate();
updateTimeframeDisplay();
renderSavedSimulations();
await loadStrategies();
// Initialize indicator panel
window.initIndicatorPanel();
});