event

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: MIT Imports: 4 Imported by: 0

README

GoCryptoTrader Backtester: Event package

Build Status Software License GoDoc Coverage Status Go Report Card

This event 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 this Trello board: https://trello.com/b/ZAhMhpOy/gocryptotrader.

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

Event package overview

The event event type is an important base for all other events. It allows for consistent information to be used across all events in order to track and make decisions. Any information that is shared between events should be added to this struct

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 Base

type Base struct {
	Offset       int64          `json:"-"`
	Exchange     string         `json:"exchange"`
	Time         time.Time      `json:"timestamp"`
	Interval     kline.Interval `json:"interval-size"`
	CurrencyPair currency.Pair  `json:"pair"`
	AssetType    asset.Item     `json:"asset"`
	Reason       string         `json:"reason"`
}

Base is the underlying event across all actions that occur for the backtester Data, fill, order events all contain the base event and store important and consistent information

func (*Base) AppendReason

func (b *Base) AppendReason(y string)

AppendReason adds reasoning for a decision being made

func (*Base) GetAssetType

func (b *Base) GetAssetType() asset.Item

GetAssetType returns the asset type

func (*Base) GetExchange

func (b *Base) GetExchange() string

GetExchange returns the exchange

func (*Base) GetInterval

func (b *Base) GetInterval() kline.Interval

GetInterval returns the interval

func (*Base) GetOffset

func (b *Base) GetOffset() int64

GetOffset returns the offset

func (*Base) GetReason

func (b *Base) GetReason() string

GetReason returns the why

func (*Base) GetTime

func (b *Base) GetTime() time.Time

GetTime returns the time

func (*Base) IsEvent

func (b *Base) IsEvent() bool

IsEvent returns whether the event is an event

func (*Base) Pair

func (b *Base) Pair() currency.Pair

Pair returns the currency pair

func (*Base) SetOffset

func (b *Base) SetOffset(o int64)

SetOffset sets the offset

Jump to

Keyboard shortcuts

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