Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Oms *OMS Port *portfolio.Portfolio // ErrInvalidFileGlob indiciates that no files could be found from given glob ErrInvalidFileGlob = errors.New("No files could be found from file glob") // ErrInvalidFileDelim is thrown when file delimiter is not able to be parsed ErrInvalidFileDelim = errors.New("File delimiter could not be parsed") )
var ( // ErrNegativeVolume indicates that the processed order // has too high of a volume to act upon. ErrNegativeVolume = errors.New("not enough volume to fill order") )
var ( // ErrOrderNotValid indicates that an order is not valid, and should not be sent to the pipeline. ErrOrderNotValid = errors.New("Order does not meet criteria as a valid order") )
Functions ¶
This section is empty.
Types ¶
type Algorithm ¶
type Algorithm interface { EntryCheck(instrument.Quote) (*order.Order, error) ExitCheck(order.Order, instrument.Tick) (*order.Order, error) }
Algorithm is an interface that needs to be implemented in the pipeline by a user to fill orders based on the conditions that they specify.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents data stored in a container.
type OMS ¶
type OMS struct {
// contains filtered or unexported fields
}
OMS acts as an `Order Management System` to test trading signals and fill orders.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue is an implementation of a FIFO container type.
type Simulation ¶
type Simulation struct {
// contains filtered or unexported fields
}
Simulation embeds all data structs necessary for running a backtest of an algorithmic strategy.
func NewSimulation ¶
func NewSimulation(file string) (*Simulation, error)
NewSimulation is a constructor for the Simulation data type, and a pre-processor function for the embedded types.
func (*Simulation) Run ¶
func (sim *Simulation) Run() error
Run acts as the simulation's primary pipeline function; directing everything to where it needs to go.
type Strategy ¶
type Strategy struct {
Algorithm Algorithm
}
Strategy ...
func NewStrategy ¶
NewStrategy creates a new Strategy instance used in the backtesting process.
func (Strategy) CheckEntryLogic ¶
CheckEntryLogic ...TODO
func (Strategy) CheckExitLogic ¶
func (s Strategy) CheckExitLogic(o order.Order, t instrument.Tick) (exitOrder *order.Order, err error)
CheckExitLogic ...TODO