tdstream

package
v0.0.0-...-48f5d39 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2018 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Quote          StreamingID = 1
	TimeSale                   = 5
	Response                   = 10
	Option                     = 18
	ActivesNYSE                = 23
	ActivesNASDAQ              = 25
	ActivesOTCBB               = 26
	ActivesOptions             = 35
	News                       = 27
	NewsHistory                = 28
	AdapNASDAQ                 = 62
	NYSEBook                   = 81
	NYSEChart                  = 82
	NASDAQChart                = 83
	OpraBook                   = 84
	IndexChart                 = 85
	TotalView                  = 87
	AcctActivity               = 90
	Chart                      = 91
	StreamerServer             = 100
)

The various constants that represent the Streaming ID codes specified by TD API

Variables

This section is empty.

Functions

func ReadBool

func ReadBool(r io.Reader) bool

These functions should become public library for myself

func ReadFloat32

func ReadFloat32(r io.Reader) float32

func ReadFloat64

func ReadFloat64(r io.Reader) float64

func ReadInt16

func ReadInt16(r io.Reader) int16

func ReadInt32

func ReadInt32(r io.Reader) int32

func ReadInt64

func ReadInt64(r io.Reader) int64

func ReadInt8

func ReadInt8(r io.Reader) int8

func ReadString

func ReadString(r io.Reader, length int) string

Types

type AcctActivityAction

type AcctActivityAction func(message *ordermessage.Message)

AcctActivityAction is the function that is called once an account activity (order update) comes in

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

Decoder holds stream reader information

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

NewDecoder returns a new Decoder

func (*Decoder) DecodeCommonStreamingHeader

func (d *Decoder) DecodeCommonStreamingHeader(sh *SidHandlers)

DecodeCommonStreamingHeader parses the Common Streaming Header from the TD stream

func (*Decoder) DecodeHeader

func (d *Decoder) DecodeHeader() byte

DecodeHeader reads TD header from the stream and returns its value. In case there's an EOF error, it returns 'X'

func (*Decoder) DecodeHeartbeat

func (d *Decoder) DecodeHeartbeat()

DecodeHeartbeat decodes a TD Heartbeat message

func (*Decoder) DecodeSnapshotResponse

func (d *Decoder) DecodeSnapshotResponse(sh *SidHandlers)

DecodeSnapshotResponse parses the Snapshot Response from the TD stream

type SidHandlers

type SidHandlers struct {
	OptionCallback          UpdateOptionAction
	AccountActivityCallback AcctActivityAction
}

SidHandlers is a stuct to hold callback functions

type StreamingID

type StreamingID int16

StreamingID (aka SID) is an enum type that represents the what is being streamed (ie QUOTE, OPTION, etc)

func (StreamingID) String

func (id StreamingID) String() string

type UpdateOptionAction

type UpdateOptionAction func(newOptionData *option.Option)

UpdateOptionAction is the function that is called once option data is parsed from the stream

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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