diff --git a/openbb_terminal/core/plots/plotly_ta/plugins/volatility_plugin.py b/openbb_terminal/core/plots/plotly_ta/plugins/volatility_plugin.py index f010b156e27..f2d37e9c98f 100644 --- a/openbb_terminal/core/plots/plotly_ta/plugins/volatility_plugin.py +++ b/openbb_terminal/core/plots/plotly_ta/plugins/volatility_plugin.py @@ -84,11 +84,10 @@ class Volatility(PltTA): secondary_y=self.show_volume, ) bbands_text = ( - columns_regex(df_ta, "BBL")[0] - .replace("BBL_", "BB") - .replace("_", ",") - .split(".")[0] + columns_regex(df_ta, "BBL")[0].replace("BBL_", "BB").replace("_", ",") ) + if float(bbands_text.split(",")[1]) % 1 == 0: + bbands_text = bbands_text.split(".")[0] fig.add_annotation( xref="paper", yref="paper", diff --git a/openbb_terminal/helper_funcs.py b/openbb_terminal/helper_funcs.py index a4eee4f0ab0..925c5eed010 100644 --- a/openbb_terminal/helper_funcs.py +++ b/openbb_terminal/helper_funcs.py @@ -612,7 +612,7 @@ def check_indicator_parameters(args: str, _help: bool = False) -> str: def check_positive_float(value) -> float: - """Argparse type to check positive int.""" + """Argparse type to check positive float.""" new_value = float(value) if new_value <= 0: log_and_raise( diff --git a/openbb_terminal/stocks/technical_analysis/ta_controller.py b/openbb_terminal/stocks/technical_analysis/ta_controller.py index b09dc5150ed..7e24ce6a181 100644 --- a/openbb_terminal/stocks/technical_analysis/ta_controller.py +++ b/openbb_terminal/stocks/technical_analysis/ta_controller.py @@ -30,6 +30,7 @@ from openbb_terminal.helper_funcs import ( EXPORT_ONLY_RAW_DATA_ALLOWED, check_indicator_parameters, check_positive, + check_positive_float, check_positive_list, valid_date, ) @@ -1159,7 +1160,7 @@ class TechnicalAnalysisController(StockBaseController): "--std", action="store", dest="n_std", - type=check_positive, + type=check_positive_float, default=2, help="std", )