// NewDefaultRocR creates a Rate of Change Ratio Indicator (RocR) for online usage with default parameters
//	- timePeriod: 10
327143
func NewDefaultRocR() (indicator *RocR, err error) {
	timePeriod := 10
	return NewRocR(timePeriod, gotrade.UseClosePrice)
}
333378
func NewDefaultAtrWithSrcLen(sourceLength uint) (indicator *Atr, err error) {
	ind, err := NewDefaultAtr()

	// 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
}
108626
func NewDefaultConfig() *Config {
	return &Config{
		IdentityEndpoint:   env.GetOrDefaultString("OTC_IDENTITY_ENDPOINT", defaultIdentityEndpoint),
		PropagationTimeout: env.GetOrDefaultSecond("OTC_PROPAGATION_TIMEOUT", dns01.DefaultPropagationTimeout),
		PollingInterval:    env.GetOrDefaultSecond("OTC_POLLING_INTERVAL", dns01.DefaultPollingInterval),
		TTL:                env.GetOrDefaultInt("OTC_TTL", minTTL),
		HTTPClient: &http.Client{
			Timeout: env.GetOrDefaultSecond("OTC_HTTP_TIMEOUT", 10*time.Second),
			Transport: &http.Transport{
				Proxy: http.ProxyFromEnvironment,
				DialContext: (&net.Dialer{
					Timeout:   30 * time.Second,
					KeepAlive: 30 * time.Second,
					DualStack: true,
				}).DialContext,
				MaxIdleConns:          100,
				IdleConnTimeout:       90 * time.Second,
				TLSHandshakeTimeout:   10 * time.Second,
				ExpectContinueTimeout: 1 * time.Second,

				// Workaround for keep alive bug in otc api
				DisableKeepAlives: true,
			},
		},
	}
}
1358448
func NewDefaultRocP() (indicator *RocP, err error) {
	timePeriod := 10
	return NewRocP(timePeriod, gotrade.UseClosePrice)
}
844368
func NewDefaultRocRWithSrcLen(sourceLength uint) (indicator *RocR, err error) {
	ind, err := NewDefaultRocR()

	// 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
}
653299
func NewWithDefaults(
	serverID string,
	collector collector.EventCollector,
	service packetprocessor.PacketProcessor,
	secrets secrets.Secrets,
	mode constants.ModeType,
	procMountPoint string,
	targetNetworks []string,
) Enforcer {
	return nfqdatapath.NewWithDefaults(
		serverID,
		collector,
		service,
		secrets,
		mode,
		procMountPoint,
		targetNetworks,
	)
}
1362251
func NewDefaultKamaForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Kama, err error) {
	ind, err := NewDefaultKama()
	priceStream.AddTickSubscription(ind)
	return ind, err
}
270725
func NewDefaultWillRForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *WillR, err error) {
	ind, err := NewDefaultWillR()
	priceStream.AddTickSubscription(ind)
	return ind, err
}
643222
func NewDefaultTema() (indicator *Tema, err error) {
	timePeriod := 30
	return NewTema(timePeriod, gotrade.UseClosePrice)
}
677331
func NewDefaultRocRForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *RocR, err error) {
	ind, err := NewDefaultRocRWithSrcLen(sourceLength)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
316233
func NewDefaultWillRForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *WillR, err error) {
	ind, err := NewDefaultWillRWithSrcLen(sourceLength)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
443370
func NewDefaultLinRegAngForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *LinRegAng, err error) {
	ind, err := NewDefaultLinRegAng()
	priceStream.AddTickSubscription(ind)
	return ind, err
}
935472
func NewDefaultAdxrForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Adxr, err error) {
	ind, err := NewDefaultAdxr()
	priceStream.AddTickSubscription(ind)
	return ind, err
}
628777
func NewDefaultChaikinOsc() (indicator *ChaikinOsc, err error) {
	fastTimePeriod := 3
	slowTimePeriod := 10
	return NewChaikinOsc(fastTimePeriod, slowTimePeriod)
}
159244
func NewDefaultRsiForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Rsi, err error) {
	ind, err := NewDefaultRsiWithSrcLen(sourceLength)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
396701
func newDefaultConfig(url string, timeoutms int, config *RealisConfig) (*RealisConfig, error) {
	return newTJSONConfig(url, timeoutms, config)
}
422107
func Rocr(inReal []float64, inTimePeriod int) []float64 {

	outReal := make([]float64, len(inReal))

	startIdx := inTimePeriod
	outIdx := inTimePeriod
	inIdx := startIdx
	trailingIdx := startIdx - inTimePeriod

	for inIdx < len(inReal) {
		tempReal := inReal[trailingIdx]
		if tempReal != 0.0 {
			outReal[outIdx] = (inReal[inIdx] / tempReal)
		} else {
			outReal[outIdx] = 0.0
		}
		trailingIdx++
		outIdx++
		inIdx++
	}
	return outReal
}