exchange

package
v0.0.0-...-a04eff1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitAssetQuote

func SplitAssetQuote(pair string) (asset string, quote string)

Types

type AssetQuote

type AssetQuote struct {
	Quote string
	Asset string
}

type AssetValue

type AssetValue struct {
	Time  time.Time
	Value float64
}

type PaperWallet

type PaperWallet struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewPaperWallet

func NewPaperWallet(ctx context.Context, baseCoin string, options ...PaperWalletOption) *PaperWallet

func (*PaperWallet) Account

func (p *PaperWallet) Account() (model.Account, error)

func (*PaperWallet) AssetValues

func (p *PaperWallet) AssetValues(pair string) []AssetValue

func (*PaperWallet) AssetsInfo

func (p *PaperWallet) AssetsInfo(pair string) model.AssetInfo

func (*PaperWallet) Cancel

func (p *PaperWallet) Cancel(order model.Order) error

func (*PaperWallet) CandlesByLimit

func (p *PaperWallet) CandlesByLimit(ctx context.Context, pair, period string, limit int) ([]model.Candle, error)

func (*PaperWallet) CandlesByPeriod

func (p *PaperWallet) CandlesByPeriod(ctx context.Context, pair, period string,
	start, end time.Time) ([]model.Candle, error)

func (*PaperWallet) CandlesSubscription

func (p *PaperWallet) CandlesSubscription(ctx context.Context, pair, timeframe string) (chan model.Candle, chan error)

func (*PaperWallet) CreateOrderLimit

func (p *PaperWallet) CreateOrderLimit(side model.SideType, pair string,
	size float64, limit float64) (model.Order, error)

func (*PaperWallet) CreateOrderMarket

func (p *PaperWallet) CreateOrderMarket(side model.SideType, pair string, size float64) (model.Order, error)

func (*PaperWallet) CreateOrderMarketQuote

func (p *PaperWallet) CreateOrderMarketQuote(side model.SideType, pair string,
	quoteQuantity float64) (model.Order, error)

func (*PaperWallet) CreateOrderOCO

func (p *PaperWallet) CreateOrderOCO(side model.SideType, pair string,
	size, price, stop, stopLimit float64) ([]model.Order, error)

func (*PaperWallet) CreateOrderStop

func (p *PaperWallet) CreateOrderStop(pair string, size float64, limit float64) (model.Order, error)

func (*PaperWallet) EquityValues

func (p *PaperWallet) EquityValues() []AssetValue

func (*PaperWallet) ID

func (p *PaperWallet) ID() int64

func (*PaperWallet) LastQuote

func (p *PaperWallet) LastQuote(ctx context.Context, pair string) (float64, error)

func (*PaperWallet) MaxDrawdown

func (p *PaperWallet) MaxDrawdown() (float64, time.Time, time.Time)

func (*PaperWallet) OnCandle

func (p *PaperWallet) OnCandle(candle model.Candle)

func (*PaperWallet) Order

func (p *PaperWallet) Order(pair string, id int64) (model.Order, error)

func (*PaperWallet) Pairs

func (p *PaperWallet) Pairs() []string

func (*PaperWallet) Position

func (p *PaperWallet) Position(pair string) (asset, quote float64, err error)

func (*PaperWallet) Summary

func (p *PaperWallet) Summary()

type PaperWalletOption

type PaperWalletOption func(*PaperWallet)

func WithDataFeed

func WithDataFeed(feeder service.Feeder) PaperWalletOption

func WithPaperAsset

func WithPaperAsset(pair string, amount float64) PaperWalletOption

func WithPaperFee

func WithPaperFee(maker, taker float64) PaperWalletOption

Jump to

Keyboard shortcuts

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