mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-20 11:38:05 +00:00
[CodeFactor] Apply fixes to commit 0606491
This commit is contained in:
@@ -59,7 +59,7 @@ public class CcvIndicatorTests
|
||||
var now = DateTime.UtcNow;
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
double basePrice = 100 + i * 2 + (i % 2 == 0 ? 5 : -5); // Add some volatility
|
||||
double basePrice = 100 + (i * 2) + (i % 2 == 0 ? 5 : -5); // Add some volatility
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), basePrice, basePrice + 5, basePrice - 5, basePrice + 2, 1000);
|
||||
|
||||
// Process update for each bar to simulate history loading
|
||||
|
||||
@@ -341,7 +341,7 @@ public class CcvTests
|
||||
// Stable prices (small changes)
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
ccvStable.Update(new TValue(DateTime.UtcNow.AddMinutes(i), 100 + i * 0.01));
|
||||
ccvStable.Update(new TValue(DateTime.UtcNow.AddMinutes(i), 100 + (i * 0.01)));
|
||||
}
|
||||
|
||||
// Volatile prices (alternating)
|
||||
|
||||
@@ -160,7 +160,7 @@ public class CcvValidationTests
|
||||
double priceLow = 100.0;
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
priceLow *= (1 + 0.001 * (i % 2 == 0 ? 1 : -1)); // ±0.1%
|
||||
priceLow *= (1 + (0.001 * (i % 2 == 0 ? 1 : -1))); // ±0.1%
|
||||
ccvLow.Update(new TValue(DateTime.UtcNow.AddMinutes(i), priceLow));
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ public class CcvValidationTests
|
||||
double priceHigh = 100.0;
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
priceHigh *= (1 + 0.05 * (i % 2 == 0 ? 1 : -1)); // ±5%
|
||||
priceHigh *= (1 + (0.05 * (i % 2 == 0 ? 1 : -1))); // ±5%
|
||||
ccvHigh.Update(new TValue(DateTime.UtcNow.AddMinutes(i), priceHigh));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user