fix(simulation,technicals): fix EMA 200 warmup distortion, intrabar execution path, and zero slippage
This commit is contained in:
@@ -62,8 +62,7 @@ public static class TechnicalIndicatorsEngine
|
||||
|
||||
public static decimal CalculateEma(IReadOnlyList<CandleDto> candles, int period)
|
||||
{
|
||||
if (candles == null || candles.Count == 0 || period <= 0) return 0m;
|
||||
if (candles.Count < period) return CalculateSma(candles, candles.Count);
|
||||
if (candles == null || candles.Count < period || period <= 0) return 0m;
|
||||
|
||||
decimal k = 2m / (period + 1);
|
||||
// Seed with SMA
|
||||
|
||||
Reference in New Issue
Block a user