// NewAvgPriceWithSrcLen creates an Avgerage Price Indicator(AvgPrice) for offline usage
771652
func NewAvgPriceWithSrcLen(sourceLength uint) (indicator *AvgPrice, err error) {
	ind, err := NewAvgPrice()
	ind.Data = make([]float64, 0, sourceLength)

	return ind, err
}
910078
func NewDefaultLinRegWithSrcLen(sourceLength uint) (indicator *LinReg, err error) {
	ind, err := NewDefaultLinReg()

	// only initialise the storage if there is enough source data to require it
	if sourceLength-uint(ind.GetLookbackPeriod()) > 1 {
		ind.Data = make([]float64, 0, sourceLength-uint(ind.GetLookbackPeriod()))
	}

	return ind, err
}
496261
func NewPlusDiForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *PlusDi, err error) {
	ind, err := NewPlusDiWithSrcLen(sourceLength, timePeriod)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
951682
func NewLinRegIntWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinRegInt, err error) {
	ind, err := NewLinRegInt(timePeriod, selectData)

	// only initialise the storage if there is enough source data to require it
	if sourceLength-uint(ind.GetLookbackPeriod()) > 1 {
		ind.Data = make([]float64, 0, sourceLength-uint(ind.GetLookbackPeriod()))
	}

	return ind, err
}
352392
func NewDefaultVarWithSrcLen(sourceLength uint) (indicator *Var, err error) {
	ind, err := NewDefaultVar()

	// only initialise the storage if there is enough source data to require it
	if sourceLength-uint(ind.GetLookbackPeriod()) > 1 {
		ind.Data = make([]float64, 0, sourceLength-uint(ind.GetLookbackPeriod()))
	}

	return ind, err
}
111378
func NewLinRegIntForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinRegInt, err error) {
	ind, err := NewLinRegIntWithSrcLen(sourceLength, timePeriod, selectData)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
312523
func NewDefaultBollingerBandsForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *BollingerBands, err error) {
	ind, err := NewDefaultBollingerBandsWithSrcLen(sourceLength)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
686413
func NewDefaultAdxrWithSrcLen(sourceLength uint) (indicator *Adxr, err error) {
	ind, err := NewDefaultAdxr()

	// only initialise the storage if there is enough source data to require it
	if sourceLength-uint(ind.GetLookbackPeriod()) > 1 {
		ind.Data = make([]float64, 0, sourceLength-uint(ind.GetLookbackPeriod()))
	}

	return ind, err
}
337074
func NewDefaultRocWithSrcLen(sourceLength uint) (indicator *Roc, err error) {
	ind, err := NewDefaultRoc()

	// only initialise the storage if there is enough source data to require it
	if sourceLength-uint(ind.GetLookbackPeriod()) > 1 {
		ind.Data = make([]float64, 0, sourceLength-uint(ind.GetLookbackPeriod()))
	}

	return ind, err
}
900786
func NewDefaultWillRWithSrcLen(sourceLength uint) (indicator *WillR, err error) {
	ind, err := NewDefaultWillR()

	// only initialise the storage if there is enough source data to require it
	if sourceLength-uint(ind.GetLookbackPeriod()) > 1 {
		ind.Data = make([]float64, 0, sourceLength-uint(ind.GetLookbackPeriod()))
	}

	return ind, err
}
5473
func NewEmaWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Ema, err error) {
	ind, err := NewEma(timePeriod, selectData)

	// only initialise the storage if there is enough source data to require it
	if sourceLength-uint(ind.GetLookbackPeriod()) > 1 {
		ind.Data = make([]float64, 0, sourceLength-uint(ind.GetLookbackPeriod()))
	}

	return ind, err
}
304001
func NewSarForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, accelerationFactor float64, accelerationFactorMax float64) (indicator *Sar, err error) {
	ind, err := NewSarWithSrcLen(sourceLength, accelerationFactor, accelerationFactorMax)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
1150320
func NewAdlWithSrcLen(sourceLength uint) (indicator *Adl, err error) {
	ind, err := NewAdl()
	ind.Data = make([]float64, 0, sourceLength)
	return ind, err
}
1155199
func NewAvgPrice() (indicator *AvgPrice, err error) {
	ind := AvgPrice{}
	ind.AvgPriceWithoutStorage, err = NewAvgPriceWithoutStorage(func(dataItem float64, streamBarIndex int) {
		ind.Data = append(ind.Data, dataItem)
	})

	return &ind, err
}
441745
func NewAroonWithSrcLen(sourceLength uint, timePeriod int) (indicator *Aroon, err error) {
	ind, err := NewAroon(timePeriod)

	// only initialise the storage if there is enough source data to require it
	if sourceLength-uint(ind.GetLookbackPeriod()) > 1 {
		ind.Up = make([]float64, 0, sourceLength-uint(ind.GetLookbackPeriod()))
		ind.Down = make([]float64, 0, sourceLength-uint(ind.GetLookbackPeriod()))
	}

	return ind, err
}
509704
func NewAvgPriceForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *AvgPrice, err error) {
	ind, err := NewAvgPrice()
	priceStream.AddTickSubscription(ind)
	return ind, err
}
699088
func NewHhvBarsForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *HhvBars, err error) {
	ind, err := NewHhvBarsWithSrcLen(sourceLength, timePeriod, selectData)
	priceStream.AddTickSubscription(ind)
	return ind, err
}