models

package
v0.0.0-...-fa4f1ae Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IIndicator

type IIndicator interface {
	GetID() string
	GetName() string
	SetCallback(*StrategyCallback)
	Run() (IndicatorResults, error)
}

IIndicator -

type Indicator

type Indicator struct {
	IIndicator
}

Indicator -

type IndicatorOptions

type IndicatorOptions struct {
	Candle                 int                    `json:"candle"`
	CalculationEverySecond bool                   `json:"calculationEverySecond"`
	FullResults            bool                   `json:"fullResults"`
	Others                 map[string]interface{} `json:"others"`
	Triggers               IndicatorTrigger       `json:"triggers"`
}

type IndicatorResults

type IndicatorResults struct {
	Values    interface{}     `json:"values"`
	Signal    IndicatorSignal `json:"signal"`
	TriggerBy int             `json:"triggerBy"`
	Others    interface{}     `json:"others"`
}

type IndicatorSignal

type IndicatorSignal int

IndicatorSignal -

const (
	IndicatorSignalCall IndicatorSignal = iota + 1
	IndicatorSignalPut
	IndicatorSignalNeutral
)

type IndicatorTrigger

type IndicatorTrigger struct {
	Call []int `json:"call"`
	Put  []int `json:"put"`
}

type Indicators

type Indicators struct {
	ID      string           `json:"id"`
	Options IndicatorOptions `json:"options"`
}

Indicators -

type IndicatorsGroup

type IndicatorsGroup struct {
	ID            string       `json:"id"`
	Name          string       `json:"name"`
	Indicators    []Indicators `json:"indicators"`
	SignalTrigger int          `json:"signalTrigger"`
}

IndicatorsGroup -

type Strategy

type Strategy struct {
	ID    string            `json:"id"`
	Name  string            `json:"name"`
	Group []IndicatorsGroup `json:"group"`
}

Strategy -

type StrategyCallback

type StrategyCallback struct {
	GetCandleData func(int, models.Candles) []float64
}

StrategyCallback -

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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