eventholder

package
v0.0.0-...-219ed90 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 2 Imported by: 3

README

GoCryptoTrader Backtester: Eventholder package

Build Status Software License GoDoc Coverage Status Go Report Card

This eventholder package is part of the GoCryptoTrader codebase.

This is still in active development

You can track ideas, planned features and what's in progress on our GoCryptoTrader Kanban board.

Join our slack to discuss all things related to GoCryptoTrader! GoCryptoTrader Slack

Eventholder package overview

The event holder is a simple interface implementation which allows the backtester to iterate over the event queue. The event holder is based on the EventHolder interface and is implemented by Holder. It is used by backtest.Backtester and it accepts appending any struct which implements the common.EventHandler interface, eg order.Order

Please click GoDocs chevron above to view current GoDoc information for this package

Contribution

Please feel free to submit any pull requests or suggest any desired features to be added.

When submitting a PR, please abide by our coding guidelines:

  • Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
  • Code must be documented adhering to the official Go commentary guidelines.
  • Code must adhere to our coding style.
  • Pull requests need to be based on and opened against the master branch.

Donations

If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to:

bc1qk0jareu4jytc0cfrhr5wgshsq8282awpavfahc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventHolder

type EventHolder interface {
	Reset() error
	AppendEvent(common.Event)
	NextEvent() common.Event
}

EventHolder interface details what is expected of an event holder to perform

type Holder

type Holder struct {
	Queue []common.Event
}

Holder contains the event queue for backtester processing

func (*Holder) AppendEvent

func (h *Holder) AppendEvent(i common.Event)

AppendEvent adds and event to the queue

func (*Holder) NextEvent

func (h *Holder) NextEvent() (i common.Event)

NextEvent removes the current event and returns the next event in the queue

func (*Holder) Reset

func (h *Holder) Reset() error

Reset returns struct to defaults

Jump to

Keyboard shortcuts

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