feat(webui): Trading signal panel, Predict Future Now, dark theme & bug fixes#309
Open
courasneto wants to merge 1 commit into
Open
Conversation
923a0cc to
5af73a9
Compare
…bug fixes
## Summary
Major improvements to the Kronos Web UI focusing on usability, visual clarity,
and a new real-time trading signal analysis panel.
## New Features
### Predict Future Now
- Added a dedicated 'Predict Future Now' button that uses the most recent
400 candles (lookback) to forecast the next 120 periods beyond the last
data point — i.e., a true future forecast, not a backtest.
- Future timestamps are generated programmatically via pd.date_range so
the model always forecasts into the uncharted future.
- No 'actual data' orange trace is shown in this mode (the future hasn't
happened yet).
### Trading Signal Analysis Panel
- After every prediction a full trading signal panel is displayed below the
chart, automatically computed from the prediction output.
- Signal categories: STRONG BUY / BUY / NEUTRAL / CAUTION / DO NOT BUY,
each with a distinct color scheme.
- Panel includes six metric cards: Current Price, Predicted Final Price (%),
Predicted High, Predicted Low, Predicted Mean, Support / Resistance.
- Trajectory timeline: Now → [Nd: +X%] → [Nd: +X%] → [End: +X%].
- Operations panel: Entry, Stop-Loss (-3%), Target 1, Target 2, Timeframe.
### Dark Theme & Chart Color Overhaul
- Chart background switched to plotly_dark with dark paper/plot bg.
- Historical candles: gray (#78909C / #546E7A) — neutral context.
- Prediction candles: blue (#1E88E5 / #1565C0) — clearly distinguishable.
- Actual/backtest candles: orange (#F57C00 / #BF360C) — easy comparison.
### Windows Launcher (start.ps1)
- One-command launcher: auto-detects the Python installation with CUDA
support by iterating all python.exe in PATH and testing
torch.cuda.is_available().
- Falls back to CPU if no CUDA Python is found.
- Deactivates any active venv to prevent using the wrong Python.
- Generates a random port (10000-60000), checks availability via
Get-NetTCPConnection, then auto-opens the browser after 3 s.
- Supports -SkipInstall flag to skip pip install on repeat launches.
### Data Download Utility (download_data.py)
- CLI utility to download market data (crypto, stocks, forex) via yfinance
and save to the Kronos data/ directory in the expected CSV format.
- Supports all yfinance intervals (1m, 5m, 15m, 1h, 4h, 1d, 1wk, 1mo).
- Usage: python download_data.py BTC-USD --interval 4h --period 2y
## Bug Fixes
### actual_data showing wrong price range in predict-future mode (critical)
- Root cause: the else branch in the actual_data section always fetched
df.iloc[0:lookback+pred_len] regardless of mode, so in predict-future
mode (no start_date) it served the very first candles in the file
(e.g. 2024 XRP at ~.50 instead of current ~.30), rendering an
orange trace in a completely wrong price band.
- Fix: actual_data is now mode-aware:
- predict_future=True → actual_df = None (no trace)
- start_date provided → actual_df from time_range_df[lookback:lookback+pred_len]
- neither → no actual data
### historical_start_idx wrong in predict-future mode
- Root cause: historical_start_idx defaulted to 0, so the chart showed
candles from the very beginning of the file (years-old data) as the
'historical' context window instead of the last 400 candles.
- Fix: when predict_future=True, historical_start_idx = len(df) - lookback.
## Localization
- All user-visible text translated from Chinese/Portuguese to English.
- html lang attribute updated to 'en'.
- Date formatting locale updated to en-US.
- .gitignore updated to exclude data/ and webui/prediction_results/ (runtime artifacts).
5af73a9 to
2f0aa68
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Major improvements to the Kronos Web UI — new trading signal analysis panel, a dedicated future-forecast mode, chart color overhaul, Windows launcher, data download utility, and two critical bug fixes.
New Features
🎯 Predict Future Now
📊 Trading Signal Analysis Panel
🎨 Dark Theme & Chart Color Overhaul
🪟 Windows Launcher (\start.ps1)
📥 Data Download Utility (\download_data.py)
Bug Fixes
\�ctual_data\ rendering wrong price range in predict-future mode (critical)
\historical_start_idx\ showing stale data in predict-future mode