diff --git a/Indicators/IndicatorBase.cs b/Indicators/IndicatorBase.cs index 327cd3b5ddcf..cf011d804f43 100644 --- a/Indicators/IndicatorBase.cs +++ b/Indicators/IndicatorBase.cs @@ -232,6 +232,7 @@ public int CompareTo(object obj) public abstract class IndicatorBase : IndicatorBase where T : IBaseData { + private bool _loggedForwardOnlyIndicatorError; /// the most recent input that was given to this indicator private Dictionary _previousInput = new Dictionary(); @@ -255,8 +256,12 @@ public override bool Update(IBaseData input) T _previousSymbolInput = default(T); if (_previousInput.TryGetValue(input.Symbol.ID, out _previousSymbolInput) && input.EndTime < _previousSymbolInput.EndTime) { - // if we receive a time in the past, log and return - Log.Error($"This is a forward only indicator: {Name} Input: {input.EndTime:u} Previous: {_previousSymbolInput.EndTime:u}. It will not be updated with this input."); + if (!_loggedForwardOnlyIndicatorError) + { + _loggedForwardOnlyIndicatorError = true; + // if we receive a time in the past, log once and return + Log.Error($"IndicatorBase.Update(): This is a forward only indicator: {Name} Input: {input.EndTime:u} Previous: {_previousSymbolInput.EndTime:u}. It will not be updated with this input."); + } return IsReady; } if (!ReferenceEquals(input, _previousSymbolInput))