fmaker

package
v1.44.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: AGPL-3.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const ID = "fmaker"

Variables

This section is empty.

Functions

func KLineAmplitudeMapper

func KLineAmplitudeMapper(k types.KLine) float64

func KLineHighPriceMapper

func KLineHighPriceMapper(k types.KLine) float64

func KLineLowPriceMapper

func KLineLowPriceMapper(k types.KLine) float64

Types

type A18

type A18 struct {
	types.IntervalWindow

	// Values
	Values floats.Slice

	EndTime time.Time

	UpdateCallbacks []func(val float64)
}

func (*A18) Bind

func (inc *A18) Bind(updater indicator.KLineWindowUpdater)

func (*A18) CalculateAndUpdate added in v1.37.0

func (inc *A18) CalculateAndUpdate(klines []types.KLine)

func (*A18) EmitUpdate

func (inc *A18) EmitUpdate(val float64)

func (*A18) Last

func (inc *A18) Last() float64

func (*A18) OnUpdate

func (inc *A18) OnUpdate(cb func(val float64))

type A2

type A2 struct {
	types.IntervalWindow

	// Values
	Values floats.Slice

	EndTime time.Time

	UpdateCallbacks []func(val float64)
}

func (*A2) Bind

func (inc *A2) Bind(updater indicator.KLineWindowUpdater)

func (*A2) CalculateAndUpdate added in v1.37.0

func (inc *A2) CalculateAndUpdate(klines []types.KLine)

func (*A2) EmitUpdate

func (inc *A2) EmitUpdate(val float64)

func (*A2) Last

func (inc *A2) Last() float64

func (*A2) OnUpdate

func (inc *A2) OnUpdate(cb func(val float64))

type A3

type A3 struct {
	types.IntervalWindow

	// Values
	Values floats.Slice

	EndTime time.Time

	UpdateCallbacks []func(val float64)
}

func (*A3) Bind

func (inc *A3) Bind(updater indicator.KLineWindowUpdater)

func (*A3) CalculateAndUpdate added in v1.37.0

func (inc *A3) CalculateAndUpdate(klines []types.KLine)

func (*A3) EmitUpdate

func (inc *A3) EmitUpdate(val float64)

func (*A3) Last

func (inc *A3) Last() float64

func (*A3) OnUpdate

func (inc *A3) OnUpdate(cb func(val float64))

type A34

type A34 struct {
	types.IntervalWindow

	// Values
	Values floats.Slice

	EndTime time.Time

	UpdateCallbacks []func(val float64)
}

func (*A34) Bind

func (inc *A34) Bind(updater indicator.KLineWindowUpdater)

func (*A34) CalculateAndUpdate added in v1.37.0

func (inc *A34) CalculateAndUpdate(klines []types.KLine)

func (*A34) EmitUpdate

func (inc *A34) EmitUpdate(val float64)

func (*A34) Last

func (inc *A34) Last() float64

func (*A34) OnUpdate

func (inc *A34) OnUpdate(cb func(val float64))

type IntervalWindowSetting

type IntervalWindowSetting struct {
	types.IntervalWindow
}

type KLineValueMapper

type KLineValueMapper func(k types.KLine) float64

type R

type R struct {
	types.IntervalWindow

	// Values
	Values floats.Slice

	EndTime time.Time

	UpdateCallbacks []func(val float64)
}

func (*R) Bind

func (inc *R) Bind(updater indicator.KLineWindowUpdater)

func (*R) CalculateAndUpdate added in v1.37.0

func (inc *R) CalculateAndUpdate(klines []types.KLine)

func (*R) EmitUpdate

func (inc *R) EmitUpdate(val float64)

func (*R) Last

func (inc *R) Last() float64

func (*R) OnUpdate

func (inc *R) OnUpdate(cb func(val float64))

type S0

type S0 struct {
	types.IntervalWindow

	// Values
	Values floats.Slice

	EndTime time.Time

	UpdateCallbacks []func(val float64)
}

func (*S0) Bind

func (inc *S0) Bind(updater indicator.KLineWindowUpdater)

func (*S0) CalculateAndUpdate added in v1.37.0

func (inc *S0) CalculateAndUpdate(klines []types.KLine)

func (*S0) EmitUpdate

func (inc *S0) EmitUpdate(val float64)

func (*S0) Last

func (inc *S0) Last() float64

func (*S0) OnUpdate

func (inc *S0) OnUpdate(cb func(val float64))

type S1

type S1 struct {
	types.IntervalWindow
	Values  floats.Slice
	EndTime time.Time

	UpdateCallbacks []func(value float64)
}

func (*S1) Bind

func (inc *S1) Bind(updater indicator.KLineWindowUpdater)

func (*S1) CalculateAndUpdate added in v1.37.0

func (inc *S1) CalculateAndUpdate(klines []types.KLine)

func (*S1) EmitUpdate

func (inc *S1) EmitUpdate(value float64)

func (*S1) Last

func (inc *S1) Last() float64

func (*S1) OnUpdate

func (inc *S1) OnUpdate(cb func(value float64))

type S2

type S2 struct {
	types.IntervalWindow
	Values  floats.Slice
	EndTime time.Time

	UpdateCallbacks []func(value float64)
}

func (*S2) Bind

func (inc *S2) Bind(updater indicator.KLineWindowUpdater)

func (*S2) CalculateAndUpdate added in v1.37.0

func (inc *S2) CalculateAndUpdate(klines []types.KLine)

func (*S2) EmitUpdate

func (inc *S2) EmitUpdate(value float64)

func (*S2) Last

func (inc *S2) Last() float64

func (*S2) OnUpdate

func (inc *S2) OnUpdate(cb func(value float64))

type S3

type S3 struct {
	types.IntervalWindow

	// Values
	Values floats.Slice

	EndTime time.Time

	UpdateCallbacks []func(val float64)
}

func (*S3) Bind

func (inc *S3) Bind(updater indicator.KLineWindowUpdater)

func (*S3) CalculateAndUpdate added in v1.37.0

func (inc *S3) CalculateAndUpdate(klines []types.KLine)

func (*S3) EmitUpdate

func (inc *S3) EmitUpdate(val float64)

func (*S3) Last

func (inc *S3) Last() float64

func (*S3) OnUpdate

func (inc *S3) OnUpdate(cb func(val float64))

type S4

type S4 struct {
	types.IntervalWindow

	// Values
	Values floats.Slice

	EndTime time.Time

	UpdateCallbacks []func(val float64)
}

func (*S4) Bind

func (inc *S4) Bind(updater indicator.KLineWindowUpdater)

func (*S4) CalculateAndUpdate added in v1.37.0

func (inc *S4) CalculateAndUpdate(klines []types.KLine)

func (*S4) EmitUpdate

func (inc *S4) EmitUpdate(val float64)

func (*S4) Last

func (inc *S4) Last() float64

func (*S4) OnUpdate

func (inc *S4) OnUpdate(cb func(val float64))

type S5

type S5 struct {
	types.IntervalWindow

	// Values
	Values floats.Slice

	EndTime time.Time

	UpdateCallbacks []func(val float64)
}

func (*S5) Bind

func (inc *S5) Bind(updater indicator.KLineWindowUpdater)

func (*S5) CalculateAndUpdate added in v1.37.0

func (inc *S5) CalculateAndUpdate(klines []types.KLine)

func (*S5) EmitUpdate

func (inc *S5) EmitUpdate(val float64)

func (*S5) Last

func (inc *S5) Last() float64

func (*S5) OnUpdate

func (inc *S5) OnUpdate(cb func(val float64))

type S6

type S6 struct {
	types.IntervalWindow

	// Values
	Values floats.Slice

	EndTime time.Time

	UpdateCallbacks []func(val float64)
}

func (*S6) Bind

func (inc *S6) Bind(updater indicator.KLineWindowUpdater)

func (*S6) CalculateAndUpdate added in v1.37.0

func (inc *S6) CalculateAndUpdate(klines []types.KLine)

func (*S6) EmitUpdate

func (inc *S6) EmitUpdate(val float64)

func (*S6) Last

func (inc *S6) Last() float64

func (*S6) OnUpdate

func (inc *S6) OnUpdate(cb func(val float64))

type S7

type S7 struct {
	types.IntervalWindow

	// Values
	Values floats.Slice

	EndTime time.Time

	UpdateCallbacks []func(val float64)
}

func (*S7) Bind

func (inc *S7) Bind(updater indicator.KLineWindowUpdater)

func (*S7) CalculateAndUpdate added in v1.37.0

func (inc *S7) CalculateAndUpdate(klines []types.KLine)

func (*S7) EmitUpdate

func (inc *S7) EmitUpdate(val float64)

func (*S7) Last

func (inc *S7) Last() float64

func (*S7) OnUpdate

func (inc *S7) OnUpdate(cb func(val float64))

type Strategy

type Strategy struct {
	Environment *bbgo.Environment
	Symbol      string `json:"symbol"`
	Market      types.Market
	Interval    types.Interval   `json:"interval"`
	Quantity    fixedpoint.Value `json:"quantity"`

	// persistence fields
	Position    *types.Position    `json:"position,omitempty" persistence:"position"`
	ProfitStats *types.ProfitStats `json:"profitStats,omitempty" persistence:"profit_stats"`

	Spread fixedpoint.Value `json:"spread" persistence:"spread"`

	bbgo.QuantityOrAmount

	S0 *S0
	S1 *S1
	S2 *S2
	S3 *S3
	S4 *S4
	S5 *S5
	S6 *S6
	S7 *S7

	A2  *A2
	A3  *A3
	A18 *A18
	A34 *A34

	R *R

	// StrategyController
	bbgo.StrategyController
	// contains filtered or unexported fields
}

func (*Strategy) ClosePosition

func (s *Strategy) ClosePosition(ctx context.Context, percentage fixedpoint.Value) error

func (*Strategy) ID

func (s *Strategy) ID() string

func (*Strategy) InstanceID

func (s *Strategy) InstanceID() string

func (*Strategy) Run

func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error

func (*Strategy) Subscribe

func (s *Strategy) Subscribe(session *bbgo.ExchangeSession)

Jump to

Keyboard shortcuts

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