forwardtest

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyAccounts is returned when the accounts are empty.
	ErrEmptyAccounts = errors.New("empty accounts")
	// ErrInvalidExchange is returned when the exchange is invalid.
	ErrInvalidExchange = errors.New("invalid exchange")
)

Functions

This section is empty.

Types

type Forwardtest

type Forwardtest struct {
	ID        uuid.UUID
	UpdatedAt time.Time
	Accounts  map[string]account.Account
	Orders    []order.Order
}

Forwardtest is a forwardtest.

func New

New creates a new forwardtest.

func (*Forwardtest) AddOrder

func (ft *Forwardtest) AddOrder(o order.Order, cs candlestick.Candlestick) error

AddOrder adds an order to the forwardtest.

func (Forwardtest) GetAccountsSymbols

func (ft Forwardtest) GetAccountsSymbols() []string

GetAccountsSymbols returns the list of symbols used in the accounts.

type NewForwardtestParams

type NewForwardtestParams struct {
	Accounts map[string]account.Account
}

NewForwardtestParams is the params for the New function.

func (NewForwardtestParams) Validate

func (np NewForwardtestParams) Validate() error

Validate validates the NewParams.

type Status

type Status struct {
	Balance float64
}

Status is the status of a forwardtest.

Jump to

Keyboard shortcuts

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