mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-19 02:58:05 +00:00
Merge branch 'dev'
This commit is contained in:
@@ -13,9 +13,7 @@
|
||||
| **PineScript** | [beta.pine](beta.pine) |
|
||||
|
||||
- Beta measures the volatility of an asset in relation to the overall market.
|
||||
- Parameterized by `period`.
|
||||
- Output range: Varies (see docs).
|
||||
- Requires `period + 1` bars of warmup before first valid output (IsHot = true).
|
||||
- **Similar:** [Correlation](../correlation/Correlation.md), [Covariance](../covariance/Covariance.md) | **Trading note:** Beta coefficient; measures systematic risk vs benchmark. β>1 = amplifies market moves.
|
||||
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
|
||||
|
||||
Beta measures the volatility of an asset in relation to the overall market. It's the slope of the regression line between the asset's returns and the market's returns. A beta of 1.0 means the asset moves in lockstep with the market. A beta of 2.0 means the asset is twice as volatile as the market.
|
||||
@@ -109,4 +107,4 @@ var beta = new Beta(20);
|
||||
// (e.g., AAPL price and SPY price)
|
||||
TValue result = beta.Update(assetPrice, marketPrice);
|
||||
|
||||
Console.WriteLine($"Beta: {result.Value:F4}");
|
||||
Console.WriteLine($"Beta: {result.Value:F4}");
|
||||
Reference in New Issue
Block a user