44 lines
1.7 KiB
Go
44 lines
1.7 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
type StrategyParameters struct {
|
|
Screening *ScreeningParameters `json:"screening,omitempty"`
|
|
ShortWindow int `json:"short_window"`
|
|
LongWindow int `json:"long_window"`
|
|
FeeBPS int `json:"fee_bps"`
|
|
SlippageBPS int `json:"slippage_bps"`
|
|
LotSize int64 `json:"lot_size"`
|
|
}
|
|
type Strategy struct {
|
|
ID string `db:"id" json:"id"`
|
|
Code string `db:"code" json:"code"`
|
|
Name string `db:"name" json:"name"`
|
|
Status string `db:"status" json:"status"`
|
|
LatestRevision int `db:"latest_revision" json:"latest_revision"`
|
|
ActiveVersionID *string `db:"active_version_id" json:"active_version_id"`
|
|
Version int64 `db:"version" json:"version"`
|
|
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
|
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
|
|
}
|
|
|
|
func (Strategy) TableName() string { return "veyra_strategy" }
|
|
|
|
type StrategyVersion struct {
|
|
ID string `db:"id" json:"id"`
|
|
StrategyID string `db:"strategy_id" json:"strategy_id"`
|
|
Revision int `db:"revision" json:"revision"`
|
|
Algorithm string `db:"algorithm" json:"algorithm"`
|
|
Parameters StrategyParameters `db:"parameters" json:"parameters"`
|
|
Description string `db:"description" json:"description"`
|
|
AuthorID string `db:"author_id" json:"author_id"`
|
|
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
|
}
|
|
|
|
func (StrategyVersion) TableName() string { return "veyra_strategy_version" }
|
|
|
|
type StrategyDetail struct {
|
|
Strategy
|
|
Versions []StrategyVersion `json:"versions"`
|
|
}
|