mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-26 06:18:05 +00:00
[CodeFactor] Apply fixes to commit 0606491
This commit is contained in:
@@ -155,7 +155,7 @@ public class AdxvmaIndicatorTests
|
||||
var now = DateTime.UtcNow;
|
||||
for (int i = 0; i < 200; i++)
|
||||
{
|
||||
double price = 100 + (i * 0.1) + Math.Sin(i * 0.1) * 2;
|
||||
double price = 100 + (i * 0.1) + (Math.Sin(i * 0.1) * 2);
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), price, price + 2, price - 2, price);
|
||||
indicator.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ public class AdxvmaTests
|
||||
// Feed strong uptrend bars (large +DM consistently)
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
double price = 100 + i * 2;
|
||||
double price = 100 + (i * 2);
|
||||
var bar = new TBar(time.AddMinutes(i), price, price + 1, price - 0.5, price + 0.5, 1000);
|
||||
adxvma.Update(bar, isNew: true);
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ public class AdxvmaValidationTests
|
||||
// Strong uptrend: each bar H > prev H, L > prev L, consistent +DM
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
double basePrice = 100 + i * 1.5;
|
||||
double basePrice = 100 + (i * 1.5);
|
||||
var bar = new TBar(time.AddMinutes(i), basePrice, basePrice + 2, basePrice - 1, basePrice + 1, 1000);
|
||||
adxvma.Update(bar, isNew: true);
|
||||
}
|
||||
@@ -208,7 +208,7 @@ public class AdxvmaValidationTests
|
||||
// Feed choppy bars: alternating up/down moves cancel out → ADX stays low
|
||||
for (int i = 50; i < 150; i++)
|
||||
{
|
||||
double price = 100 + Math.Sin(i * 0.5) * 2; // oscillating around 100
|
||||
double price = 100 + (Math.Sin(i * 0.5) * 2); // oscillating around 100
|
||||
var bar = new TBar(time.AddMinutes(i), price, price + 1, price - 1, price, 1000);
|
||||
adxvma.Update(bar, isNew: true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user