tradingview_screener.util

 1from __future__ import annotations
 2
 3
 4# see issue: https://github.com/shner-elmo/TradingView-Screener/issues/12
 5def format_technical_rating(rating: float) -> str:
 6    if rating >= 0.5:
 7        return 'Strong Buy'
 8    elif rating >= 0.1:
 9        return 'Buy'
10    elif rating >= -0.1:
11        return 'Neutral'
12    elif rating >= -0.5:
13        return 'Sell'
14    # elif x >= -0.1:
15    else:
16        return 'Strong Sell'
def format_technical_rating(rating: float) -> str:
 6def format_technical_rating(rating: float) -> str:
 7    if rating >= 0.5:
 8        return 'Strong Buy'
 9    elif rating >= 0.1:
10        return 'Buy'
11    elif rating >= -0.1:
12        return 'Neutral'
13    elif rating >= -0.5:
14        return 'Sell'
15    # elif x >= -0.1:
16    else:
17        return 'Strong Sell'