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") )
View Source
var ( // ErrInvalidStatus is returned when the status is invalid. ErrInvalidStatus = errors.New("invalid status") )
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
Callbacks runtime.Callbacks
Status Status
}
Forwardtest is a forwardtest.
func New ¶
func New(params NewForwardtestParams) (Forwardtest, error)
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
Callbacks runtime.Callbacks
}
NewForwardtestParams is the params for the New function.
func (NewForwardtestParams) Validate ¶
func (np NewForwardtestParams) Validate() error
Validate validates the NewParams.
type Status ¶
type Status string
Status represents the status of a forwardtest.
const ( // StatusReady indicates that the forwardtest is ready to start. StatusReady Status = "ready" // StatusRunning indicates that the forwardtest is currently running. StatusRunning Status = "running" // StatusFinished indicates that the forwardtest has finished. StatusFinished Status = "finished" )
Click to show internal directories.
Click to hide internal directories.