/// <summary>Initializes a new instance of the SimpleMovingAverage class with the specified name and period from the left indicator
 /// </summary>
 /// <param name="left">The SimpleMovingAverage indicator will be created using the data from left</param>
 /// <param name="period">The period of the SMA</param>
 /// <param name="waitForFirstToReady">True to only send updates to the second if first.IsReady returns true, false to alway send updates to second</param>
 /// <returns>The reference to the SimpleMovingAverage indicator to allow for method chaining</returns>
 public static SimpleMovingAverage SMA(this IUpdatable left, int period, bool waitForFirstToReady = true)
 {
     return(new SimpleMovingAverage($"SMA{period}_Of_{left.ExtractName()}", period).Of(left, waitForFirstToReady));
 }
 /// <summary>Creates a new Maximum indicator with the specified period from the left indicator
 /// </summary>
 /// <param name="left">The Maximum indicator will be created using the data from left</param>
 /// <param name="period">The period of the Maximum indicator</param>
 /// <param name="waitForFirstToReady">True to only send updates to the second if left.IsReady returns true, false to alway send updates</param>
 /// <returns>A reference to the Maximum indicator to allow for method chaining</returns>
 public static IIndicator MAX(this IUpdatable left, int period, bool waitForFirstToReady = true)
 {
     return(new Maximum($"MAX{period}_Of_{left.ExtractName()}", period).Of(left, waitForFirstToReady));
 }
 /// <summary>Creates a new Minimum indicator with the specified period from the left indicator
 /// </summary>
 /// <param name="left">The Minimum indicator will be created using the data from left</param>
 /// <param name="period">The period of the Minimum indicator</param>
 /// <param name="waitForFirstToReady">True to only send updates to the second if left.IsReady returns true, false to alway send updates</param>
 /// <returns>A reference to the Minimum indicator to allow for method chaining</returns>
 public static IIndicator MIN(this IUpdatable left, int period, bool waitForFirstToReady = true)
 {
     return((period <= 0 ? (IIndicator) new PeriodlessMinimum($"MIN{period}_Of_{left.ExtractName()}") : new Minimum($"MIN{period}_Of_{left.ExtractName()}", period)).Of(left, waitForFirstToReady));
 }
        /// <summary>Creates a new ExponentialMovingAverage indicator with the specified period and smoothingFactor from the left indicator
        /// </summary>
        /// <param name="left">The ExponentialMovingAverage indicator will be created using the data from left</param>
        /// <param name="period">The period of the ExponentialMovingAverage indicators</param>
        /// <param name="smoothingFactor">The percentage of data from the previous value to be carried into the next value</param>
        /// <param name="waitForFirstToReady">True to only send updates to the second if left.IsReady returns true, false to alway send updates</param>
        /// <returns>A reference to the ExponentialMovingAverage indicator to allow for method chaining</returns>
        public static ExponentialMovingAverage EMA(this IUpdatable left, int period, double?smoothingFactor = null, bool waitForFirstToReady = true)
        {
            double k = smoothingFactor.HasValue ? k = smoothingFactor.Value : ExponentialMovingAverage.SmoothingFactorDefault(period);

            return(new ExponentialMovingAverage($"EMA{period}_Of_{left.ExtractName()}", period, k).Of(left, waitForFirstToReady));
        }