ingenium

package module
v0.0.0-...-b8850bc Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 1 Imported by: 6

README

ingenium pkg

The ingenium pkg directory is a library that contains the code common to all components or used in multiple components. For example it contains the definition of all events.

This library is used for developing new components quickly and with correct typing.

Fetch the library with go get github.com/markwinter/ingenium/pkg

Documentation

Index

Constants

View Source
const (
	MARKET             OrderType = "MARKET"
	BUY                Side      = "BUY"
	SELL               Side      = "SELL"
	SignalLong         Signal    = "ingenium.signal.long"
	SignalShort        Signal    = "ingenium.signal.short"
	DataEventType                = "ingenium.ingestor.data"
	SignalEventType              = "ingenium.strategy.signal"
	OrderEventType               = "ingenium.portfolio.order"
	ExecutionEventType           = "ingenium.executor.execution"

	DataTypeOhlc = "data.type.ohlc"
)
View Source
const (
	TimestampFormat = "2006-01-02T15:00:00"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataEvent

type DataEvent struct {
	Type      DataType
	Symbol    string
	Timestamp time.Time
	Ohlc      DataOhlc `json:",omitempty"`
}

type DataOhlc

type DataOhlc struct {
	Open      string
	High      string
	Low       string
	Close     string
	Volume    string
	Period    string // Period defines the time range of this data e.g. 5 min candle
	Timestamp time.Time
}

type DataType

type DataType string

type ExecutionEvent

type ExecutionEvent struct {
	OrderId   string
	Quantity  string
	Symbol    string
	Timestamp time.Time
}

type Executor

type Executor interface {
	Run()
	Cleanup()
}

type Ingestor

type Ingestor interface {
	Cleanup()
	IngestData()
}

type OrderEvent

type OrderEvent struct {
	Id        string
	Timestamp time.Time

	Side     Side
	Quantity string
	Symbol   string
	Type     OrderType
}

type OrderType

type OrderType string

type Portfolio

type Portfolio interface {
	Run()
	Cleanup()
	ReceiveSignal(*SignalEvent)
	ReceiveExecution(*ExecutionEvent)
}

type Side

type Side string

type Signal

type Signal string

type SignalEvent

type SignalEvent struct {
	Symbol    string
	Signal    Signal
	Timestamp time.Time
}

type Strategy

type Strategy interface {
	Run()
	Cleanup()
	Receive(*DataEvent)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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