Fix --std argument in bbands command (#4866)

* Fix type check of std argument in bbands

* Fix std input handling

* Fix chart legend

* Fix linting

* Fix int display in legend

---------

Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
This commit is contained in:
northern-64bit
2023-05-02 03:29:25 +02:00
committed by GitHub
parent 6a4b7065e7
commit 7a194249cf
3 changed files with 6 additions and 6 deletions

View File

@@ -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",

View File

@@ -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(

View File

@@ -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",
)