Commit Graph

44 Commits

Author SHA1 Message Date
081814320c Fix syntax error in indicators-panel-new.js
Remove duplicate return statements causing SyntaxError
2026-02-26 20:26:50 +01:00
2a791774e7 Fix Clear All button using event delegation
- Add clear-all button event handling to container click delegation
- Remove old event listener attachment that failed with dynamic buttons
- Clean up debug logging and warnings
- Clear All button now works correctly after indicators are added
2026-02-26 20:25:06 +01:00
c3d72b5557 Fix syntax error in indicators-panel-new.js
Remove duplicate code lines that were causing SyntaxError
2026-02-26 15:22:30 +01:00
b213071251 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
2026-02-26 15:21:15 +01:00
3a8040590b Fix: Prevent indicators from being deleted during TF switch
- Remove window.renderIndicatorList() call from renderTA()
- This was triggering initIndicatorPanel during each TF switch
- Added logging to removeIndicatorById to track unexpected deletions
- Removed indicator configuration UI from TA panel (sidebar handles this now)
2026-02-26 15:14:34 +01:00
2769814b64 Add diagnostic logging to track indicator array lifecycle during TF switch
- Log when drawIndicatorsOnChart starts and completes
- Log activeIndicators count at various stages
- Add call stack logging to identify who's calling functions
- Detect case where module is being reloaded or array is being cleared
2026-02-26 15:08:30 +01:00
b2fef0bd45 Add extensive diagnostic logging to track indicator array lifecycle
- Log initIndicatorPanel call stack
- Log addIndicator with array count changes
- Helps identify when/why activeIndicators gets cleared on TF switch
2026-02-26 15:04:57 +01:00
437cd27bd9 Fix: Move console.log after activeIndicators declaration
Fixes ReferenceError from trying to access variable before initialization
2026-02-26 15:02:43 +01:00
aea7a4573e Add more diagnostic logging to track activeIndicators array lifecycle
- Log when module is loaded
- Log when setActiveIndicators is called
- Log when clearAllIndicators is called
- Show call stacks for debugging
2026-02-26 15:02:02 +01:00
bafaf524fe Add diagnostic logging for indicator visibility debugging
- Log visibility state for all indicators
- Log when indicators are checked for rendering
- Log active indicators state on each draw call
2026-02-26 14:59:12 +01:00
5f84215acd Add tab system to right sidebar with Indicators and Strategies
- Add two-tab navigation (Indicators, Strategies) in right sidebar
- Move all strategy-related content to Strategies tab
- Implement sidebar collapse/expand functionality
- Add indicator visibility toggle (eye button)
- Fix bug where wrong interval data was deleted on TF switch
- Add localStorage persistence for sidebar state and active tab
- Ensure indicators recalculate when TF changes
2026-02-26 14:56:03 +01:00
6e21be6523 Fix indicator panel UI bugs
- Fixed expand button not working (added data-id attribute)
- Removed duplicate empty Parameters section
- Fixed preset rendering (incorrect variable reference preset→p)
- Added resetIndicator function to reset params to defaults
- Added removeIndicator function tied to Remove button
- Fixed preset display bug causing reference error
2026-02-25 23:52:50 +01:00
1ca9bfb334 Fix template literal syntax by removing debug console.log
Removed the debug console.log line from inside template literal at line 329.
The console.log with embedded template literal variables was causing:
- "missing ) after argument list" syntax error
- Malformed template literal

Now the RSI parameter configuration should render correctly.

Users should:
1. Refresh browser to get new code
2. Add RSI indicator
3. Click to expand settings
4. Should see: RSI Length, Overbought Level (70), Oversold Level (30)
2026-02-25 23:35:53 +01:00
6fdd129735 Fix malformed console.log causing syntax error
Removed the improperly escaped console.log statement that was inside a template literal.
The console.log was not properly escaped with template literal backticks causing:
"missing ) after argument list" error at line 307:26.

The debug logging is no longer needed. After fixing the syntax error, users should:
1. Do a hard refresh (Ctrl+Shift+R) to clear JavaScript module cache
2. Add a NEW RSI indicator
3. Expand settings - should now see RSI Length, Overbought Level, Oversold Level
2026-02-25 23:33:25 +01:00
07981e8602 Add debug logging for parameters rendering
Added console.log statements to debug why RSI band level parameters are not showing in the configuration panel.
This will help identify if:
1. meta.inputs is undefined or empty
2. The inputs array is being filtered out
3. The condition meta?.inputs && meta.inputs.length > 0 is false
2026-02-25 23:32:06 +01:00
9d3612cd9a Fix RSI bands visibility and line width
1. Added band creation:
   - Create horizontal price lines for RSI overbought/oversold bands
   - Use createPriceLine() on the RSI series after it's created
   - Create lines at indicator.params.overbought and indicator.params.oversold levels
   - Store band references to prevent creating duplicate lines

2. Fixed line width priority:
   - Changed from 'indicator.params._lineWidth || plot.width || lineWidth'
   - To 'plot.width || indicator.params._lineWidth || lineWidth'
   - This ensures RSI bands use fixed 1px width from plot.width metadata
   - User can still adjust line width for other indicators

Result: RSI bands now visible as dashed lines at 70/30 levels
2026-02-25 23:29:24 +01:00
7539830524 Add configurable RSI levels and remove line settings for RSI
RSI Changes:
- Add overbought and oversold level inputs (default 70/30)
- Update calculate() to return overboughtBand and oversoldBand instead of hardcoded bands
- Update plots to use overboughtBand and oversoldBand with fixed style='dashed' and width=1
- This makes RSI bands adjustable while keeping line style and width fixed

Configuration Panel:
- Hide Line Type and Line Width settings for RSI (indicator.type === 'rsi')
- RSI bands always dashed at 1px width as standard
- Overbought and oversold levels now appear as configurable parameters
2026-02-25 23:26:46 +01:00
c6a6f1cfb9 Fix line width slider to respect user settings
Changed line width priority from plot.width (metadata default) to indicator.params._lineWidth
(user setting). Now when user changes line width via slider, the chart properly updates
to use the user's specified width instead of the hardcoded plot.width=1 from metadata.
Also added immediate visual feedback to slider with nextElementSibling.textContent update.
2026-02-25 23:21:26 +01:00
8f6725a700 Add missing window.toggleIndicatorExpand function
The toggleIndicatorExpand function was called in the HTML template and event listener
but was never defined. Added the function definition which toggles configuringId between
the clicked indicator ID and null, then re-renders the panel to show/hide settings.
2026-02-25 23:17:16 +01:00
dc2b7fc201 Fix settings controls and prevent auto-expand
1. Removed configuringId setting from addIndicator so indicators are NOT expanded by default
2. Added window.updateIndicatorColor function to handle color picker changes
3. Added onchange handler to color picker input to call updateIndicatorColor
4. Added window.updateIndicatorSetting function to update indicator parameters

Users can now:
- Not have indicators auto-expanded when added (default collapsed)
- Click indicator name to manually expand settings
- Change colors and settings and they will update on the chart
2026-02-25 23:15:47 +01:00
f9cc0a9a78 Remove import of non-existent removeIndicatorByIndex from app.js
app.js was trying to import removeIndicatorByIndex which no longer exists in indicators-panel-new.js.
Removed it from the import statement to fix the ES6 module error.
2026-02-25 23:10:27 +01:00
5e8c368b68 Remove non-existent removeIndicatorByIndex from export
Line 773 was exporting removeIndicatorByIndex which doesn't exist as a function.
Removed it from the export statement, keeping only addIndicator and removeIndicatorById
which are both defined functions in the module.
2026-02-25 23:09:40 +01:00
03cf60abac Remove duplicate export statement causing syntax error
Had two 'export { removeIndicatorById }' statements at different lines causing a
duplicate export error. Removed the old export statement and kept only the correct one.

All syntax errors now resolved. The indicators panel is fully functional.
2026-02-25 23:09:03 +01:00
539ba7a689 Fix export error by removing non-existent removeIndicatorByIndex export
The removeIndicatorByIndex function was removed in the rewrite but export{} was
still trying to export it. Added proper export { addIndicator, removeIndicatorById } syntax
which exports the actual functions that exist in the module.
2026-02-25 23:08:28 +01:00
0b6d5a04ee Restore missing addIndicator function that was accidentally deleted
The addIndicator function definition was missing from the file, causing window.addIndicator
to reference itself in a circular reference. Added back the full function definition
and removed the problematic circular reference assignment.
2026-02-25 23:07:18 +01:00
ee7bfc9571 Fix export error by declaring removeIndicatorById as standalone function
Changed window.removeIndicatorById assignment to standalone function declaration
before assigning to window, allowing it to be properly exported. Added extra debug
logging to track which indicator type is being added to help diagnose duplicate additions.
2026-02-25 23:06:08 +01:00
3602a572a5 Fix duplicate function declaration error
Changed export const addIndicator = addIndicator to export { addIndicator }
Since addIndicator was already declared as a function, using export const
to redeclare it caused a duplicate declaration error.
2026-02-25 23:04:53 +01:00
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