Commit Graph

117 Commits

Author SHA1 Message Date
2c7cbbe073 Complete rewrite of indicators panel to fix duplicate event listeners
Key changes:
- Single 'listenersAttached' flag tracks if any listeners are attached
- One shared event delegation handler handles all button types (add, config, remove, favorite)
- Stop propagation immediately on button clicks to prevent multiple triggers
- Added e.stopPropagation() calls to prevent event bubbling
- Consolidated event listener logic into single function
- Added safety checks before calling window.functionName

This fixes the issue where one click added multiple indicators (3x MA, 6x HTS, 4x RSI) by preventing duplicate event listener setup.
2026-02-25 23:04:10 +01:00
43d3a081a3 Fix syntax error - remove extra closing brace
There was an extra closing brace on line 196 causing 'Unexpected token \'}\' error.
Removed the duplicate closing brace after the renderIndicatorPanel function export.
2026-02-25 22:59:41 +01:00
551953f564 Fix duplicate indicator addition by preventing multiple event listeners
Added eventListenersSet flag to track if event delegation has been setup.
Only call setupEventListeners() once during initial render to prevent
adding multiple event listeners that cause 'addIndicator' to be called
multiple times when clicking a button once.

This fixes the bug where one click adds 8 identical indicators.
2026-02-25 22:58:52 +01:00
5f6d71f616 Add missing renderIndicatorOnPane function and fix index undefined error
- Added complete renderIndicatorOnPane function from indicators-panel.js
- Fixed window.updateIndicatorSetting function that referenced undefined 'index' variable
- This fixes 'renderIndicatorOnPane is not defined' error when adding indicators
2026-02-25 22:56:53 +01:00
4a503f6b62 Fix event handlers using event delegation
- Fixed 'favoriteIds.map is not a function' error by converting Set to Array
- Changed onclick handlers to data attributes for dynamically created elements
- Added event delegation for Add button using data-type attribute
- This fixes issues where onclick handlers in template literals don't work properly in ES6 modules
2026-02-25 22:55:13 +01:00
751b59090f Add missing global variables: indicatorPanes and nextPaneIndex
These variables were used in drawIndicatorsOnChart but never declared at module level.
Added declarations to fix 'indicatorPanes is not defined' error.
2026-02-25 22:50:48 +01:00
734a47df7d Fix temporal dead zone error in filter callback
Moved console.log outside filter callback to avoid accessing 'catalog' variable before it was initialized. The log statement was placed inside the filter callback which creates a temporal dead zone for the variable being assigned.
2026-02-25 22:46:56 +01:00
ac44b52b8b Fix CSS import and add debug logging for indicator panel
- Changed @import style to proper <link> tag for indicators-new.css
- Added console logging to initIndicatorPanel for debugging
- Added console logging to renderIndicatorPanel to show filter results
- This should help diagnose empty panel issue
2026-02-25 22:46:03 +01:00
d0fbe8cfe5 Fix export syntax using standalone function declarations
- Converted window.addIndicator to standalone function 'addIndicator'
- Converted window.removeIndicatorById to standalone function 'removeIndicatorById'
- Added standalone function removeIndicatorByIndex
- Export all three functions directly
- Assign to window for backward compatibility
- Fixes 'Unexpected token' error in export statements
2026-02-25 22:43:05 +01:00
5140e437b0 Fix temporal dead zone error in exports
Changed exports to use export { } syntax after function definitions
to avoid 'cannot access before initialization' error.
Moved export statements to end of file where all functions are defined.
2026-02-25 22:41:56 +01:00
f1757da143 Fix missing export for removeIndicatorByIndex function
Added 'export' keyword to removeIndicatorByIndex function declaration so it can be imported by app.js
2026-02-25 22:41:12 +01:00
844f3afd89 Add proper ES6 exports for indicator panel modules
- Export addIndicator for module imports
- Export removeIndicatorById for module imports
- Export removeIndicatorByIndex for module imports
- Fix circular reference issues with window assignments
- Simplify export statements to work with ES6 modules

This fixes the 'does not provide export named addIndicator' error.
2026-02-25 22:38:48 +01:00
a6ed93ddbf Fix syntax error in showPresets function
Fixed nested template literal syntax error by escaping properly and using string concatenation instead of nested template literals to avoid interpolation conflicts.
2026-02-25 22:36:43 +01:00
a45d09ef6f Implement single-panel indicator management system
Single-panel design with TradingView-inspired UX:
- Search bar for filtering indicators by name
- Category tabs (Trend, Momentum, Volatility, Volume, Favorites)
- Expandable indicators with inline configuration
- Favorites system with pinning
- Preset system to save/load indicator configurations
- Reset to defaults functionality
- Real-time configuration changes (apply immediately)
- Mobile-friendly responsive design
- Touch-optimized for mobile devices
- Cleaner single-panel layout replacing two-panel approach

Features:
✓ Search functionality (must-have)
✓ Presets high-priority (save, load, delete)
✓ Single expandable panel
✓ Inline configuration (no separate panel)
✓ Categories for organizing indicators
✓ Favorites support
✓ Real-time visual updates
✓ Mobile responsive
✓ Collapse all indicators with one click
○ Drag-to-reorder (not implemented - nice to have)

Updated files:
- indicators-panel-new.js: Completely new implementation
- indicators-new.css: New styles for single panel
- index.html: Updated sidebar to use indicator panel
- app.js: Updated imports and initialization
2026-02-25 22:34:59 +01:00
6dc9cf5a63 Prevent TA panel refresh when changing timeframes
- Removed automatic TA reload when switching timeframes
- TA panel now only loads on initial page load and when manually refreshed
- User must click Refresh button to update TA after timeframe change
2026-02-25 22:17:57 +01:00
258ac8eef2 Fix dashboard loading and maximize chart area
- Fixed TA panel loading state - now waits for initial data before loading technical analysis
- Changed initial loading message from 'Loading technical analysis...' to 'Waiting for candle data...'
- Made strategy simulation sidebar collapsed by default to maximize chart area
- Added refresh timestamp to TA panel when manually refreshed
- Improved error messages for when data isn't available in database
2026-02-25 22:16:12 +01:00
c7ee5135ae Initial commit - BTC Trading Dashboard
- FastAPI backend with PostgreSQL database connection
- Frontend dashboard with lightweight-charts
- Technical indicators (SMA, EMA, RSI, MACD, Bollinger Bands, etc.)
- Trading strategy simulation and backtesting
- Database connection to NAS at 20.20.20.20:5433
- Development server setup and documentation
2026-02-25 22:10:30 +01:00