Skip to content

feat(tide-chart): interactive probability calculator, horizon toggle, auto-refresh#20

Merged
e35ventura merged 1 commit intoentrius:mainfrom
MkDev11:feature/issue-12-tide-chart-interactive
Mar 8, 2026
Merged

feat(tide-chart): interactive probability calculator, horizon toggle, auto-refresh#20
e35ventura merged 1 commit intoentrius:mainfrom
MkDev11:feature/issue-12-tide-chart-interactive

Conversation

@MkDev11
Copy link
Copy Markdown
Contributor

@MkDev11 MkDev11 commented Mar 8, 2026

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:

  • Converted main.py to a Flask application that serves a dynamic web UI and API endpoints (/api/data and /api/probability).
  • Added a target price probability calculator using linear interpolation across the 9 Synth percentile levels.
  • Implemented a time horizon toggle (1H vs 24H). The 24h view now properly shows all 9 available assets (equities + crypto), while the 1h view shows the 4 crypto/commodity assets.
  • Dynamic benchmark selection: the dashboard compares against SPY for 24h horizons and BTC for 1h horizons, automatically updating table headers and sorting metrics.
  • Added live auto-refresh (5-minute toggle) and manual refresh buttons that fetch new data dynamically.
  • Removed hardcoded limits and cleaned up lint/formatting issues across the tool.

Related Issues

Closes #12

Type of Change

  • Bug fix
  • Improvement to existing tool
  • Documentation
  • Other (describe below)

Testing

  • Tested against Synth API
  • Manually tested (verified interactive UI, horizon toggling, API endpoints, and probability calculator

@MkDev11 MkDev11 force-pushed the feature/issue-12-tide-chart-interactive branch from 1a04604 to c6024bb Compare March 8, 2026 01:28
… 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
@MkDev11 MkDev11 force-pushed the feature/issue-12-tide-chart-interactive branch from c6024bb to 8610999 Compare March 8, 2026 01:32
@e35ventura
Copy link
Copy Markdown
Collaborator

please add Submission Requirements

@e35ventura e35ventura merged commit fdc906c into entrius:main Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tide Chart Enhancements: Interactive Features

2 participants