mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-18 18:48:05 +00:00
Auto stash before merge of "main" and "origin/main"
This commit is contained in:
+18
-7
@@ -51,23 +51,34 @@ public class EventingTests
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Generate 200 random values and feed them to both direct and event-based indicators
|
// Generate 200 random values and feed them to both direct and event-based indicators
|
||||||
for (int i = 0; i< 200; i++)
|
for (int i = 0; i < 200; i++)
|
||||||
{
|
{
|
||||||
double randomValue = GetRandomDouble(rng) * 100;
|
double randomValue = GetRandomDouble(rng) * 100;
|
||||||
|
<<<<<<< HEAD
|
||||||
input.Add(randomValue);
|
input.Add(randomValue);
|
||||||
|
=======
|
||||||
|
input.Add(randomValue);
|
||||||
|
>>>>>>> dev
|
||||||
|
|
||||||
// Calculate direct indicators
|
// Calculate direct indicators
|
||||||
foreach (var (direct, _) in indicators)
|
foreach (var (direct, _) in indicators)
|
||||||
{
|
{
|
||||||
direct.Calc(randomValue);
|
direct.Calc(randomValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compare the results of direct and event-based calculations
|
// Compare the results of direct and event-based calculations
|
||||||
foreach (var (direct, eventBased) in indicators)
|
foreach (var (direct, eventBased) in indicators)
|
||||||
{
|
{
|
||||||
Assert.Equal(direct.Value, eventBased.Value, 9);
|
Assert.Equal(direct.Value, eventBased.Value, 9);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static double GetRandomDouble(RandomNumberGenerator rng)
|
||||||
|
{
|
||||||
|
byte[] bytes = new byte[8];
|
||||||
|
rng.GetBytes(bytes);
|
||||||
|
return (double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static double GetRandomDouble(RandomNumberGenerator rng)
|
private static double GetRandomDouble(RandomNumberGenerator rng)
|
||||||
|
|||||||
+24
-24
@@ -1,28 +1,28 @@
|
|||||||
Single Value Input (Typically Closing Prices)
|
# Volatility Measures
|
||||||
|
|
||||||
Jurik Volatility (Volty)
|
## Single Value Input (Typically Closing Prices)
|
||||||
|
|
||||||
**Standard Deviation**
|
- Jurik Volatility (Volty)
|
||||||
**Relative Volatility Index (RVI)**
|
- **Standard Deviation**
|
||||||
Ulcer Index
|
- **Relative Volatility Index (RVI)**
|
||||||
ARCH/GARCH Models
|
- Ulcer Index
|
||||||
Exponential Weighted Moving Average (EWMA) Volatility
|
- ARCH/GARCH Models
|
||||||
Conditional Volatility
|
- Exponential Weighted Moving Average (EWMA) Volatility
|
||||||
Volatility Ratio
|
- Conditional Volatility
|
||||||
Close-to-Close Volatility
|
- Volatility Ratio
|
||||||
Volatility of Volatility (VOV)
|
- Close-to-Close Volatility
|
||||||
Volatility Cone
|
- Volatility of Volatility (VOV)
|
||||||
Bollinger Bands
|
- Volatility Cone
|
||||||
Stochastic Volatility: Typically modeled using closing prices, but can incorporate other price information
|
- Bollinger Bands
|
||||||
|
- Stochastic Volatility: Typically modeled using closing prices, but can incorporate other price information
|
||||||
|
|
||||||
OHLC Input (Open, High, Low, Close)
|
## OHLC Input (Open, High, Low, Close)
|
||||||
|
|
||||||
Garman-Klass Volatility
|
|
||||||
Rogers-Satchell Volatility
|
|
||||||
Yang-Zhang Volatility
|
|
||||||
Parkinson Volatility (High, Low)
|
|
||||||
Average True Range (ATR) (High, Low, Close)
|
|
||||||
Chaikin Volatility (High, Low)
|
|
||||||
Keltner Channels (typically Close, High, Low)
|
|
||||||
High-Low Volatility (High, Low)
|
|
||||||
|
|
||||||
|
- Garman-Klass Volatility
|
||||||
|
- Rogers-Satchell Volatility
|
||||||
|
- Yang-Zhang Volatility
|
||||||
|
- Parkinson Volatility (High, Low)
|
||||||
|
- Average True Range (ATR) (High, Low, Close)
|
||||||
|
- Chaikin Volatility (High, Low)
|
||||||
|
- Keltner Channels (typically Close, High, Low)
|
||||||
|
- High-Low Volatility (High, Low)
|
||||||
|
|||||||
Reference in New Issue
Block a user