mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-31 14:31:20 +00:00
Discordbot Technical Analysis (#1089)
* fix bug with window size on discordbot * pylint and black fixes * black linter
This commit is contained in:
committed by
GitHub
parent
2d14890c41
commit
a0a22ee2cf
@@ -3,13 +3,13 @@ import discord
|
||||
from matplotlib import pyplot as plt
|
||||
import pandas as pd
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
from gamestonk_terminal.stocks.government import quiverquant_model
|
||||
from gamestonk_terminal.helper_funcs import plot_autoscale
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
|
||||
|
||||
async def contracts_command(ctx, ticker="", past_transaction_days="", raw=""):
|
||||
"""Displays contracts associated with tickers [quiverquant.com]"""
|
||||
|
||||
@@ -5,13 +5,13 @@ from matplotlib import pyplot as plt
|
||||
import matplotlib.dates as mdates
|
||||
import pandas as pd
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
from gamestonk_terminal.stocks.government import quiverquant_model
|
||||
from gamestonk_terminal.helper_funcs import plot_autoscale
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
|
||||
|
||||
async def gtrades_command(
|
||||
ctx, ticker="", gov_type="", past_transactions_months="", raw=""
|
||||
|
||||
@@ -3,13 +3,13 @@ import discord
|
||||
from matplotlib import pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
from gamestonk_terminal.stocks.government import quiverquant_model
|
||||
from gamestonk_terminal.helper_funcs import plot_autoscale
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
|
||||
|
||||
async def histcont_command(ctx, ticker=""):
|
||||
"""Displays historical quarterly-contracts [quiverquant.com]"""
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import discord
|
||||
import pandas as pd
|
||||
|
||||
from gamestonk_terminal.stocks.government import quiverquant_model
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.helpers import pagination
|
||||
|
||||
from gamestonk_terminal.stocks.government import quiverquant_model
|
||||
|
||||
|
||||
async def lastcontracts_command(ctx, past_transactions_days="", num=""):
|
||||
"""Displays last government contracts [quiverquant.com]"""
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import discord
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.helpers import pagination
|
||||
|
||||
from gamestonk_terminal.stocks.government import quiverquant_model
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.helpers import pagination
|
||||
|
||||
|
||||
async def lasttrades_command(
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import discord
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.helpers import pagination
|
||||
|
||||
from gamestonk_terminal.stocks.government import quiverquant_model
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.helpers import pagination
|
||||
|
||||
|
||||
async def lobbying_command(ctx, ticker="", num=""):
|
||||
|
||||
@@ -3,13 +3,13 @@ import discord
|
||||
from matplotlib import pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
from gamestonk_terminal.stocks.government import quiverquant_model
|
||||
from gamestonk_terminal.helper_funcs import plot_autoscale
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
|
||||
|
||||
async def qtrcontracts_command(ctx, num="", analysis=""):
|
||||
"""Displays a look at government contracts [quiverquant.com]"""
|
||||
|
||||
@@ -4,13 +4,13 @@ import discord
|
||||
from matplotlib import pyplot as plt
|
||||
import pandas as pd
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
from gamestonk_terminal.stocks.government import quiverquant_model
|
||||
from gamestonk_terminal.helper_funcs import plot_autoscale
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
|
||||
|
||||
async def topbuys_command(
|
||||
ctx, gov_type="", past_transactions_months="", num="", raw=""
|
||||
|
||||
@@ -3,13 +3,13 @@ import discord
|
||||
from matplotlib import pyplot as plt
|
||||
import pandas as pd
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
from gamestonk_terminal.stocks.government import quiverquant_model
|
||||
from gamestonk_terminal.helper_funcs import plot_autoscale
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
|
||||
|
||||
async def toplobbying_command(ctx, num="", raw=""):
|
||||
"""Displays top lobbying firms [quiverquant.com]"""
|
||||
|
||||
@@ -4,13 +4,13 @@ import discord
|
||||
from matplotlib import pyplot as plt
|
||||
import pandas as pd
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
from gamestonk_terminal.stocks.government import quiverquant_model
|
||||
from gamestonk_terminal.helper_funcs import plot_autoscale
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
|
||||
|
||||
async def topsells_command(
|
||||
ctx, gov_type="", past_transactions_months="", num="", raw=""
|
||||
|
||||
@@ -3,14 +3,14 @@ from datetime import datetime, timedelta
|
||||
import discord
|
||||
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.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import volume_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def ad_command(ctx, ticker="", is_open="False", start="", end=""):
|
||||
"""Displays chart with accumulation/distribution line [Yahoo Finance]"""
|
||||
|
||||
@@ -3,14 +3,14 @@ from datetime import datetime, timedelta
|
||||
import discord
|
||||
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.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import volume_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def adosc_command(
|
||||
ctx, ticker="", is_open="False", fast="3", slow="10", start="", end=""
|
||||
|
||||
@@ -3,14 +3,14 @@ from datetime import datetime, timedelta
|
||||
import discord
|
||||
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.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import trend_indicators_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def adx_command(
|
||||
ctx, ticker="", length="14", scalar="100", drift="1", start="", end=""
|
||||
|
||||
@@ -3,14 +3,14 @@ from datetime import datetime, timedelta
|
||||
import discord
|
||||
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.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import trend_indicators_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def aroon_command(ctx, ticker="", length="25", scalar="100", start="", end=""):
|
||||
"""Displays chart with aroon indicator [Yahoo Finance]"""
|
||||
|
||||
@@ -3,14 +3,14 @@ from datetime import datetime, timedelta
|
||||
import discord
|
||||
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.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import volatility_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def bbands_command(
|
||||
ctx, ticker="", length="5", n_std="2", mamode="sma", start="", end=""
|
||||
|
||||
@@ -3,14 +3,14 @@ from datetime import datetime, timedelta
|
||||
import discord
|
||||
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.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import momentum_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def cci_command(ctx, ticker="", length="14", scalar="0.015", start="", end=""):
|
||||
"""Displays chart with commodity channel index [Yahoo Finance]"""
|
||||
|
||||
@@ -4,14 +4,14 @@ import discord
|
||||
from matplotlib import pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
from gamestonk_terminal.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import momentum_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def cg_command(ctx, ticker="", length="14", start="", end=""):
|
||||
"""Displays chart with centre of gravity [Yahoo Finance]"""
|
||||
|
||||
@@ -3,14 +3,14 @@ from datetime import datetime, timedelta
|
||||
import discord
|
||||
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.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import volatility_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def donchian_command(
|
||||
ctx, ticker="", upper_length="25", lower_length="100", start="", end=""
|
||||
|
||||
@@ -4,14 +4,14 @@ import discord
|
||||
from matplotlib import pyplot as plt
|
||||
import pandas as pd
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
from gamestonk_terminal.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import overlap_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def ema_command(ctx, ticker="", window="", offset="", start="", end=""):
|
||||
"""Displays chart with exponential moving average [Yahoo Finance]"""
|
||||
@@ -40,15 +40,12 @@ async def ema_command(ctx, ticker="", window="", offset="", start="", end=""):
|
||||
if window == "":
|
||||
window = [20, 50]
|
||||
else:
|
||||
window_temp = []
|
||||
i = 0
|
||||
b = 0
|
||||
while i < len(window):
|
||||
if window[i] == ",":
|
||||
window_temp.append(float(window[b:i]))
|
||||
l_legend.append(float(window[b:i]))
|
||||
b = i
|
||||
i += 1
|
||||
window_temp = list()
|
||||
for wind in window.split(","):
|
||||
try:
|
||||
window_temp.append(float(wind))
|
||||
except Exception as e:
|
||||
raise Exception("Window needs to be a float") from e
|
||||
window = window_temp
|
||||
|
||||
if offset == "":
|
||||
|
||||
@@ -3,14 +3,14 @@ from datetime import datetime, timedelta
|
||||
import discord
|
||||
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.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import custom_indicators_model
|
||||
from gamestonk_terminal import config_plot as cfp
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def fib_command(ctx, ticker="", start="", end=""):
|
||||
"""Displays chart with fibonacci retracement [Yahoo Finance]"""
|
||||
|
||||
@@ -3,14 +3,14 @@ from datetime import datetime, timedelta
|
||||
import discord
|
||||
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.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import momentum_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def fisher_command(ctx, ticker="", length="14", start="", end=""):
|
||||
"""Displays chart with fisher transformation [Yahoo Finance]"""
|
||||
|
||||
@@ -4,14 +4,14 @@ import discord
|
||||
from matplotlib import pyplot as plt
|
||||
import pandas as pd
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
from gamestonk_terminal.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import overlap_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def hma_command(ctx, ticker="", window="", offset="", start="", end=""):
|
||||
"""Displays chart with hull moving average [Yahoo Finance]"""
|
||||
@@ -40,15 +40,12 @@ async def hma_command(ctx, ticker="", window="", offset="", start="", end=""):
|
||||
if window == "":
|
||||
window = [20, 50]
|
||||
else:
|
||||
window_temp = []
|
||||
i = 0
|
||||
b = 0
|
||||
while i < len(window):
|
||||
if window[i] == ",":
|
||||
window_temp.append(float(window[b:i]))
|
||||
l_legend.append(float(window[b:i]))
|
||||
b = i
|
||||
i += 1
|
||||
window_temp = list()
|
||||
for wind in window.split(","):
|
||||
try:
|
||||
window_temp.append(float(wind))
|
||||
except Exception as e:
|
||||
raise Exception("Window needs to be a float") from e
|
||||
window = window_temp
|
||||
|
||||
if offset == "":
|
||||
|
||||
@@ -3,14 +3,14 @@ from datetime import datetime, timedelta
|
||||
import discord
|
||||
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.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import volatility_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def kc_command(
|
||||
ctx, ticker="", length="20", scalar="2", mamode="sma", offset="0", start="", end=""
|
||||
|
||||
@@ -3,14 +3,14 @@ from datetime import datetime, timedelta
|
||||
import discord
|
||||
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.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import momentum_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def macd_command(
|
||||
ctx, ticker="", fast="12", slow="26", signal="9", start="", end=""
|
||||
|
||||
@@ -3,14 +3,14 @@ from datetime import datetime, timedelta
|
||||
import discord
|
||||
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.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import volume_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def obv_command(ctx, ticker="", start="", end=""):
|
||||
"""Displays chart with on balance volume [Yahoo Finance]"""
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import discord
|
||||
import discordbot.config_discordbot as cfg
|
||||
|
||||
from gamestonk_terminal.stocks.technical_analysis import tradingview_model
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
|
||||
|
||||
async def recom_command(ctx, ticker=""):
|
||||
"""Displays text of a given stocks recommendation based on ta [Tradingview API]"""
|
||||
|
||||
@@ -3,14 +3,14 @@ from datetime import datetime, timedelta
|
||||
import discord
|
||||
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.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import momentum_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def rsi_command(
|
||||
ctx, ticker="", length="14", scalar="100", drift="1", start="", end=""
|
||||
|
||||
@@ -4,14 +4,14 @@ import discord
|
||||
from matplotlib import pyplot as plt
|
||||
import pandas as pd
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
from gamestonk_terminal.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import overlap_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def sma_command(ctx, ticker="", window="", offset="", start="", end=""):
|
||||
"""Displays chart with simple moving average [Yahoo Finance]"""
|
||||
@@ -40,15 +40,12 @@ async def sma_command(ctx, ticker="", window="", offset="", start="", end=""):
|
||||
if window == "":
|
||||
window = [20, 50]
|
||||
else:
|
||||
window_temp = []
|
||||
i = 0
|
||||
b = 0
|
||||
while i < len(window):
|
||||
if window[i] == ",":
|
||||
window_temp.append(float(window[b:i]))
|
||||
l_legend.append(float(window[b:i]))
|
||||
b = i
|
||||
i += 1
|
||||
window_temp = list()
|
||||
for wind in window.split(","):
|
||||
try:
|
||||
window_temp.append(float(wind))
|
||||
except Exception as e:
|
||||
raise Exception("Window needs to be a float") from e
|
||||
window = window_temp
|
||||
|
||||
if offset == "":
|
||||
|
||||
@@ -3,14 +3,14 @@ from datetime import datetime, timedelta
|
||||
import discord
|
||||
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.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import momentum_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def stoch_command(
|
||||
ctx, ticker="", fast_k="14", slow_d="3", slow_k="3", start="", end=""
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import discord
|
||||
import discordbot.config_discordbot as cfg
|
||||
|
||||
from gamestonk_terminal.stocks.technical_analysis import finbrain_model
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
|
||||
|
||||
async def summary_command(ctx, ticker=""):
|
||||
"""Displays text of a given stocks ta summary [FinBrain API]"""
|
||||
|
||||
@@ -4,14 +4,13 @@ import discord
|
||||
import matplotlib.pyplot as plt
|
||||
from PIL import Image
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
|
||||
from gamestonk_terminal.helper_funcs import plot_autoscale
|
||||
|
||||
from gamestonk_terminal.stocks.technical_analysis import finviz_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
|
||||
|
||||
async def view_command(ctx, ticker=""):
|
||||
"""Displays image from Finviz [Finviz]"""
|
||||
|
||||
@@ -4,14 +4,14 @@ import discord
|
||||
from matplotlib import pyplot as plt
|
||||
import pandas as pd
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
from gamestonk_terminal.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import overlap_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def wma_command(ctx, ticker="", window="", offset="", start="", end=""):
|
||||
"""Displays chart with weighted moving average [Yahoo Finance]"""
|
||||
@@ -40,15 +40,12 @@ async def wma_command(ctx, ticker="", window="", offset="", start="", end=""):
|
||||
if window == "":
|
||||
window = [20, 50]
|
||||
else:
|
||||
window_temp = []
|
||||
i = 0
|
||||
b = 0
|
||||
while i < len(window):
|
||||
if window[i] == ",":
|
||||
window_temp.append(float(window[b:i]))
|
||||
l_legend.append(float(window[b:i]))
|
||||
b = i
|
||||
i += 1
|
||||
window_temp = list()
|
||||
for wind in window.split(","):
|
||||
try:
|
||||
window_temp.append(float(wind))
|
||||
except Exception as e:
|
||||
raise Exception("Window needs to be a float") from e
|
||||
window = window_temp
|
||||
|
||||
if offset == "":
|
||||
|
||||
@@ -4,14 +4,14 @@ import discord
|
||||
from matplotlib import pyplot as plt
|
||||
import pandas as pd
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
from gamestonk_terminal.helper_funcs import plot_autoscale
|
||||
from gamestonk_terminal.common.technical_analysis import overlap_model
|
||||
from gamestonk_terminal.config_plot import PLOT_DPI
|
||||
|
||||
import discordbot.config_discordbot as cfg
|
||||
from discordbot.run_discordbot import gst_imgur
|
||||
import discordbot.helpers
|
||||
|
||||
|
||||
async def zlma_command(ctx, ticker="", window="", offset="", start="", end=""):
|
||||
"""Displays chart with zero lag moving average [Yahoo Finance]"""
|
||||
@@ -40,15 +40,12 @@ async def zlma_command(ctx, ticker="", window="", offset="", start="", end=""):
|
||||
if window == "":
|
||||
window = [20]
|
||||
else:
|
||||
window_temp = []
|
||||
i = 0
|
||||
b = 0
|
||||
while i < len(window):
|
||||
if window[i] == ",":
|
||||
window_temp.append(float(window[b:i]))
|
||||
l_legend.append(float(window[b:i]))
|
||||
b = i
|
||||
i += 1
|
||||
window_temp = list()
|
||||
for wind in window.split(","):
|
||||
try:
|
||||
window_temp.append(float(wind))
|
||||
except Exception as e:
|
||||
raise Exception("Window needs to be a float") from e
|
||||
window = window_temp
|
||||
|
||||
if offset == "":
|
||||
|
||||
Reference in New Issue
Block a user