mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-28 12:13:11 +00:00
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:
@@ -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",
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user