diff --git a/openbb_terminal/core/plots/plotly_ta/plugins/overlap_plugin.py b/openbb_terminal/core/plots/plotly_ta/plugins/overlap_plugin.py index e3629fde390..1ef202fbe70 100644 --- a/openbb_terminal/core/plots/plotly_ta/plugins/overlap_plugin.py +++ b/openbb_terminal/core/plots/plotly_ta/plugins/overlap_plugin.py @@ -47,7 +47,7 @@ class Overlap(PltTA): fig.add_annotation( xref="paper", yref="paper", - text=f"{column.replace('_', '').replace('RMA', 'MA')}", + text=f"{column.replace('_', '').replace('RMA', 'MA')}", x=0, xanchor="left", yshift=-inchart_index * 18, diff --git a/openbb_terminal/dashboards/stream/Forecasting.py b/openbb_terminal/dashboards/stream/Forecasting.py index f7f8fd3835c..cd5a4f68b5b 100644 --- a/openbb_terminal/dashboards/stream/Forecasting.py +++ b/openbb_terminal/dashboards/stream/Forecasting.py @@ -20,7 +20,29 @@ st.set_page_config( page_icon="📈", initial_sidebar_state="collapsed", ) - +css_container_style = """ + +""" +st.markdown(css_container_style, unsafe_allow_html=True) # pylint: disable=E1101 model_opts = { @@ -52,6 +74,7 @@ feat_engs = { interval_opts = ["1d", "5d", "1wk", "1mo", "3mo"] REGEX_RICH = re.compile(r"\[\/{0,1}[a-zA-Z0-9#]+\]|\[\/\]") EXPLAINABILITY_FIGURE: Union[OpenBBFigure, None] = None +PAST_COVERAGE_PRINT: str = "
" # Rows and columns for the dashboard layout st.title("OpenBB Forecasting") # Title does not like being in a column @@ -60,7 +83,7 @@ r2c1, r2c2, r2c3 = st.columns([1, 1, 1]) st.markdown("""---""") forecast_button = st.button("Get forecast") plotly_chart, table_container = st.columns([4, 1]) -explainability = st.container() +explainability, past_cov_legend = st.columns([4, 1]) def format_df(df: pd.DataFrame) -> pd.DataFrame: @@ -101,9 +124,19 @@ def rich_to_dataframe(table: Table) -> pd.DataFrame: def special_st(text: Optional[str] = None) -> Optional[str]: if isinstance(text, Table): with table_container: + text.title = re.sub(REGEX_RICH, "", text.title).replace( + "Actual price:", + "

Actual price:" + "", + ) + st.write( + f"{text.title}

", + unsafe_allow_html=True, + ) st.table(rich_to_dataframe(text)) elif isinstance(text, str) and "[green]" in text: - st.success(re.sub(REGEX_RICH, "", text)) + global PAST_COVERAGE_PRINT # pylint: disable=W0603 + PAST_COVERAGE_PRINT += re.sub(REGEX_RICH, "", text) + "
" return text @@ -254,6 +287,15 @@ class Handler: ), ), ) + with past_cov_legend: + global PAST_COVERAGE_PRINT # pylint: disable=W0603 + text = PAST_COVERAGE_PRINT + if text != "
": + st.write( + f"{text}", + unsafe_allow_html=True, + ) + PAST_COVERAGE_PRINT = "
" def handle_eng(self, target, feature): self.feature_target = target diff --git a/openbb_terminal/dashboards/stream/pages/Indicators.py b/openbb_terminal/dashboards/stream/pages/Indicators.py index 5fc450e6e0f..37e3a0c81af 100644 --- a/openbb_terminal/dashboards/stream/pages/Indicators.py +++ b/openbb_terminal/dashboards/stream/pages/Indicators.py @@ -148,6 +148,11 @@ async def plot_indicators( overlaying="y", ) + for annotation in fig.select_annotations( + selector=dict(xanchor="left", x=0, xref="paper") + ): + annotation.xshift += -5 + fig.hide_holidays() y_min, y_max = data["Low"].min().min(), data["High"].max().max()