Documentation ¶
Index ¶
- Constants
- func NewCore(enc zapcore.Encoder, ws zapcore.WriteSyncer, enab zapcore.LevelEnabler) zapcore.Core
- type Backtest
- type BtLogger
- func (l *BtLogger) Debug(args ...interface{})
- func (l *BtLogger) Debugf(template string, args ...interface{})
- func (l *BtLogger) Debugw(msg string, keysAndValues ...interface{})
- func (l *BtLogger) Error(args ...interface{})
- func (l *BtLogger) Errorf(template string, args ...interface{})
- func (l *BtLogger) Errorw(msg string, keysAndValues ...interface{})
- func (l *BtLogger) Info(args ...interface{})
- func (l *BtLogger) Infof(template string, args ...interface{})
- func (l *BtLogger) Infow(msg string, keysAndValues ...interface{})
- func (l *BtLogger) Sync()
- func (l *BtLogger) Warn(args ...interface{})
- func (l *BtLogger) Warnf(template string, args ...interface{})
- func (l *BtLogger) Warnw(msg string, keysAndValues ...interface{})
- type DataState
- type GetCurrentTime
- type PlotData
- type SOrder
Constants ¶
View Source
const ( OriginEChartsJs = "https://go-echarts.github.io/go-echarts-assets/assets/echarts.min.js" MyEChartsJs = "https://cdnjs.cloudflare.com/ajax/libs/echarts/4.7.0/echarts.min.js" OriginEChartsBulmaCss = "https://go-echarts.github.io/go-echarts-assets/assets/bulma.min.css" MyEChartsBulmaCss = "https://cdnjs.cloudflare.com/ajax/libs/bulma/0.8.2/css/bulma.min.css" )
View Source
const (
LogTsKey = "log_ts"
)
View Source
const SimpleDateTimeFormat = "2006-01-02 15:04:05.000"
Variables ¶
This section is empty.
Functions ¶
func NewCore ¶ added in v1.1.10
func NewCore(enc zapcore.Encoder, ws zapcore.WriteSyncer, enab zapcore.LevelEnabler) zapcore.Core
NewCore creates a Core that writes logs to a WriteSyncer.
Types ¶
type Backtest ¶
type Backtest struct {
// contains filtered or unexported fields
}
func NewBacktest ¶
func NewBacktest(datas []*dataloader.Data, symbol string, start time.Time, end time.Time, strategy Strategy, exchanges []ExchangeSim, outputDir string) *Backtest
NewBacktest Create backtest data: The data outputDir: 日志输出目录
func (*Backtest) ComputeStats ¶
func (b *Backtest) ComputeStats() (result *Stats)
ComputeStats Calculating Backtest Statistics
func (*Backtest) HtmlReport ¶ added in v1.1.13
func (b *Backtest) HtmlReport()
HTMLReport 创建Html报告文件
func (*Backtest) SetDatas ¶ added in v1.2.2
func (b *Backtest) SetDatas(datas []*dataloader.Data)
SetData Set data for backtest
type BtLogger ¶ added in v1.1.10
type BtLogger struct { Path string // 文件路径,如:./app.log Level string // 日志输出的级别 MaxFileSize int // 日志文件大小的最大值,单位(M) MaxBackups int // 最多保留备份数 MaxAge int // 日志文件保存的时间,单位(天) Compress bool // 是否压缩 Caller bool // 日志是否需要显示调用位置 JsonFormat bool // 是否以Json格式输出 Stdout bool // 是否输出到控制台 // contains filtered or unexported fields }
func NewBtLogger ¶ added in v1.1.10
type GetCurrentTime ¶ added in v1.1.10
type SOrder ¶ added in v1.2.0
type SOrder struct { Ts time.Time // ts: 2019-10-02T07:03:53.584+0800 Order *Order // order OrderBook *OrderBook // orderbook Positions []*Position // positions Balances []float64 // balances Comment string // msg: Place order/Match order }
SOrder "event":"order"/"deal"
func (*SOrder) BalancesString ¶ added in v1.2.4
Click to show internal directories.
Click to hide internal directories.