Пример #1
0
 /// <summary>
 ///      Resets this indicator to its initial state
 /// </summary>
 public override void Reset()
 {
     _price.Reset();
     _volume.Reset();
     _vwap = _price.WeightedBy(_volume, _period);
     base.Reset();
 }
Пример #2
0
        /// <summary>
        ///      Initializes a new instance of the VWAP class with a given name and period
        /// </summary>
        /// <param name="name">string - the name of the indicator</param>
        /// <param name="period">The period of the VWAP</param>
        public VolumeWeightedAveragePriceIndicator(string name, int period)
            : base(name)
        {
            _period = period;

            _price  = new Identity("Price");
            _volume = new Identity("Volume");

            // This class will be using WeightedBy indicator extension
            _vwap = _price.WeightedBy(_volume, period);
        }