Skip to main content

omega_ratio

Calculate the Omega Ratio.

The Omega Ratio is a sophisticated metric that goes beyond traditional performance measures by considering the probability of achieving returns above a given threshold. It offers a more nuanced view of risk and reward, focusing on the likelihood of success rather than just average outcomes.

Examples

from openbb import obb
# Get Omega Ratio.
stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp").to_df()
returns = stock_data["close"].pct_change().dropna()
obb.quantitative.performance.omega_ratio(data=returns, target="close")
obb.quantitative.performance.omega_ratio(target='close', data=[{'date': '2023-01-02', 'close': 0.05}, {'date': '2023-01-03', 'close': 0.08}, {'date': '2023-01-04', 'close': 0.07}, {'date': '2023-01-05', 'close': 0.06}, {'date': '2023-01-06', 'close': 0.06}])

Parameters

NameTypeDescriptionDefaultOptional
dataList[Data]Time series data.False
targetstrTarget column name.False
threshold_startfloat, optionalStart threshold, by default 0.0False
threshold_endfloat, optionalEnd threshold, by default 1.5False

Returns

OBBject
results : List[OmegaModel]
Omega ratios.