models

package
v0.0.0-...-65b99db Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: MIT Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Name   string // "Bitcoin"
	Symbol string // "BTC"
}

type Balance

type Balance struct {
	Available float64
	OnOrders  float64
}

func NewBalance

func NewBalance(available float64, onOrders float64) *Balance

type Board

type Board struct {
	Asks []BoardBar `json:"asks"`
	Bids []BoardBar `json:"bids"`
}

func (*Board) AverageAskRate

func (b *Board) AverageAskRate(amount float64) (float64, error)

func (*Board) AverageBidRate

func (b *Board) AverageBidRate(amount float64) (float64, error)

func (*Board) BestAskAmount

func (b *Board) BestAskAmount() float64

func (*Board) BestAskPrice

func (b *Board) BestAskPrice() float64

func (*Board) BestBidAmount

func (b *Board) BestBidAmount() float64

func (*Board) BestBidPrice

func (b *Board) BestBidPrice() float64

type BoardBar

type BoardBar struct {
	Type   OrderType `json:"-"`
	Price  float64   `json:"price"`
	Amount float64   `json:"amount"`
}

type CurrencyPair

type CurrencyPair struct {
	Trading    string `json:"trading"`
	Settlement string `json:"settlement"`
}

type FilledOrderInfo

type FilledOrderInfo struct {
	Price  float64
	Amount float64
}

type Order

type Order struct {
	ExchangeOrderID string
	Type            OrderType
	Trading         string
	Settlement      string
	Price           float64
	Amount          float64
}

type OrderBookTick

type OrderBookTick struct {
	BestAskPrice  float64
	BestAskAmount float64
	BestBidPrice  float64
	BestBidAmount float64
}

type OrderType

type OrderType int
const (
	Ask OrderType = iota
	Bid
)

type Position

type Position int
const (
	Long Position = iota
	Short
)

type Precisions

type Precisions struct {
	PricePrecision  int
	AmountPrecision int
}

Jump to

Keyboard shortcuts

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