12 private DateTime _lastDate;
13 private decimal _sumOfVolume;
14 private decimal _sumOfPriceTimesVolume;
19 public override bool IsReady => _sumOfVolume > 0;
35 decimal volume, averagePrice;
42 if (_lastDate != input.
EndTime.Date)
45 _sumOfPriceTimesVolume = 0m;
50 _sumOfVolume += volume;
51 _sumOfPriceTimesVolume += averagePrice * volume;
53 if (_sumOfVolume == 0m)
59 return _sumOfPriceTimesVolume / _sumOfVolume;
71 throw new NotImplementedException($
"{nameof(IntradayVwap)}.{nameof(ComputeNextValue)} should never be invoked.");
79 var tick = input as
Tick;
84 averagePrice = tick.LastPrice;
89 if (tradeBar?.IsFillForward ==
false)
92 averagePrice = (tradeBar.High + tradeBar.Low + tradeBar.Close) / 3m;