diff --git a/lib/momentum/rs/tests/Rs.Tests.cs b/lib/momentum/rs/tests/Rs.Tests.cs index 0c0564ad..6e07d26a 100644 --- a/lib/momentum/rs/tests/Rs.Tests.cs +++ b/lib/momentum/rs/tests/Rs.Tests.cs @@ -88,7 +88,7 @@ public class RsTests for (int i = 0; i < 20; i++) { double basePrice = 200.0 + i; - double compPrice = 100.0 + i * 0.5; + double compPrice = 100.0 + (i * 0.5); rs.Update(basePrice, compPrice); results.Add(rs.Last.Value); } @@ -382,8 +382,8 @@ public class RsTests // Base grows faster than comparison for (int i = 0; i < 20; i++) { - double basePrice = 100.0 + i * 2; // +2 per bar - double compPrice = 100.0 + i * 1; // +1 per bar + double basePrice = 100.0 + (i * 2); // +2 per bar + double compPrice = 100.0 + (i * 1); // +1 per bar rs.Update(basePrice, compPrice); } @@ -399,8 +399,8 @@ public class RsTests // Base grows slower than comparison for (int i = 0; i < 20; i++) { - double basePrice = 100.0 + i * 1; // +1 per bar - double compPrice = 100.0 + i * 2; // +2 per bar + double basePrice = 100.0 + (i * 1); // +1 per bar + double compPrice = 100.0 + (i * 2); // +2 per bar rs.Update(basePrice, compPrice); } @@ -416,8 +416,8 @@ public class RsTests // Both grow at same rate for (int i = 0; i < 20; i++) { - double basePrice = 100.0 + i * 2; - double compPrice = 50.0 + i * 1; + double basePrice = 100.0 + (i * 2); + double compPrice = 50.0 + (i * 1); rs.Update(basePrice, compPrice); } diff --git a/lib/reversals/sar/tests/Sar.Tests.cs b/lib/reversals/sar/tests/Sar.Tests.cs index 23816e1d..631bb377 100644 --- a/lib/reversals/sar/tests/Sar.Tests.cs +++ b/lib/reversals/sar/tests/Sar.Tests.cs @@ -150,12 +150,12 @@ public sealed class SarBasicTests // Steady uptrend - SAR should trail below for (int i = 0; i < 20; i++) { - double price = 100.0 + i * 2; + double price = 100.0 + (i * 2); _ = sar.Update(new TBar(DateTime.UtcNow.AddMinutes(i), price + 1, price - 1, price + 0.5, price, 1000)); } - double lastClose = 100.0 + 19 * 2; + double lastClose = 100.0 + (19 * 2); Assert.True(sar.SarValue < lastClose, "SAR should be below price in uptrend"); Assert.True(sar.IsLong, "Should be in long mode during uptrend"); } @@ -168,12 +168,12 @@ public sealed class SarBasicTests // Steady downtrend - SAR should trail above for (int i = 0; i < 20; i++) { - double price = 200.0 - i * 2; + double price = 200.0 - (i * 2); _ = sar.Update(new TBar(DateTime.UtcNow.AddMinutes(i), price + 1, price - 1, price + 0.5, price, 1000)); } - double lastClose = 200.0 - 19 * 2; + double lastClose = 200.0 - (19 * 2); Assert.True(sar.SarValue > lastClose, "SAR should be above price in downtrend"); Assert.False(sar.IsLong, "Should be in short mode during downtrend"); } @@ -423,7 +423,7 @@ public sealed class SarConsistencyTests // Continue uptrend for (int i = 1; i <= 5; i++) { - double price = 105 + i * 2; + double price = 105 + (i * 2); _ = sar.Update(new TBar(dt.AddMinutes(i), price + 1, price - 1, price + 0.5, price, 1000), isNew: true); }