feat(tide-chart): interactive probability calculator, horizon toggle, auto-refresh#20
Merged
e35ventura merged 1 commit intoentrius:mainfrom Mar 8, 2026
Conversation
1a04604 to
c6024bb
Compare
… auto-refresh Closes entrius#12 - Convert static HTML dashboard to Flask web server with API endpoints - Add interactive probability calculator with linear interpolation across 9 percentile levels (POST /api/probability) - Add variable time horizon toggle (1h/24h) with dynamic data refresh (GET /api/data?horizon=1h|24h) - Add manual refresh button and 5-minute auto-refresh with live indicator - 24h horizon includes all 9 assets (equities + crypto); 1h is crypto-only - Dynamic benchmark selection (SPY for 24h, BTC for 1h crypto) - Benchmark column headers update dynamically on horizon switch - Add 20 new focused tests covering horizon logic, probability edge cases, interpolation, and all Flask API endpoints (34 total, all pass) Files changed: - chart.py: horizon-aware fetch, get_assets_for_horizon, ALL_ASSETS, calculate_target_probability, add_relative_to_benchmark - main.py: Flask app with routes, dynamic benchmark header updates, refactored HTML into composable builders - requirements.txt: added flask>=3.0.0 - README.md: updated for new interactive features and API docs - tests/test_tool.py: 20 new tests for all interactive features
c6024bb to
8610999
Compare
Collaborator
|
please add Submission Requirements |
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
This PR transforms the static Tide Chart into a fully dynamic and interactive Flask dashboard, implementing all the requested enhancements. It adds an interactive probability calculator, introduces variable time horizons (switching between 1H intraday views and 24H next-day views), and sets up live auto-refresh capabilities so the dashboard stays up to date without manual page reloads.
Key highlights:
/api/dataand/api/probability).Related Issues
Closes #12
Type of Change
Testing