Skip to content

11.01.2021. Рефаторинг: разбиение на простые функции. Добавление вывода проверки по отдельным коэффициентам, рекомендаций аналитиков.#9

Open
balancy wants to merge 5 commits intomainfrom
11.01.2021

Conversation

@balancy
Copy link
Copy Markdown
Owner

@balancy balancy commented Jan 12, 2021

  1. Работа с фундаментальными показателями разбита на множество простых функций
  2. Создано описание всех проверок, используемых для диаграммы перспективности
  3. Обеспечен вывод проверок и рекомендаций аналитиков на странице Тикера
  4. Бот по команде отсылает диаграмму в чат. Реализация отправки нужной картинки пока не сделана

…from financial API and Finviz; Calculating perspective coefficients and plotting Spider Plot based on these coefficients. New DB table Fundamentals created. Organisation of saving/extracting fundamentals from and to DB.
…frontend: displaying checks and recommendations
@balancy balancy requested a review from morgangt January 12, 2021 15:41
Copy link
Copy Markdown
Collaborator

@morgangt morgangt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Очень много отличного кода!

Comment thread example.config.py
FINANCIAL_BASE_URL = "https://financialmodelingprep.com/api/v3/"

# finviz
FINVIZ_URL_BASE = "https://finviz.com/quote.ashx?t="
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В константе лучше хранить только url а get параметры лучше прописывать на момент отправки запроса, например в requests это так: requests.get(URL, params={"t": "AAPL"})

Comment on lines +52 to +62
value_descr = list()
value_descr.append(f"Is the discounted cash flow value ({dict_['dcf']}) less than 20% of the share price "
f"({dict_['price']})?")
value_descr.append(f"Is the discounted cash flow value ({dict_['dcf']}) less than 40% of the share price "
f"({dict_['price']})?")
value_descr.append(f"Is the P/E ratio ({dict_['pe_ratio']}) less than the market average ({dict_['pe_country']}) "
f"but still greater than 0?")
value_descr.append(f"Is the P/E ratio ({dict_['pe_ratio']}) less than the industry average ({dict_['pe_sector']}) "
f"but still greater than 0?")
value_descr.append(f"Is the PEG ratio ({dict_['peg_ratio']}) within a reasonable range (0 to 1)?")
value_descr.append(f"Is the P/B ratio ({dict_['pb_ratio']}) within a reasonable range (0 to 1)?")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

может стоит здесь просто декларативно описать список без команд append

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants