trader

package
v0.0.0-...-69a75dd Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Executor = make(map[int64]*Global)

	ExchangeMaker = map[string]func(arg interface{}) api.Exchange{
		constant.Okex: api.NewOKEX,
	}
)

Functions

func GetTraderStatus

func GetTraderStatus(id int64) (status int64)

GetTraderStatus ...

func RunBackTesting

func RunBackTesting(id int64, algorithm model.Algorithm) error

func Switch

func Switch(id int64, api []model.ApiConfig) (err error)

Types

type Global

type Global struct {
	model.Trader
	Logger model.Logger //利用这个对象保存日志
	// contains filtered or unexported fields
}

Global ...

func (*Global) AddTask

func (g *Global) AddTask(group otto.Value, fn otto.Value, args ...interface{}) bool

AddTask ...

func (*Global) BindTaskParam

func (g *Global) BindTaskParam(group otto.Value, fn otto.Value, args ...interface{}) bool

BindTaskParam ...

func (*Global) Console

func (g *Global) Console(msgs ...interface{})

Console ...

func (*Global) ExecTasks

func (g *Global) ExecTasks(group otto.Value) (results []interface{})

ExecTasks ...

func (*Global) Log

func (g *Global) Log(msgs ...interface{})

Log ...

func (*Global) LogProfit

func (g *Global) LogProfit(msgs ...interface{})

LogProfit ...

func (*Global) Sleep

func (g *Global) Sleep(intervals ...interface{})

Sleep ...

type Talib

type Talib struct {
}

func (Talib) Bool

func (t Talib) Bool(price []float64, period int) map[string][]float64

func (Talib) Ema

func (t Talib) Ema(prices []float64, period int) interface{}

func (Talib) Ma

func (t Talib) Ma(prices []float64, period int, inMAType talib.MaType) interface{}

func (Talib) Rsi

func (t Talib) Rsi(prices []float64, period int) interface{}

type Tasks

type Tasks map[string][]task

Jump to

Keyboard shortcuts

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