Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToAccountModels ¶
ToAccountModels transforms account entities to account models.
func ToOrderModels ¶
ToOrderModels converts a slice of entities to a slice of models.
func ToTickSubscriptionModels ¶
func ToTickSubscriptionModels(entities []TickSubscription) []tick.Subscription
ToTickSubscriptionModels converts a slice of entities to a slice of models.
Types ¶
type Backtest ¶
Backtest is the entity for a backtest.
func FromBacktestModel ¶
FromBacktestModel converts a model into an entity.
type BacktestData ¶
type BacktestData struct {
Parameters Parameters `json:"parameters"`
CurrentTime time.Time `json:"current_time"`
CurrentPriceType string `json:"current_price_type"`
Balances []Balance `json:"balances"`
Orders []Order `json:"orders"`
TickSubscriptions []TickSubscription `json:"tick_subscriptions"`
}
BacktestData is the entity for the backtest data.
type Balance ¶
type Balance struct {
AssetName string `json:"asset_name"`
Exchange string `json:"exchange"`
Balance float64 `json:"balance"`
}
Balance is the entity for a balance.
type Order ¶
type Order struct {
ID string `json:"id"`
ExecutionTime *time.Time `json:"execution_time"`
Type string `json:"type"`
Exchange string `json:"exchange"`
Pair string `json:"pair"`
Side string `json:"side"`
Quantity float64 `json:"quantity"`
Price float64 `json:"price"`
}
Order is the entity for an order.
func FromOrderModel ¶
FromOrderModel converts a model into an entity.
func FromOrderModels ¶
FromOrderModels converts a slice of models into a slice of entities.
type Parameters ¶
type Parameters struct {
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
Mode string `json:"mode"`
PricePeriod string `json:"price_period"`
}
Parameters is the entity for the parameters of a backtest.
type TickSubscription ¶
TickSubscription is the entity for a tick subscription.
func FromTickSubscriptionModel ¶
func FromTickSubscriptionModel(m tick.Subscription) TickSubscription
FromTickSubscriptionModel converts a model to an entity.
func FromTickSubscriptionModels ¶
func FromTickSubscriptionModels(models []tick.Subscription) []TickSubscription
FromTickSubscriptionModels converts a slice of models to a slice of entities.
func (TickSubscription) ToModel ¶
func (ts TickSubscription) ToModel() tick.Subscription
ToModel converts the entity to a model.