backtest

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HistorySnaphsot added in v0.3.1

type HistorySnaphsot struct {
	Price candle.HistoryFloat32

	BuyBestCount  candle.HistoryFloat32
	SellBestCount candle.HistoryFloat32

	BuyBestVolume  candle.HistoryFloat32
	SellBestVolume candle.HistoryFloat32

	BestAsk candle.HistoryFloat32
	BestBid candle.HistoryFloat32

	VolumeClusters []map[float64]float64
}

type Options

type Options struct {
	Symbol            string
	FeeBuy            float32
	FeeSell           float32
	Account           float32
	FramePeriod       int64
	HistoryWindowSize int64
	Limit             float32
}

type Result

type Result struct {
	Account series.Data
	Buy     series.Data
	Sell    series.Data
	Pool    float32
}

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner() *Runner

func (*Runner) Test

func (runner *Runner) Test(ctx context.Context, provider platform.Public, strategy Strategy, opt Options) (result Result, err error)

type Strategy

type Strategy interface {
	Name() string
	BuySignal(snap HistorySnaphsot) bool
	SellSignal(snap HistorySnaphsot) bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL