Refactor code formatting and improve consistency across various test files

- Removed unnecessary blank lines in multiple test files to enhance readability.
- Ensured consistent spacing and formatting in the `Trima`, `Usf`, `Vidya`, `Wma`, and `Atr` test classes.
- Updated comments for clarity and consistency in the `Atr` and `Adl` classes.
- Adjusted project files for better structure and maintainability.
This commit is contained in:
Miha Kralj
2025-12-28 17:44:08 -08:00
parent ad6eebf812
commit 13d7c1215d
169 changed files with 10815 additions and 10814 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ public class TemaIndicatorTests
for (int i = 0; i < 10; i++)
{
indicator.HistoricalData.AddBar(now.AddMinutes(i), 100, 105, 95, 102);
// Process update
var args = new UpdateArgs(UpdateReason.HistoricalBar);
indicator.ProcessUpdate(args);
+11 -11
View File
@@ -66,13 +66,13 @@ public class TemaTests
tema.Reset();
Assert.Equal(0, tema.Last.Value);
Assert.False(tema.IsHot);
// Feed again
for (int i = 0; i < bars.Count; i++)
{
tema.Update(new TValue(bars[i].Time, bars[i].Close));
}
Assert.True(double.IsFinite(tema.Last.Value));
}
@@ -99,23 +99,23 @@ public class TemaTests
Assert.Equal(streamingResults[i], seriesResults.Values[i], 1e-9);
}
}
[Fact]
public void BatchCalculate_Matches_Streaming()
{
var gbm = new GBM();
var bars = gbm.Fetch(200, DateTime.UtcNow.Ticks, TimeSpan.FromMinutes(1));
var series = bars.Close;
var tema = new Tema(10);
var streamingResults = new List<double>();
for (int i = 0; i < series.Count; i++)
{
streamingResults.Add(tema.Update(series[i]).Value);
}
var batchResults = Tema.Batch(series, 10);
Assert.Equal(streamingResults.Count, batchResults.Count);
for (int i = 0; i < batchResults.Count; i++)
{
@@ -129,17 +129,17 @@ public class TemaTests
var gbm = new GBM();
var bars = gbm.Fetch(200, DateTime.UtcNow.Ticks, TimeSpan.FromMinutes(1));
var series = bars.Close;
var tema = new Tema(10);
var streamingResults = new List<double>();
for (int i = 0; i < series.Count; i++)
{
streamingResults.Add(tema.Update(series[i]).Value);
}
var spanResults = new double[series.Count];
Tema.Batch(series.Values, spanResults, 10);
for (int i = 0; i < spanResults.Length; i++)
{
Assert.Equal(streamingResults[i], spanResults[i], 1e-9);
@@ -153,12 +153,12 @@ public class TemaTests
var gbm = new GBM();
var bars = gbm.Fetch(10, DateTime.UtcNow.Ticks, TimeSpan.FromMinutes(1));
var series = bars.Close;
// Test TSeries chain
var result = tema.Update(series);
Assert.NotNull(result);
Assert.IsType<TSeries>(result);
// Test TValue chain
var result2 = tema.Update(series[0]);
Assert.IsType<TValue>(result2);
+2 -2
View File
@@ -85,9 +85,9 @@ public class TemaValidationTests
var temaIndicator = Tulip.Indicators.tema;
double[][] inputs = { _testData.RawData.ToArray() };
double[] options = { period };
// Tulip TEMA lookback is 3*(period-1)
int lookback = 3 * (period - 1);
int lookback = 3 * (period - 1);
double[][] outputs = { new double[_testData.RawData.Length - lookback] };
temaIndicator.Run(inputs, options, outputs);