tsprovider

package
v0.0.0-...-66232a0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TdiCsvToTrd

func TdiCsvToTrd(csv []string) (gopeat.TimeStamper, error)

TdiCsvToTrd converts a csv line slice in TickData's (www.tickdata.com) format to a Trade Value Symbol,Date,Time,Price,Volume ESU13,09/01/2013,17:00:00.083,1640.25,8

Types

type StaticTradesSource

type StaticTradesSource struct {
	Symbol      string
	TotalTrades int
	// contains filtered or unexported fields
}

StaticTradesSource generates random timed trades starting at start time and stopping when the total number of records reaches TotalTrades

func (*StaticTradesSource) Next

func (st *StaticTradesSource) Next() (gopeat.TimeStamper, bool)

Next implements an iterator for the contents of the csv data

func (*StaticTradesSource) SetEndTime

func (st *StaticTradesSource) SetEndTime(endTime time.Time)

SetEndTime sets max timpstamp for data provided

func (*StaticTradesSource) SetStartTime

func (st *StaticTradesSource) SetStartTime(startTime time.Time)

SetStartTime sets min timpstamp for data provided

type Trade

type Trade struct {
	Tim time.Time
	Vol int
	Amt float64
}

Trade is a sale of a security at a time

func (Trade) GetTimeStamp

func (trd Trade) GetTimeStamp() time.Time

GetTimeStamp returns the time the trade executed

func (Trade) MarshalJSON

func (trd Trade) MarshalJSON() ([]byte, error)

MarshalJSON returns version of trade with a unix timestamp

Jump to

Keyboard shortcuts

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