Commit Graph

18 Commits

Author SHA1 Message Date
rob 5c37fb00b6 Upgrade Lightweight Charts from v2.1.0 to v5.1.0
- Update series creation to v5 API (addSeries with type parameter)
- Migrate watermarks to createTextWatermark plugin
- Migrate markers to createSeriesMarkers primitive
- Replace getBarSpacing() with timeScale().options().barSpacing
- Update crosshair handler: seriesPrices → seriesData
- Move scaleMargins from series options to price scale
- Fix chart sync infinite loop with time-based debounce (50ms)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-10 15:47:18 -03:00
rob 6a7a1c2b45 Fix indicator update callbacks and card display after refactor
- Bind indicators.update callback to correct this context in general.js
- Update updateDisplay to fall back to card elements when old chart elements don't exist
- Add _formatDisplayValue helper for consistent value formatting
- Remove verbose debug console.log statements
- Add FORMATIONS_PLAN.md documenting SVG overlay approach for chart formations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-10 15:01:55 -03:00
rob c8c51841cf Redesign indicator and backtest displays with icon cards
- Replace indicator table with icon card grid display
- Add edit indicator popup dialog for modifying indicator settings
- Display indicator type, value, and emoji symbols on cards
- Add visibility toggle and delete buttons on hover
- Redesign backtest items with CSS-based icons and status indicators
- Unify dialog styling across external indicator, signal type, and public strategies
- Make edit indicator dialog draggable
- Fix button text: "+ Add Public" -> "Add Public"
- Remove dark theme from signal_type_popup for consistency

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 23:22:15 -03:00
rob b4bf6c5c8e Add external data sources and indicators for backtesting
External Sources:
- New ExternalSources.py module for real-time API data fetching
- Configurable refresh intervals, JSONPath extraction, and auth headers
- External sources can be used in signals for live strategy conditions

External Indicators:
- New ExternalIndicators.py module for historical API data
- Supports backtesting by fetching and caching historical data points
- Timestamps are matched to candle times during backtest execution
- Fear & Greed index and similar APIs now work in backtests

Signal System Enhancements:
- Added signal Blockly blocks for use in strategy builder
- New signal_blocks.js for dynamic signal block generation
- Signals category added to strategy toolbox
- PythonGenerator updated to handle signal_* block types
- process_signal() method added to StrategyInstance classes

notify_user Block Enhancement:
- Now supports dynamic values (variables, indicators, expressions)
- Can display indicator values and calculations in notifications

Bug Fixes:
- Fixed Socket.IO parse error causing strategies not to load on refresh
- Enhanced sanitize_for_json to handle pandas, datetime, bytes types
- Fixed external indicator name matching (underscore/space conversion)
- Fixed PRAGMA query missing fetch_all=True in ExternalIndicators

Dependencies:
- Added jsonpath-ng for JSONPath extraction from API responses

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 21:25:36 -03:00
rob 11c1310f49 Register all 61 candlestick patterns in frontend indicatorMap
The new patterns were only added to the backend (indicators.py) but
not registered in the frontend (indicators.js), causing "Unknown
indicator type" errors when trying to display them on charts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 13:33:43 -03:00
rob 4ab7a5023d Add candlestick pattern indicators with TA-Lib integration
- Add 15 candlestick pattern indicators (Doji, Hammer, Engulfing, etc.)
- Create dedicated Patterns chart pane for pattern visualization
- Add hover tooltips with descriptions and SVG diagrams in indicator selector
- Fix color picker compatibility by using hex format instead of RGBA
- Fix chart positioning and timestamp synchronization for pattern chart

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 05:45:51 -03:00
rob 7b796c51c8 Fix indicator toggle functionality and add loading feedback
- Fix JSON parsing bug: JavaScript FormData sends indicator list as
  JSON string inside a list, now properly parsed on backend
- Move form event listener setup to _setupIndicatorForm() called from
  addToCharts() so it's always attached regardless of indicator data
- Add immediate visual feedback: popup hides instantly on submit and
  button shows "Updating..." text

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 03:33:45 -03:00
rob 3e6463e4b3 Add Bollinger %B indicator and fix credential handling
- Add BollingerPercentB indicator class in backend (BOL%B)
  - Calculates %B = (Close - Lower) / (Upper - Lower)
  - Shows where price is relative to Bollinger Bands
  - Values: 1.0 = upper band, 0.5 = middle, 0.0 = lower
- Add BollingerPercentB JavaScript class for frontend display
  - Creates its own chart (chart4) like RSI/MACD
  - Includes chart binding for synchronized scrolling
- Add chart4 HTML container and data plumbing
- Fix credential update when reconnecting with changed API keys
- Add TESTNET_MODE config setting for live trading mode control

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-06 06:31:31 -04:00
rob 0e481e653e Integrate EDM for candle data and improve UI dialogs
EDM Integration:
- Add edm_client module for REST/WebSocket communication with exchange-data-manager
- Refactor candles.py to fetch data exclusively from EDM
- Add EDM session management for authenticated exchange access
- Update backtesting to use EDM for historical data
- Pass edm_client through to all strategy instances
- Add /api/edm-config, /api/chart-view, /health/edm endpoints
- Remove legacy candle-fetching code from DataCache_v3 and Exchange

UI Improvements:
- Make all popup dialogs draggable and resizable (exchange config, indicator, signal, trade)
- Add default trading source (exchange, symbol, timeframe) to strategy dialog
- Convert symbol fields to dropdowns with smart prioritization (popular pairs first)
- Fix signal dialog property dropdown initialization

Bug Fixes:
- Fix PythonGenerator regex to handle symbols starting with numbers (e.g., 0G/USDT)
- Fix EDM client date format (use Unix timestamps instead of ISO strings)
- Fix strategy default_source database migration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-04 11:42:06 -04:00
Rob 4eda0b6f81 The strategies class is broken into smaller classes. I believe the ui is mostly functional at this point. It is time to get the tests working. 2024-10-10 17:05:07 -03:00
Rob 89e0f8b849 I decoupled the comms class from a few other classes. I updated some of the ui in regard to this indicator readouts. An just about to attempt to break up the strategies class. 2024-10-09 09:09:52 -03:00
Rob 034b8ab925 The strategy section is generating code. Implemented code is mostly functional. 2024-09-23 09:55:27 -03:00
Rob 29f30cb358 Mostly working now 2024-09-19 17:10:26 -03:00
Rob f1d0f2a4b1 Indicators are fixed after last update. 2024-09-18 13:47:07 -03:00
Rob f2b7621b6d Everything is working I am just about to refactor indicator storage. 2024-09-09 15:43:16 -03:00
Rob 73ed1a092a got all the indicators working again 2024-09-08 04:04:58 -03:00
Rob b666ec22af Extended DataCache with indicator caching functionality. All DataCache tests pass. 2024-09-07 19:51:01 -03:00
Rob 0bb9780ff6 Fixed issue with fetching historical data and added missing imports. 2024-07-26 03:52:24 -03:00