Documentation ¶
Index ¶
- Variables
- type Backtest
- func (bt *Backtest) AddOrder(ord order.Order, cs candlestick.Candlestick) error
- func (bt *Backtest) Advance() (done bool, err error)
- func (bt *Backtest) CreateTickSubscription(exchange string, pair string) (event.PricesSubscription, error)
- func (bt Backtest) CurrentTime() string
- func (bt Backtest) Done() bool
- func (bt Backtest) MarshalBinary() ([]byte, error)
- func (bt *Backtest) SetCurrentTime(ts time.Time)
- func (bt *Backtest) UnmarshalBinary(data []byte) error
- type CurrentCandlestick
- type Mode
- type NewPayload
- type Parameters
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTickSubscriptionAlreadyExists = errors.New("tick subscription already exists") ErrInvalidExchange = errors.New("invalid exchange") ErrNoDataForOrderValidation = errors.New("no data for order validation") ErrStartAfterEnd = errors.New("start after end") ErrInvalidPricePeriod = errors.New("invalid price period") )
View Source
var (
ErrInvalidMode = errors.New("invalid mode")
)
Functions ¶
This section is empty.
Types ¶
type Backtest ¶
type Backtest struct { ID uuid.UUID `json:"id"` Parameters Parameters `json:"parameters"` CurrentCandlestick CurrentCandlestick `json:"current_candlestick"` Accounts map[string]account.Account `json:"accounts"` PricesSubscriptions []event.PricesSubscription `json:"prices_subscriptions"` Orders []order.Order `json:"orders"` }
func New ¶
func New(payload NewPayload) (Backtest, error)
func (*Backtest) AddOrder ¶
func (bt *Backtest) AddOrder(ord order.Order, cs candlestick.Candlestick) error
func (*Backtest) CreateTickSubscription ¶
func (Backtest) CurrentTime ¶
func (Backtest) MarshalBinary ¶
func (*Backtest) SetCurrentTime ¶
func (*Backtest) UnmarshalBinary ¶
type CurrentCandlestick ¶
type CurrentCandlestick struct { Time time.Time Price candlestick.Price }
Current candlestick based on candlestick step
type NewPayload ¶
type NewPayload struct { Accounts map[string]account.Account StartTime time.Time EndTime *time.Time Mode *Mode PricePeriod *period.Symbol }
func (*NewPayload) EmptyFieldsToDefault ¶
func (payload *NewPayload) EmptyFieldsToDefault() *NewPayload
func (NewPayload) Validate ¶
func (payload NewPayload) Validate() error
Click to show internal directories.
Click to hide internal directories.