tick

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: GPL-3.0 Imports: 5 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Subscription

type Subscription struct {
	Exchange string `json:"exchange"`
	Pair     string `json:"pair"`
}

Subscription is the struct for a tick subscription.

type Tick

type Tick struct {
	Time     time.Time `json:"time"`
	Pair     string    `json:"pair"`
	Price    float64   `json:"price"`
	Exchange string    `json:"exchange"`
}

Tick is the struct that will handle the ticks.

func FromCandlestick

func FromCandlestick(
	exchange, pair string,
	currentPriceType candlestick.PriceType,
	t time.Time,
	cs candlestick.Candlestick,
) Tick

FromCandlestick creates a Tick from a candlestick.

func OnlyKeepEarliestSameTime

func OnlyKeepEarliestSameTime(originals []Tick, endTime time.Time) (earliestTime time.Time, filtered []Tick)

OnlyKeepEarliestSameTime returns the earliest time and the ticks that have the same time as the earliest time.

func (Tick) MarshalBinary

func (t Tick) MarshalBinary() ([]byte, error)

MarshalBinary marshals a Tick into a byte slice.

func (Tick) String

func (t Tick) String() string

String returns a string representation of a Tick.

func (*Tick) UnmarshalBinary

func (t *Tick) UnmarshalBinary(data []byte) error

UnmarshalBinary unmarshals a byte slice into a Tick.

Jump to

Keyboard shortcuts

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