/// <summary> /// Initializes a new instance of the <see cref="CoppockCurve" /> indicator /// </summary> /// <param name="name">A name for the indicator</param> /// <param name="shortRocPeriod">The period for the short ROC</param> /// <param name="longRocPeriod">The period for the long ROC</param> /// <param name="lwmaPeriod">The period for the LWMA</param> public CoppockCurve(string name, int shortRocPeriod, int longRocPeriod, int lwmaPeriod) : base(name) { _shortRoc = new RateOfChangePercent(shortRocPeriod); _longRoc = new RateOfChangePercent(longRocPeriod); _lwma = new LinearWeightedMovingAverage(lwmaPeriod); WarmUpPeriod = Math.Max(shortRocPeriod, longRocPeriod) + lwmaPeriod - 1; }
/// <summary> /// Initializes a new instance of the <see cref="CoppockCurve" /> indicator /// </summary> /// <param name="name">A name for the indicator</param> /// <param name="shortRocPeriod">The period for the short ROC</param> /// <param name="longRocPeriod">The period for the long ROC</param> /// <param name="lwmaPeriod">The period for the LWMA</param> public CoppockCurve(string name, int shortRocPeriod, int longRocPeriod, int lwmaPeriod) : base(name) { _shortRoc = new RateOfChangePercent(shortRocPeriod); _longRoc = new RateOfChangePercent(longRocPeriod); _lwma = new LinearWeightedMovingAverage(lwmaPeriod); // Define our warmup // LWMA does not get updated until ROC are warmed up and ready, so add our periods. // Then minus 1 because on the same point ROC is ready LWMA will receive its first point. WarmUpPeriod = Math.Max(_shortRoc.WarmUpPeriod, _longRoc.WarmUpPeriod) + lwmaPeriod - 1; }