models

package
v0.0.0-...-b8ff696 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KlineFloat

func KlineFloat(kline *futures.Kline) (float64, float64, float64, float64, float64, error)

Types

type DealInfo

type DealInfo struct {
	Price  float64
	KO     float64
	Signal float64
}

type EmaMacdBBorder

type EmaMacdBBorder struct {
	IsLong  bool `json:"-"`
	IsShort bool `json:"-"`
	IsDeal  bool `json:"-"`

	EmaWindow  int64   `json:"ema_window,omitempty"`
	MacdFast   int64   `json:"macd_fast,omitempty"`
	MacdSlow   int64   `json:"macd_slow,omitempty"`
	MacdSignal int64   `json:"macd_signal,omitempty"`
	BBEma      int64   `json:"bb_ema,omitempty"`
	BBUp       float64 `json:"bb_up,omitempty"`
	BBDown     float64 `json:"bb_down,omitempty"`
}

type EmaRsi

type EmaRsi struct {
	TrendInterval        string `json:"trend_interval,omitempty"`
	IndicatorPeriod      int    `json:"indicator_period,omitempty"`
	TrendPeriod          int    `json:"trend_period,omitempty"`
	TickerForRecalcTrend int64  `json:"ticker_recalc_trend,omitempty"`
}

type JobInfo

type JobInfo struct {
	JobID     int64
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt time.Time
	Name      string
	Settings  *Settings
}

type Klinger

type Klinger struct {
	KPeriod int64 `json:"k_period,omitempty"`
	DPeriod int64 `json:"d_period,omitempty"`
	Period  int64 `json:"period,omitempty"`
}

type KovWeights

type KovWeights struct {
	Weights    map[string]int8 `json:"weights"`
	LongEntry  int8            `json:"long_entry"`
	Signal     int8            `json:"-"`
	ShortEntry int8            `json:"short_entry"`
	LongQuit   int8            `json:"long_quit"`
	ShortQuit  int8            `json:"short_quit"`
}

type Settings

type Settings struct {
	sync.Mutex
	DealInfos        map[string]DealInfo `json:"-"`
	KovWeights       KovWeights          `json:"kov_weights"`
	MainSignalTicker string              `json:"main_signal_ticker"`

	Signals   sync.Map `json:"-"`
	Intervals []string `json:"intervals"`
	OpenRate  int8     `json:"open_rate"`
	CloseRate int8     `json:"close_rate"`

	JobID            int64   `json:"-"`
	BinanceApiKey    string  `json:"-"`
	BinanceSecretKey string  `json:"-"`
	SignalSell       bool    `json:"-"`
	SignalBuy        bool    `json:"-"`
	IsBuy            bool    `json:"-"`
	IsSell           bool    `json:"-"`
	ShortOnly        bool    `json:"-"`
	LongOnly         bool    `json:"-"`
	IsShort          bool    `json:"-"`
	IsLong           bool    `json:"-"`
	OpenDealPrice    float64 `json:"-"`

	Name              string  `json:"name"`
	Symbol            string  `json:"symbol"`
	IndicatorInterval string  `json:"indicator_interval"`
	CandleLimit       int     `json:"candle_limit"`
	AmountOrder       float64 `json:"amount_order"`
	Comission         float64 `json:"comission"`

	EmaRsi         EmaRsi         `json:"emarsi,omitempty"`
	EmaMacdBBorder EmaMacdBBorder `json:"emamacdbborder,omitempty"`
	Klinger        Klinger        `json:"klinger,omitempty"`
}

type TelegramJob

type TelegramJob struct {
	JobInfo

	BotID int64
}

type User

type User struct {
	ID   int64
	Name string
}

Jump to

Keyboard shortcuts

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