trade

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteTrades

func DeleteTrades(trades ...Data) error

DeleteTrades will remove trades from the database using trade.Data

func Insert

func Insert(trades ...Data) error

Insert saves trade data to the database

func VerifyTradeInIntervals

func VerifyTradeInIntervals(exchangeName, assetType, base, quote string, irh *kline.IntervalRangeHolder) error

VerifyTradeInIntervals will query for ONE trade within each kline interval and verify if data exists if it does, it will set the range holder property "HasData" to true

Types

type Data

type Data struct {
	ID             string
	TID            string
	Exchange       string
	ExchangeNameID string
	Base           string
	Quote          string
	AssetType      string
	Price          float64
	Amount         float64
	Side           string
	Timestamp      time.Time
}

Data defines trade data in its simplest db friendly form

func GetByUUID

func GetByUUID(uuid string) (td Data, err error)

GetByUUID returns a trade by its unique ID

func GetInRange

func GetInRange(exchangeName, assetType, base, quote string, startDate, endDate time.Time) (td []Data, err error)

GetInRange returns all trades by an exchange in a date range

Jump to

Keyboard shortcuts

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