Documentation

Index

Constants

View Source
const (
	//CandleClose -
	CandleClose = iota
	//CandleOpen -
	CandleOpen
	//CandleHigh -
	CandleHigh
	//CandleLow -
	CandleLow
	//CandleTime -
	CandleTime
)
View Source
const (
	//SMA -
	SMA = iota
	//EMA -
	EMA
	//WMA -
	WMA
	//DEMA -
	DEMA
	//TEMA -
	TEMA
	//TRIMA -
	TRIMA
	//KAMA -
	KAMA
	//MAMA -
	MAMA
)
View Source
const (
	//Call -
	Call = iota + 1
	//Put -
	Put
	//Neutral -
	Neutral
)

Variables

View Source
var CandleData = []Candle{
	Candle{ID: 1, Name: "1 Second"},
	Candle{ID: 5, Name: "5 Second"},
	Candle{ID: 10, Name: "10 Second"},
	Candle{ID: 15, Name: "15 Second"},
	Candle{ID: 30, Name: "30 Second"},
	Candle{ID: 60, Name: "1 Minute"},
	Candle{ID: 120, Name: "2 Minute"},
	Candle{ID: 300, Name: "5 Minute"},
}

CandleData -

View Source
var MovingAverageData = []MovingAverage{
	MovingAverage{ID: 0,
		Short: "SMA",
		Name:  "Simple Moving Average"},
	MovingAverage{ID: 1,
		Short: "EMA",
		Name:  "Exponential Moving Average"},
	MovingAverage{ID: 2,
		Short: "WMA",
		Name:  "Weighted Moving Average"},
	MovingAverage{ID: 3,
		Short: "DEMA",
		Name:  "Double Exponential Moving Average"},
	MovingAverage{ID: 4,
		Short: "TEMA",
		Name:  "Triple Exponential Moving Average"},
	MovingAverage{ID: 5,
		Short: "TRIMA",
		Name:  "Triangular Moving Average"},
	MovingAverage{ID: 6,
		Short: "KAMA",
		Name:  "Kaufman Adaptive Moving Average"},
	MovingAverage{ID: 7,
		Short: "MAMA",
		Name:  "MESA Adaptive Moving Average"},
}

MovingAverageData -

View Source
var SourceData = []Source{
	Source{ID: CandleClose, Name: "Close"},
	Source{ID: CandleOpen, Name: "Open"},
	Source{ID: CandleHigh, Name: "High"},
	Source{ID: CandleLow, Name: "Low"},
}

SourceData -

Functions

func CreateHash

func CreateHash(opt map[string]interface{}, ignore map[string]bool) string

CreateHash -

func StringToSignal

func StringToSignal(sig Signal) (s string)

StringToSignal -

Types

type Candle

type Candle struct {
	ID   int
	Name string
}

Candle -

type Group

type Group struct {
	ID         string    `json:"id"`
	StrategyID string    `json:"strategyId"`
	Name       string    `json:"name"`
	Enable     bool      `json:"enable"`
	Default    bool      `json:"default"`
	Created    time.Time `json:"created"`
	Trigger    int       `json:"trigger"`
}

Group -

type Indicator

type Indicator struct {
	Hash    string                 `json:"hash"`
	ID      string                 `json:"id"`
	GroupID string                 `json:"groupId"`
	Name    string                 `json:"name"`
	Options map[string]interface{} `json:"options"`
	Trigger map[int]string         `json:"trigger"`
	Active  bool                   `json:"active"`
}

Indicator -

type MovingAverage

type MovingAverage struct {
	ID    int
	Short string
	Name  string
}

MovingAverage -

type Options

type Options struct {
	Key string
	Val interface{}
}

Options -

type Result

type Result struct {
	Time    time.Time               `json:"time"`
	Value   map[string]interface{}  `json:"value"`
	Trigger map[string]map[int]bool `json:"trigger"`
}

Result -

type Signal

type Signal int

Signal -

func SignalFromString

func SignalFromString(sig string) (s Signal)

SignalFromString -

type Source

type Source struct {
	ID   int
	Name string
}

Source -

type TrainingData

type TrainingData struct {
	Input  []float64
	Output []float64
}

TrainingData -

Source Files