event

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 6 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"`
	UnderlyingPair currency.Pair  `json:"underlying"`
	AssetType      asset.Item     `json:"asset"`
	Reasons        []string       `json:"reasons"`
}

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) AppendReasonf

func (b *Base) AppendReasonf(y string, addons ...interface{})

AppendReasonf adds reasoning for a decision being made but with formatting

func (*Base) GetAssetType

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

GetAssetType returns the asset type

func (*Base) GetBase

func (b *Base) GetBase() *Base

GetBase returns the underlying base

func (*Base) GetConcatReasons

func (b *Base) GetConcatReasons() string

GetConcatReasons returns the why

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) GetReasons

func (b *Base) GetReasons() []string

GetReasons returns each individual reason

func (*Base) GetTime

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

GetTime returns the time

func (*Base) GetUnderlyingPair

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

GetUnderlyingPair returns the currency pair

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