Skip to content

Commit

Permalink
put ticker on clenow func (#2709)
Browse files Browse the repository at this point in the history
Co-authored-by: James Maslek <jmaslek11@gmail.com>
  • Loading branch information
DidierRLopes and jmaslek authored Oct 5, 2022
1 parent d0c5c8e commit 4e6a2fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions openbb_terminal/common/technical_analysis/momentum_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ def display_cg(
@log_start_end(log=logger)
def display_clenow_momentum(
data: pd.Series,
symbol: str = "",
window: int = 90,
export: str = "",
external_axes: Optional[List[plt.Axes]] = None,
Expand All @@ -554,6 +555,8 @@ def display_clenow_momentum(
----------
data : pd.Series
Series of values
symbol : str
Symbol that the data corresponds to
window : int
Length of window
export : str
Expand All @@ -579,7 +582,7 @@ def display_clenow_momentum(
df,
show_index=True,
headers=[""],
title="Clenow Exponential Regression Factor",
title=f"Clenow Exponential Regression Factor on {symbol}",
show_header=False,
)

Expand All @@ -595,7 +598,7 @@ def display_clenow_momentum(
ax1.plot(data.index, np.log(data.values))
ax1.plot(data.index[-window:], fit_data, linewidth=2)

ax1.set_title("Clenow Momentum Exponential Regression")
ax1.set_title(f"Clenow Momentum Exponential Regression on {symbol}")
ax1.set_xlim(data.index[0], data.index[-1])
ax1.set_ylabel("Log Price")
theme.style_primary_axis(
Expand Down
1 change: 0 additions & 1 deletion openbb_terminal/helper_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ def print_rich_table(
table.add_row(*row)
console.print()
console.print(table)
console.print()
else:
console.print(df.to_string(col_space=0))

Expand Down
5 changes: 4 additions & 1 deletion openbb_terminal/stocks/technical_analysis/ta_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1415,5 +1415,8 @@ def call_clenow(self, other_args: List[str]):
)
if ns_parser:
momentum_view.display_clenow_momentum(
self.stock["Adj Close"], ns_parser.period, ns_parser.export
self.stock["Adj Close"],
self.ticker.upper(),
ns_parser.period,
ns_parser.export,
)

0 comments on commit 4e6a2fb

Please sign in to comment.