Metric: Beta¶
Overview¶
Beta is a measure of volatility, or systematic risk, of a security or portfolio in comparison to the market as a whole [Capture from BYU Lib1].
Methodolgy¶
The progress to calculate metric:
flowchart LR
crit[Criteria for eligible basket] -- construct --> eligible[Eligible Basket]
eligible --> mapping[Mapping relative metadata] -- calculate --> raw[Raw Beta] -- exclude outlier --> represented_beta[Represented Beta]
included: Relative metadata is mapping with relative underlying market data based on the trading platform
Component¶
Eligible Criteria¶
Criteria required for eligible basket:
-
[1] Financial Instrument Type: Common Stock, Fund Certificate, Future, covered warrant, ETF
-
[2] Exist information of the exchange
-
[3] Available range: greater than 20 trading days
Note: There are different criterias selected by provider (See Troubleshooting).
The table of eligible will be:
Column | Type | Description |
---|---|---|
ticker | string[Restricted] | Primary Key. The symbol of security |
financial_instrument_type | string[Category] | Asset class |
trading_status | string[Category] | Trading Status of security. One of [ACTIVE, INACTIVE] |
exchange_code | string[Category] | The exchange that the |
underlying_relative_index | string[Category] | The relative index code for the security |
available_range | string[YYYYMMDD-YYYYMMDD] | From - Date in YYYYMMDD format |
number_trading_day | int | The total trading day |
is_eligible | boolean | The status of eligible. True mean satify all criterias |
last_updated_at | timestamp | Timestamp of last eligible process has been take place |
Relative metadata¶
The mapping progress to detect the relative information required to calculate
a) The target relative index
Market | Relative Index Code |
---|---|
HSX | VNINDEX |
HNX | HNX |
UPCOM | UPCOM |
The index required following the index profile handle by INNO
b) The range of calculation: 6 months. The lower range the more volatility
c) The date type: Trading Date.
Calculation Method¶
Following the algorithm below:
included:
-
return
(denoted by \(R\)): \(R={({\frac {P_{1}} {P_{t}} - 1}) * 100 }\) -
i
: represented for security -
m
: represented for market
The covariance calculated following the wikipedia2
Represented beta¶
After calculated the raw-beta from the information, the following filter will be applied to exclude the outlier
Market | Outlier |
---|---|
Common Stock | range [-3, 3] |
Fund Certificate | range [-3, 3] |
Future | range [-3, 3] |
covered warrant | range [-3, 3] |
ETF | range [-3, 3] |
Rounding: to 5 after comma.
Finding beta of security¶
Get the beta from Pluto
Or can get the metadata within an array by using awk
and jq
to get:
declare ticker=("VCB" "HPG" "NT2")
for tick in ${ticker[@]};
do
curl -sX 'GET' \
"https://dapi.innotech.vn/profile/?symbol=$tick&offset=0&limit=10" \
-H 'accept: application/json' | jq '.data[0].beta' | echo "$tick --> beta:$(awk '{print $1}')"
done;
# VCB --> beta:0.82731
# HPG --> beta:1.62381
# NT2 --> beta:0.72777
Troubleshooting¶
Question
When evaluating the different options for finding beta, you may be wondering: Which one is right?
It depends on the declaration of calculation method, which different between providers (E.g: VietStock or CafeF). If different by the eligible criteria and the filter the outlier.
Kind | Vietstock | CafeF |
---|---|---|
Methodology | Non exist | Methodology listed in the website Beta |
Different | Non exist | Period Calculate (Relative 100 trading day) Type of Date (trading day) |
Detail | Non exist | Divide into 3 category by trading day (denoted by TD) [1] If TD < 30: beta = NULL [2] 30 <= TD < 100: beta in active date [3] TD > 100: beta (100) Trading Day |
The different: Timerange, Relative Index, Calculation Method
Question
How to calculate the step-by-step beta method from the guidance
Following the instruction of Wallstreet Mojo at [tutorial]2
Question
Is the underlying of index is the same in the life cycle of the securities
Based on the action of the corporate, the companies has a lot of action affect the choosen relative index.
-
Delisted
-
Transfer between trading platform
Question
The problem of long-distance of OHLCV
The problem has been declare below:
The securities has a trading OHLCV in a long-distance between the trading.
flowchart LR
1[1] -- 15D --> 2[2] -- 5D --> 3[3] -- 3D --> 4[4]
It's different with a normal
case
flowchart LR
1[1] -- 1D --> 2[2] -- 1D --> 3[3] -- 1D --> 4[4]
Currently, not control this
Question
The beta range calculation
This will calculate the beta range since the last-trading day of the market
Question
Do we need to exclude non-trading ticker (inactive)
/_ We can excluded output by select Active/Non-active case _/