Documentation ¶
Index ¶
- Constants
- func ReadBool(r io.Reader) bool
- func ReadFloat32(r io.Reader) float32
- func ReadFloat64(r io.Reader) float64
- func ReadInt16(r io.Reader) int16
- func ReadInt32(r io.Reader) int32
- func ReadInt64(r io.Reader) int64
- func ReadInt8(r io.Reader) int8
- func ReadString(r io.Reader, length int) string
- type AcctActivityAction
- type Decoder
- type SidHandlers
- type StreamingID
- type UpdateOptionAction
Constants ¶
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 ReadFloat32 ¶
func ReadFloat64 ¶
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 (*Decoder) DecodeCommonStreamingHeader ¶
func (d *Decoder) DecodeCommonStreamingHeader(sh *SidHandlers)
DecodeCommonStreamingHeader parses the Common Streaming Header from the TD stream
func (*Decoder) DecodeHeader ¶
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 ¶
UpdateOptionAction is the function that is called once option data is parsed from the stream