wallet

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: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	USDT = iota
	BTC
	ETH

	CandleLimit = 1000
)

Variables

View Source
var Strategies = map[string]Strategy{
	"kov":     strategy.NewKOV(13, 200),
	"ema":     strategy.NewEMATest(13),
	"first":   strategy.NewFirst(200, 10, 50, 9, 20),
	"elliott": strategy.NewElliott(5, 5, 8, 8, 8),
}

Functions

This section is empty.

Types

type Currency

type Currency int

type Result

type Result struct {
	StrategyName string

	Amount      float64
	High        float64
	Low         float64
	Open        float64
	CurrentOpen float64
	Close       float64
	Volume      float64
	Signal      strategy.Signal
	StartTime   time.Time
	EndTime     time.Time
}

type Strategy

type Strategy interface {
	Update(candles ...*strategy.Candle) strategy.Signal
}

type Wallet

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

func New

func New(ctx context.Context, settings *models.Settings) *Wallet

func (*Wallet) Add

func (w *Wallet) Add(closePrice, amount, comission float64)

func (*Wallet) AddCurrency

func (w *Wallet) AddCurrency(currency Currency)

func (*Wallet) AmountUSD

func (w *Wallet) AmountUSD() float64

func (*Wallet) Currencies

func (w *Wallet) Currencies() []Currency

func (*Wallet) ExchangeTest

func (w *Wallet) ExchangeTest(ctx context.Context, startTime, endTime time.Time, strat Strategy) ([]Result, error)

func (*Wallet) Sub

func (w *Wallet) Sub(closePrice, amount, comission float64)

Jump to

Keyboard shortcuts

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