Revert twitter_api.py and use _ = axPrice.twinx()

This commit is contained in:
Christian Clauss
2021-03-06 11:39:49 +01:00
parent 9fcfe1bdca
commit 5af911ae40
3 changed files with 8 additions and 14 deletions

View File

@@ -163,10 +163,10 @@ def inference(l_args, s_ticker):
if df_tweets["sentiment_estimation"].values[-1] > 0:
n_pos = df_tweets[df_tweets["prob_sen"] > 0]["prob_sen"].sum()
# pylint: disable=unused-variable
n_pct = round(100 * n_pos / df_tweets["probability"].sum()) # noqa: F841
n_pct = round(100 * n_pos / df_tweets["probability"].sum())
else:
n_neg = abs(df_tweets[df_tweets["prob_sen"] < 0]["prob_sen"].sum())
n_pct = round(100 * n_neg / df_tweets["probability"].sum()) # noqa: F841
n_pct = round(100 * n_neg / df_tweets["probability"].sum())
# Parse tweets
dt_from = dateutil.parser.parse(df_tweets["created_at"].values[-1])

View File

@@ -214,8 +214,7 @@ def vwap(l_args, s_ticker, s_interval, df_stock):
plt.xlabel("Time")
plt.ylabel("Share Price ($)")
plt.legend([s_ticker, "VWAP"])
# pylint: disable=unused-variable
axVolume = axPrice.twinx() # noqa: F841
_ = axPrice.twinx()
plt.bar(
df_stock.index,
df_stock["6. volume"].values,
@@ -248,8 +247,7 @@ def vwap(l_args, s_ticker, s_interval, df_stock):
plt.xlabel("Time")
plt.ylabel("Share Price ($)")
plt.legend([s_ticker, "VWAP"])
# pylint: disable=unused-variable
axVolume = axPrice.twinx() # noqa: F841
_ = axPrice.twinx()
plt.bar(
df_stock.index,
df_stock["5. volume"].values,

View File

@@ -78,8 +78,7 @@ def ad(l_args, s_ticker, s_interval, df_stock):
plt.grid(b=True, which="major", color="#666666", linestyle="-")
plt.minorticks_on()
plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2)
# pylint: disable=unused-variable
axVolume = axPrice.twinx() # noqa: F841
_ = axPrice.twinx()
plt.bar(
df_stock.index,
df_stock["6. volume"].values,
@@ -128,8 +127,7 @@ def ad(l_args, s_ticker, s_interval, df_stock):
plt.grid(b=True, which="major", color="#666666", linestyle="-")
plt.minorticks_on()
plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2)
# pylint: disable=unused-variable
axVolume = axPrice.twinx() # noqa: F841
_ = axPrice.twinx()
plt.bar(
df_stock.index,
df_stock["5. volume"].values,
@@ -203,8 +201,7 @@ def obv(l_args, s_ticker, s_interval, df_stock):
plt.grid(b=True, which="major", color="#666666", linestyle="-")
plt.minorticks_on()
plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2)
# pylint: disable=unused-variable
axVolume = axPrice.twinx() # noqa: F841
_ = axPrice.twinx()
plt.bar(
df_stock.index,
df_stock["6. volume"].values,
@@ -238,8 +235,7 @@ def obv(l_args, s_ticker, s_interval, df_stock):
plt.grid(b=True, which="major", color="#666666", linestyle="-")
plt.minorticks_on()
plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2)
# pylint: disable=unused-variable
axVolume = axPrice.twinx() # noqa: F841
_ = axPrice.twinx()
plt.bar(
df_stock.index,
df_stock["5. volume"].values,