private void Construct(int fastperiod, int slowperiod, int signalPeriod, TimeSpan barSize, DataStream stream, Func <Bar, decimal> comp = null) { _timeSpan = barSize; BarSize = barSize; Compute = comp ?? (x => x.Close); DataStreams = new[] { stream }; SlowPeriod = slowperiod; FastPeriod = fastperiod; _histogram = new IndicatorDataSerie(); _line = new IndicatorDataSerie(); _signal = new IndicatorDataSerie(); SignalPeriod = signalPeriod; }
private void Construct(int period, DataStream stream, TimeSpan barSize, double sdUp, double sdDown, Func <Bar, decimal> compute, MovingAverageType maType) { _timeSpan = barSize; Period = period; DataStreams = new[] { stream }; _maType = maType; Compute = compute ?? (x => (x.Close)); _sdUp = sdUp; _sdDown = sdDown; Period = sdUp > sdDown ? (int)sdUp : (int)sdDown; _upperBand = new IndicatorDataSerie(); _middleBand = new IndicatorDataSerie(); _lowerBand = new IndicatorDataSerie(); }