Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix --std argument in bbands command #4866

Merged
merged 9 commits into from
May 2, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,10 @@ def plot_bbands(self, fig: OpenBBFigure, df_ta: pd.DataFrame, inchart_index: int
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]) % 10 == 0:
bbands_text = bbands_text.split(".")[0]
fig.add_annotation(
xref="paper",
yref="paper",
Expand Down
2 changes: 1 addition & 1 deletion openbb_terminal/helper_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion openbb_terminal/stocks/technical_analysis/ta_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
EXPORT_ONLY_RAW_DATA_ALLOWED,
check_indicator_parameters,
check_positive,
check_positive_float,
check_positive_list,
valid_date,
)
Expand Down Expand Up @@ -1159,7 +1160,7 @@ def call_bbands(self, other_args: List[str]):
"--std",
action="store",
dest="n_std",
type=check_positive,
type=check_positive_float,
default=2,
help="std",
)
Expand Down