// NewDefaultVarWithSrcLen creates a Variance Indicator (Var) for offline usage with default parameters
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
}
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
}
599507
func NewDefaultAtrForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Atr, err error) {
	ind, err := NewDefaultAtrWithSrcLen(sourceLength)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
386707
func NewDefaultTemaForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Tema, err error) {
	ind, err := NewDefaultTemaWithSrcLen(sourceLength)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
712846
func NewDefaultLinRegForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *LinReg, err error) {
	ind, err := NewDefaultLinRegWithSrcLen(sourceLength)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
50536
func NewDefaultStochRsiWithSrcLen(sourceLength uint) (indicator *StochRsi, err error) {
	ind, err := NewDefaultStochRsi()

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

	return ind, err
}
464874
func NewLlvBarsWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LlvBars, err error) {
	ind, err := NewLlvBars(timePeriod, selectData)

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

	return ind, err
}
1284367
func NewDefaultEmaWithSrcLen(sourceLength uint) (indicator *Ema, err error) {
	ind, err := NewDefaultEma()

	// 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
}
1290805
func NewWithDefaults(
	serverID string,
	collector collector.EventCollector,
	service packetprocessor.PacketProcessor,
	secrets secrets.Secrets,
	mode constants.ModeType,
	procMountPoint string,
	targetNetworks []string,
) *Datapath {

	if collector == nil {
		zap.L().Fatal("Collector must be given to NewDefaultDatapathEnforcer")
	}

	defaultMutualAuthorization := false
	defaultFQConfig := fqconfig.NewFilterQueueWithDefaults()
	defaultValidity := time.Hour * 8760
	defaultExternalIPCacheTimeout, err := time.ParseDuration(enforcerconstants.DefaultExternalIPTimeout)
	if err != nil {
		defaultExternalIPCacheTimeout = time.Second
	}
	defaultPacketLogs := false

	tokenAccessor, err := tokenaccessor.New(serverID, defaultValidity, secrets)
	if err != nil {
		zap.L().Fatal("Cannot create a token engine", zap.Error(err))
	}

	puFromContextID := cache.NewCache("puFromContextID")

	e := New(
		defaultMutualAuthorization,
		defaultFQConfig,
		collector,
		serverID,
		defaultValidity,
		service,
		secrets,
		mode,
		procMountPoint,
		defaultExternalIPCacheTimeout,
		defaultPacketLogs,
		tokenAccessor,
		puFromContextID,
		&runtime.Configuration{TCPTargetNetworks: targetNetworks},
	)

	conntrackClient, err := flowtracking.NewClient(context.Background())
	if err != nil {
		return nil
	}
	e.conntrack = conntrackClient

	return e
}
1133619
func NewDefaultStochRsiForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *StochRsi, err error) {
	ind, err := NewDefaultStochRsiWithSrcLen(sourceLength)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
1021910
func NewDefaultPlusDmWithSrcLen(sourceLength uint) (indicator *PlusDm, err error) {
	ind, err := NewDefaultPlusDm()

	// 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
}
1074942
func NewDefaultAroonOscWithSrcLen(sourceLength uint) (indicator *AroonOsc, err error) {
	ind, err := NewDefaultAroonOsc()

	// 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
}
1320169
func NewDefaultLinRegSlpForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *LinRegSlp, err error) {
	ind, err := NewDefaultLinRegSlpWithSrcLen(sourceLength)
	priceStream.AddTickSubscription(ind)
	return ind, err
}
894913
func NewDefaultVarForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Var, err error) {
	ind, err := NewDefaultVar()
	priceStream.AddTickSubscription(ind)
	return ind, err
}
338205
func NewDefaultRocPWithSrcLen(sourceLength uint) (indicator *RocP, err error) {
	ind, err := NewDefaultRocP()

	// 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
}
528178
func NewDefaultChaikinOscWithSrcLen(sourceLength uint) (indicator *ChaikinOsc, err error) {
	ind, err := NewDefaultChaikinOsc()

	// 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
}
538296
func NewDefaultAdxForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Adx, err error) {
	ind, err := NewDefaultAdxWithSrcLen(sourceLength)
	priceStream.AddTickSubscription(ind)
	return ind, err
}