configs

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

README

/configs

Configuration file templates or default configs.

Put your confd or consul-template template files here.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name    string `yaml:"name" env:"APP_NAME" env-required:"true"`
	Version string `yaml:"version" env:"APP_VEON" env-required:"true"`
}

type Config

type Config struct {
	App       `yaml:"app"`
	HTTP      `yaml:"http"`
	Logging   `yaml:"logging"`
	Postgres  `yaml:"postgres"`
	RabbitMQ  `yaml:"rabbit_mq"`
	Exchange  `yaml:"exchange"`
	Indicator `yaml:"indicator"`
	Strategy  `yaml:"strategy"`
	Trade     `yaml:"trade"`
}

func NewConfig

func NewConfig() (*Config, error)

NewConfig returns app config.

type Exchange

type Exchange struct {
	Interval    string `yaml:"interval" env-required:"true"`
	BaseSymbol  string `yaml:"base_symbol" env-required:"true"`
	QuoteSymbol string `yaml:"quote_symbol" env-required:"true"`
	AssetSymbol string `yaml:"asset_symbol" env-required:"true"`
}

type HTTP

type HTTP struct {
	Port string `yaml:"port" env:"HTTP_PORT" env-required:"true"`
}

type Indicator

type Indicator struct {
	ADL struct {
		Window int `yaml:"window" env-required:"true"`
	} `yaml:"adl"`
	OBV struct {
		Window int `yaml:"window" env-required:"true"`
	} `yaml:"obv"`
	MFI struct {
		Window     int     `yaml:"window" env-required:"true"`
		Length     int     `yaml:"length" env-required:"true"`
		Oversold   float64 `yaml:"oversold" env-required:"true"`
		Threshold  float64 `yaml:"threshold" env-required:"true"`
		Overbought float64 `yaml:"overbought" env-required:"true"`
		Factor     float64 `yaml:"factor" env-required:"true"`
	} `yaml:"mfi"`
	CHO struct {
		Window     int `yaml:"window" env-required:"true"`
		FastLength int `yaml:"fast_length" env-required:"true"`
		SlowLength int `yaml:"slow_length" env-required:"true"`
	} `yaml:"cho"`
	Aroon struct {
		Window int `yaml:"window" env-required:"true"`
		Length int `yaml:"length" env-required:"true"`
	} `yaml:"aroon"`
	ADX struct {
		Window                int     `yaml:"window"`
		Length                int     `yaml:"length" env-required:"true"`
		WeakTrend             float64 `yaml:"weak_trend"`
		StrongTrend           float64 `yaml:"strong_trend" env-required:"true"`
		VeryStrongTrend       float64 `yaml:"very_strong_trend" env-required:"true"`
		ExtremelyStrongTrend  float64 `yaml:"extremely_strong_trend" env-required:"true"`
		WeakFactor            float64 `yaml:"weak_factor" env-required:"true"`
		StrongFactor          float64 `yaml:"strong_factor" env-required:"true"`
		VeryStrongFactor      float64 `yaml:"very_strong_factor" env-required:"true"`
		ExtremelyStrongFactor float64 `yaml:"extremely_strong_factor" env-required:"true"`
	} `yaml:"adx"`
	ADXR struct {
		Window                int     `yaml:"window"`
		Length                int     `yaml:"length" env-required:"true"`
		WeakTrend             float64 `yaml:"weak_trend"`
		StrongTrend           float64 `yaml:"strong_trend" env-required:"true"`
		VeryStrongTrend       float64 `yaml:"very_strong_trend" env-required:"true"`
		ExtremelyStrongTrend  float64 `yaml:"extremely_strong_trend" env-required:"true"`
		WeakFactor            float64 `yaml:"weak_factor" env-required:"true"`
		StrongFactor          float64 `yaml:"strong_factor" env-required:"true"`
		VeryStrongFactor      float64 `yaml:"very_strong_factor" env-required:"true"`
		ExtremelyStrongFactor float64 `yaml:"extremely_strong_factor" env-required:"true"`
	} `yaml:"adxr"`
	DMI struct {
		Window                int     `yaml:"window" env-required:"true"`
		Length                int     `yaml:"length" env-required:"true"`
		WeakTrend             float64 `yaml:"weak_trend"`
		StrongTrend           float64 `yaml:"strong_trend" env-required:"true"`
		VeryStrongTrend       float64 `yaml:"very_strong_trend" env-required:"true"`
		ExtremelyStrongTrend  float64 `yaml:"extremely_strong_trend" env-required:"true"`
		WeakFactor            float64 `yaml:"weak_factor"`
		StrongFactor          float64 `yaml:"strong_factor" env-required:"true"`
		VeryStrongFactor      float64 `yaml:"very_strong_factor" env-required:"true"`
		ExtremelyStrongFactor float64 `yaml:"extremely_strong_factor" env-required:"true"`
	} `yaml:"dmi"`
	MACD struct {
		Window          int     `yaml:"window" env-required:"true"`
		FastLength      int     `yaml:"fast_length" env-required:"true"`
		SlowLength      int     `yaml:"slow_length" env-required:"true"`
		SignalLength    int     `yaml:"signal_length" env-required:"true"`
		HistogramFactor float64 `yaml:"histogram_factor" env-required:"true"`
	} `yaml:"macd"`
	SAR struct {
		Window    int     `yaml:"window" env-required:"true"`
		MALength  int     `yaml:"ma_length" env-required:"true"`
		Increment float64 `yaml:"increment" env-required:"true"`
		Maximum   float64 `yaml:"maximum" env-required:"true"`
	} `yaml:"sar"`
	TRIX struct {
		Window int `yaml:"window" env-required:"true"`
		Length int `yaml:"length" env-required:"true"`
	} `yaml:"trix"`
	RSI struct {
		Window     int     `yaml:"window" env-required:"true"`
		Length     int     `yaml:"length" env-required:"true"`
		Oversold   float64 `yaml:"oversold" env-required:"true"`
		Threshold  float64 `yaml:"threshold" env-required:"true"`
		Overbought float64 `yaml:"overbought" env-required:"true"`
		Factor     float64 `yaml:"factor" env-required:"true"`
	} `yaml:"rsi"`
	Stoch struct {
		Window     int     `yaml:"window" env-required:"true"`
		Length     int     `yaml:"length" env-required:"true"`
		SmoothK    int     `yaml:"smooth_k" env-required:"true"`
		SmoothD    int     `yaml:"smooth_d" env-required:"true"`
		Oversold   float64 `yaml:"oversold" env-required:"true"`
		Threshold  float64 `yaml:"threshold" env-required:"true"`
		Overbought float64 `yaml:"overbought" env-required:"true"`
		Factor     float64 `yaml:"factor" env-required:"true"`
	} `yaml:"stoch"`
	StochF struct {
		Window     int     `yaml:"window" env-required:"true"`
		SmoothK    int     `yaml:"smooth_k" env-required:"true"`
		SmoothD    int     `yaml:"smooth_d" env-required:"true"`
		Oversold   float64 `yaml:"oversold" env-required:"true"`
		Threshold  float64 `yaml:"threshold" env-required:"true"`
		Overbought float64 `yaml:"overbought" env-required:"true"`
		Factor     float64 `yaml:"factor" env-required:"true"`
	} `yaml:"stoch_f"`
	UO struct {
		Window     int     `yaml:"window" env-required:"true"`
		Length7    int     `yaml:"length7" env-required:"true"`
		Length14   int     `yaml:"length14" env-required:"true"`
		Length28   int     `yaml:"length28" env-required:"true"`
		Oversold   float64 `yaml:"oversold" env-required:"true"`
		Threshold  float64 `yaml:"threshold" env-required:"true"`
		Overbought float64 `yaml:"overbought" env-required:"true"`
		Factor     float64 `yaml:"factor" env-required:"true"`
	} `yaml:"uo"`
	WR struct {
		Window     int     `yaml:"window" env-required:"true"`
		Length     int     `yaml:"length" env-required:"true"`
		Oversold   float64 `yaml:"oversold" env-required:"true"`
		Threshold  float64 `yaml:"threshold" env-required:"true"`
		Overbought float64 `yaml:"overbought" env-required:"true"`
		Factor     float64 `yaml:"factor" env-required:"true"`
	} `yaml:"wr"`
	KAMA struct {
		Window   int `yaml:"window" env-required:"true"`
		Length   int `yaml:"length" env-required:"true"`
		MALength int `yaml:"ma_length" env-required:"true"`
	} `yaml:"kama"`
	ROC struct {
		Window int `yaml:"window" env-required:"true"`
		Length int `yaml:"length" env-required:"true"`
	} `yaml:"roc"`
	PPO struct {
		Window     int `yaml:"window"`
		FastLength int `yaml:"fast_length" env-required:"true"`
		SlowLength int `yaml:"slow_length" env-required:"true"`
	} `yaml:"ppo"`
	BB struct {
		Window     int     `yaml:"window" env-required:"true"`
		Length     int     `yaml:"length" env-required:"true"`
		MALength   int     `yaml:"ma_length" env-required:"true"`
		Multiplier float64 `yaml:"multiplier" env-required:"true"`
		Factor     float64 `yaml:"factor" env-required:"true"`
	} `yaml:"bb"`
	ATR struct {
		Window int `yaml:"window" env-required:"true"`
		Length int `yaml:"length" env-required:"true"`
	} `yaml:"atr"`
	HTMode struct {
		Window int `yaml:"window"`
	} `yaml:"ht_mode"`
	HTTrend struct {
		Window int `yaml:"window" env-required:"true"`
	} `yaml:"ht_trend"`
	HTSine struct {
		Window int `yaml:"window" env-required:"true"`
	} `yaml:"ht_sine"`
	HTPeriod struct {
		Window int `yaml:"window" env-required:"true"`
	} `yaml:"ht_period"`
	HTPhasor struct {
		Window int `yaml:"window" env-required:"true"`
	} `yaml:"ht_phasor"`
	CCI struct {
		Window    int     `yaml:"window" env-required:"true"`
		Length    int     `yaml:"length" env-required:"true"`
		UpTrend   float64 `yaml:"up_trend" env-required:"true"`
		DownTrend float64 `yaml:"down_trend" env-required:"true"`
		Factor    float64 `yaml:"factor"`
	} `yaml:"cci"`
	MAMA struct {
		Window    int     `yaml:"window" env-required:"true"`
		FastLimit float64 `yaml:"fast_limit" env-required:"true"`
		SlowLimit float64 `yaml:"slow_limit" env-required:"true"`
	} `yaml:"mama"`
}

type Logging

type Logging struct {
	Level string `yaml:"level" env:"LOG_LEVEL" env-required:"true"`
}

type Postgres

type Postgres struct {
	PoolMax int    `yaml:"pool_max" env:"PG_POOL_MAX" env-upd:"true" env-required:"true"`
	URL     string `yaml:"url" env:"PG_URL" env-upd:"true"`
}

type RabbitMQ

type RabbitMQ struct {
	Server string `yaml:"server" env:"RMQ_RPC_SERVER" env-upd:"true" env-required:"true"`
	Client string `yaml:"client" env:"RMQ_RPC_CLIENT" env-upd:"true" env-required:"true"`
	URL    string `yaml:"url" env:"RMQ_URL" env-upd:"true"`
}

type Strategy

type Strategy struct {
	AIS struct {
		Offset int `yaml:"offset" env-required:"true"`
	} `yaml:"ais"`
}

type Trade

type Trade struct {
	Budget             float64 `yaml:"budget" env-required:"true"`
	FIAT               string  `yaml:"fiat" env-required:"true"`
	FeeRatio           float64 `yaml:"fee_ratio" env-required:"true"`
	StopLossRatio      float64 `yaml:"stop_loss_ratio" env-required:"true"`
	TaxFreeProfitLimit float64 `yaml:"tax_free_profit_limit" env-required:"true"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL