trader

package
v0.0.0-...-bc78c8b Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Trader

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

Trader execute operations to buy and sell assets

func NewTrader

func NewTrader(broker domain.Broker) *Trader

NewTrader returns a Trader instance

func (*Trader) Buy

func (t *Trader) Buy(amount, price float32, buyTime time.Time) error

Buy requests broker to buy an asset

func (*Trader) Sell

func (t *Trader) Sell(asset *domain.Asset, price float32, sellTime time.Time) error

Sell requests broker to sell an asset

Jump to

Keyboard shortcuts

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