Files
OpenBB/bots/stocks/technical_analysis/recom.py
Colin Delahunty fae93c67ad Refactor Bot (#1326)
* First commit

* Renamed to bot

* change from discordbot to bots imports

* refractor cmds

+ autocomplete helpers
+ updated dps plots/candle
+ quote cmd

* isort fix

* Update helpers.py

* Added first refactor

* Added commands and refactor

* Added description handler

* Through grains

* ta + image border helper

* Added indices

* merged

* Finished econ

* options refactor

* dark_pool_shorts, candle, quote done

* pagination/dropdown logic to helpers + fixes

* dd/disc/insider done + add image logic to helpers

* linting

* removed plt style

* Almost done with Gov

* fixing conflicts

* Finished gov (excpect ones mentioned)

* screener done

* Test bug refactor

* Store changes to switch

* Finished refactor

* Fixed error

* Delete ::40

* Fixed issue

* Fixed black

* finished

* fixes

Co-authored-by: teh_coderer <me@tehcoderer.com>
Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
2022-02-20 10:36:59 -05:00

27 lines
773 B
Python

import bots.config_discordbot as cfg
from bots.config_discordbot import logger
from gamestonk_terminal.stocks.technical_analysis import tradingview_model
def recom_command(ticker=""):
"""Displays text of a given stocks recommendation based on ta [Tradingview API]"""
# Debug
if cfg.DEBUG:
logger.debug("ta-recom %s", ticker)
# Check for argument
if ticker == "":
raise Exception("Stock ticker is required")
recom = tradingview_model.get_tradingview_recommendation(ticker, "america", "", "")
recom = recom[["BUY", "NEUTRAL", "SELL", "RECOMMENDATION"]]
report = "```" + recom.to_string() + "```"
return {
"title": "Stocks: [Tradingview API] Recommendation based on TA",
"description": report,
}