Opening a panel, and why it stays open
The single mechanism the whole interface rests on — Streamlit re-runs the entire script on every interaction, so what stays on screen is what the session remembers.
- 1The visitor picks a ticker from the watchlist and a date range in the sidebar
- 2Every interaction re-executes the script from the top; the session's flags are read before anything is drawn
- 3A year of daily history is fetched once for the current ticker and range, and shared by every panel that is open
- 4Pressing a panel button does not draw the chart — it sets that panel's flag and lets the script re-run
- 5On the next pass the flag is set, the indicator is computed over the already-fetched history, and the figure is rendered
- 6Because the flag persists, the panel is still there after the next click, and opening a second panel never closes the first



