mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-15 09:08:04 +00:00
- Remove 'C# Implementation Considerations' sections from 34 indicator .md files - Delete 29 temp PowerShell scripts (_fix_mojibake.ps1, _hex_scan.ps1, etc.) - Move test files into tests/ subdirectories for consistent project structure - Add trader-focused bullet points to indicator documentation
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using TradingPlatform.BusinessLayer;
|
|
|
|
namespace QuanTAlib.Quantower.Tests;
|
|
|
|
public class MgdiIndicatorTests
|
|
{
|
|
[Fact]
|
|
public void Indicator_Initializes_Correctly()
|
|
{
|
|
var indicator = new MgdiIndicator();
|
|
Assert.Equal("MGDI - McGinley Dynamic Indicator", indicator.Name);
|
|
Assert.Equal("MGDI(14,0.6):Close", indicator.ShortName);
|
|
Assert.Equal(0, MgdiIndicator.MinHistoryDepths);
|
|
Assert.Single(indicator.LinesSeries);
|
|
}
|
|
|
|
[Fact]
|
|
public void Indicator_Updates_Correctly()
|
|
{
|
|
var indicator = new MgdiIndicator();
|
|
indicator.Initialize();
|
|
|
|
// Warmup
|
|
for (int i = 0; i < 100; i++)
|
|
{
|
|
var time = DateTime.UtcNow.AddMinutes(i);
|
|
indicator.HistoricalData.AddBar(time, 100 + i, 100 + i, 100 + i, 100 + i);
|
|
|
|
var args = new UpdateArgs(UpdateReason.NewBar);
|
|
indicator.ProcessUpdate(args);
|
|
}
|
|
|
|
// Check if value is set (should be non-zero after warmup)
|
|
var result = indicator.LinesSeries[0].GetValue();
|
|
Assert.NotEqual(0, result);
|
|
Assert.False(double.IsNaN(result));
|
|
}
|
|
}
|