Documentation ¶
Index ¶
- Constants
- func BaseDataUpdate(barIndex int, date string, plugins []cache.DataAdapter, op cache.OpKind)
- func CheckOrderState(date string, model models.Strategy, code string, direction trader.Direction) bool
- func CountStrategyOrders(date string, model models.Strategy, direction trader.Direction) int
- func FeaturesUpdate(barIndex *int, cacheDate, featureDate string, plugins []cache.DataAdapter, ...)
- func FetchListForFirstPurchase(date, quantStrategyName string, direction trader.Direction) []string
- func GetResultCachePath() string
- func OutputStatistics(model models.Strategy, date string, v []models.Statistics)
- func PushOrderState(date string, model models.Strategy, code string, direction trader.Direction) error
- type StockPool
- type StrategyStatus
Constants ¶
View Source
const (
StrategiesPath = "quant" // 策略结果数据文件存储路径
)
Variables ¶
This section is empty.
Functions ¶
func BaseDataUpdate ¶ added in v0.2.7
BaseDataUpdate 修复数据
func CheckOrderState ¶ added in v0.7.7
func CheckOrderState(date string, model models.Strategy, code string, direction trader.Direction) bool
CheckOrderState 检查订单执行状态
func CountStrategyOrders ¶ added in v0.7.7
CountStrategyOrders 统计策略订单数
func FeaturesUpdate ¶ added in v0.2.7
func FeaturesUpdate(barIndex *int, cacheDate, featureDate string, plugins []cache.DataAdapter, op cache.OpKind)
FeaturesUpdate 更新特征
func FetchListForFirstPurchase ¶ added in v0.7.9
FetchListForFirstPurchase 获取指定日期交易的个股列表
func GetResultCachePath ¶ added in v0.5.6
func GetResultCachePath() string
GetResultCachePath 获取结果缓存路径
func OutputStatistics ¶ added in v0.5.6
func OutputStatistics(model models.Strategy, date string, v []models.Statistics)
OutputStatistics 输出策略结果
Types ¶
type StockPool ¶ added in v0.6.1
type StockPool struct { Status StrategyStatus `name:"策略状态" dataframe:"status"` Date string `name:"信号日期" dataframe:"date"` Code string `name:"证券代码" dataframe:"code"` Name string `name:"证券名称" dataframe:"name"` Buy float64 `name:"委托价格" dataframe:"buy"` Sell float64 `name:"目标价格" dataframe:"sell"` StrategyCode uint64 `name:"策略编码" dataframe:"strategy_code"` StrategyName string `name:"策略名称" dataframe:"strategy_name"` OrderId int `name:"订单ID" dataframe:"order_id"` OrderStatus int `name:"委托(订单)状态" dataframe:"order_status"` // 订单状态, 0-无效,1-可买入 Active int `name:"活跃度" dataframe:"active"` Speed float64 `name:"涨速" dataframe:"speed"` CreateTime string `name:"创建时间" dataframe:"create_time"` UpdateTime string `name:"更新时间" dataframe:"update_time"` }
StockPool 股票池
type StrategyStatus ¶ added in v0.6.1
type StrategyStatus int
const ( StrategyMiss StrategyStatus = 0x0000 // 策略 - 未命中 StrategyHit StrategyStatus = 0x0001 // 策略 - 命中 StrategyCancel StrategyStatus = 0x0002 // 策略 - 召回 StrategyPassed StrategyStatus = 0x0004 // 策略 - 成功 StrategyOrderPlaced StrategyStatus = 0x0008 // 策略 - 已下单 StrategyOrderSucceeded StrategyStatus = 0x0010 // 策略 - 委托已成功 StrategyOrderFailed StrategyStatus = 0x0020 // 策略 - 委托已失败 StrategyOrderJunk StrategyStatus = 0x0080 // 策略 - 作废 StrategyAlreadyExists StrategyStatus = 0x8000 // 已存在 )
func (*StrategyStatus) IsCancel ¶ added in v0.6.1
func (s *StrategyStatus) IsCancel() bool
IsCancel 是否召回/撤销
func (*StrategyStatus) IsPassed ¶ added in v0.6.1
func (s *StrategyStatus) IsPassed() bool
func (*StrategyStatus) Set ¶ added in v0.6.1
func (s *StrategyStatus) Set(other StrategyStatus, on bool)
Set 设置状态
Click to show internal directories.
Click to hide internal directories.