Tiny tiny fixes (#1101)

* fixes

* fixes found on discordbot
This commit is contained in:
Didier Rodrigues Lopes
2021-12-26 22:31:34 +00:00
committed by GitHub
parent c914740f48
commit 11d89b7928
4 changed files with 17 additions and 11 deletions

View File

@@ -7,7 +7,7 @@ import yfinance as yf
import discordbot.config_discordbot as cfg
import discordbot.helpers
from discordbot.run_discordbot import gst_imgur
from gamestonk_terminal.config_plot import PLOT_DPI
from gamestonk_terminal.stocks.dark_pool_shorts import sec_model
@@ -47,6 +47,7 @@ async def ftd_command(ctx, ticker="", start="", end=""):
if cfg.DEBUG:
print(ftds_data.to_string())
plt.figure(dpi=PLOT_DPI)
# Output data
plt.bar(
ftds_data["SETTLEMENT DATE"],

View File

@@ -6,6 +6,7 @@ from matplotlib import pyplot as plt
import discordbot.config_discordbot as cfg
from discordbot.run_discordbot import gst_imgur
import discordbot.helpers
from gamestonk_terminal.config_plot import PLOT_DPI
from gamestonk_terminal.stocks.due_diligence import business_insider_model
@@ -14,7 +15,6 @@ async def pt_command(ctx, ticker="", raw="", start=""):
"""Displays price targets [Business Insider]"""
try:
# Debug
if cfg.DEBUG:
print(f"!stocks.dd.pt {ticker}")
@@ -58,6 +58,7 @@ async def pt_command(ctx, ticker="", raw="", start=""):
)
ctx.send(embed=embed)
else:
plt.figure(dpi=PLOT_DPI)
if start:
df_analyst_data = df_analyst_data[start:]
@@ -76,7 +77,7 @@ async def pt_command(ctx, ticker="", raw="", start=""):
plt.xlabel("Time")
plt.ylabel("Share Price")
plt.grid(b=True, which="major", color="#666666", linestyle="-")
plt.gcf().autofmt_xdate()
plt.savefig("ta_pt.png")
uploaded_image = gst_imgur.upload_image("ta_pt.png", title="something")
image_link = uploaded_image.link

View File

@@ -10,6 +10,8 @@ from gamestonk_terminal.stocks.due_diligence import business_insider_model
from gamestonk_terminal.helper_funcs import (
export_data,
)
from gamestonk_terminal.config_plot import PLOT_DPI
from gamestonk_terminal.helper_funcs import plot_autoscale
from gamestonk_terminal import feature_flags as gtff
register_matplotlib_converters()
@@ -62,6 +64,8 @@ def price_target_from_analysts(
print(df_analyst_data.head(num).to_string())
else:
plt.subplots(figsize=plot_autoscale(), dpi=PLOT_DPI)
# Slice start of ratings
if start:
df_analyst_data = df_analyst_data[start:] # type: ignore

View File

@@ -579,8 +579,8 @@ Stocks Menus:
self.interval,
self.queue,
)
print("Use 'load <ticker>' prior to this command!", "\n")
else:
print("Use 'load <ticker>' prior to this command!", "\n")
def call_dd(self, _):
"""Process dd command"""
@@ -590,8 +590,8 @@ Stocks Menus:
self.queue = dd_controller.menu(
self.ticker, self.start, self.interval, self.stock, self.queue
)
print("Use 'load <ticker>' prior to this command!", "\n")
else:
print("Use 'load <ticker>' prior to this command!", "\n")
def call_ca(self, _):
"""Process ca command"""
@@ -610,8 +610,8 @@ Stocks Menus:
self.queue = fa_controller.menu(
self.ticker, self.start, self.interval, self.suffix, self.queue
)
print("Use 'load <ticker>' prior to this command!", "\n")
else:
print("Use 'load <ticker>' prior to this command!", "\n")
def call_bt(self, _):
"""Process bt command"""
@@ -619,8 +619,8 @@ Stocks Menus:
from gamestonk_terminal.stocks.backtesting import bt_controller
self.queue = bt_controller.menu(self.ticker, self.stock, self.queue)
print("Use 'load <ticker>' prior to this command!", "\n")
else:
print("Use 'load <ticker>' prior to this command!", "\n")
def call_ta(self, _):
"""Process ta command"""