strategy

package
v0.0.0-...-46f0560 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	// contains filtered or unexported fields
}

func NewBot

func NewBot(url string, cfg BotConfig) *Bot

type BotConfig

type BotConfig struct {
	Token        string
	PriceForBuy  Price
	PriceForSell Price
	Interval     time.Duration
}

type Price

type Price interface {
	GetPrice() int64
}

type RandomPrice

type RandomPrice struct {
	// contains filtered or unexported fields
}

func NewRandomPrice

func NewRandomPrice(minPrice, maxPrice int64) *RandomPrice

func (*RandomPrice) GetPrice

func (p *RandomPrice) GetPrice() int64

type SimpleStrategy

type SimpleStrategy struct {
	// contains filtered or unexported fields
}

func NewSimpleStrategy

func NewSimpleStrategy(cfg SimpleStrategyConfig) *SimpleStrategy

func (*SimpleStrategy) StartBot

func (s *SimpleStrategy) StartBot(cancelFunc context.CancelFunc)

type SimpleStrategyConfig

type SimpleStrategyConfig struct {
	Url          string
	Token        string
	PriceForBuy  int64
	PriceForSell int64
	Interval     time.Duration
	WorkTime     time.Duration
}

type StaticPrice

type StaticPrice struct {
	// contains filtered or unexported fields
}

func NewStaticPrice

func NewStaticPrice(price int64) *StaticPrice

func (*StaticPrice) GetPrice

func (p *StaticPrice) GetPrice() int64

type Strategy

type Strategy interface {
	StartBot(cancelFunc context.CancelFunc)
}

type TwoBotStrategy

type TwoBotStrategy struct {
	// contains filtered or unexported fields
}

func NewTwoBotStrategy

func NewTwoBotStrategy(cfg TwoBotStrategyConfig) *TwoBotStrategy

func (*TwoBotStrategy) StartBot

func (t *TwoBotStrategy) StartBot(cancelFunc context.CancelFunc)

type TwoBotStrategyConfig

type TwoBotStrategyConfig struct {
	Url       string
	FirstBot  BotConfig
	SecondBot BotConfig
	WorkTime  time.Duration
}

Jump to

Keyboard shortcuts

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