itch

package
v0.0.0-...-47b32ab Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MIT Imports: 9 Imported by: 0

README

ITCH

This package implements a parser for the Nasdaq ITCH 5.0 protocol

https://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/NQTVITCHspecification.pdf

Performance

A 12GB sample file 01302020.NASDAQ_ITCH50 was used, available from Nasdaq's FTP server. The file contains 423,285,709 ITCH messages. A test was run on i5-8600k, 32GB RAM, SSD.

Loading the whole file into memory and then parsing using itch.ParseBytes while filtering for only S message types takes ~2.4s (176,041,695.88 messages/s), not including the time to read the file into memory (which takes about ~5s itself).

The function itch.ParseFile creates a buffered reader using bufio. The parsing speed depends on the buffer size up to a certain point. A 1GB buffer takes ~8s to parse, whilst the default 4KB buffer takes ~18s.

Documentation

Overview

Package itch implements the Nasdaq ITCH 5.0 protocol

Index

Constants

View Source
const (
	MESSAGE_STOCK_DIRECTORY      uint8 = 'R'
	MESSAGE_STOCK_TRADING_ACTION uint8 = 'H'
	MESSAGE_REG_SHO              uint8 = 'Y'
	MESSAGE_PARTICIPANT_POSITION uint8 = 'L'
	MESSAGE_MWCB_LEVEL           uint8 = 'V'
	MESSAGE_MWCB_STATUS          uint8 = 'W'
	MESSAGE_IPO_QUOTATION        uint8 = 'K'
	MESSAGE_LULD_COLLAR          uint8 = 'J'
	MESSAGE_OPERATIONAL_HALT     uint8 = 'h'
	MESSAGE_ORDER_ADD            uint8 = 'A'
	MESSAGE_ORDER_ADD_ATTRIBUTED uint8 = 'F'
	MESSAGE_ORDER_EXECUTED       uint8 = 'E'
	MESSAGE_ORDER_EXECUTED_PRICE uint8 = 'C'
	MESSAGE_ORDER_CANCEL         uint8 = 'X'
	MESSAGE_ORDER_DELETE         uint8 = 'D'
	MESSAGE_ORDER_REPLACE        uint8 = 'U'
	MESSAGE_TRADE_NON_CROSS      uint8 = 'P'
	MESSAGE_TRADE_CROSS          uint8 = 'Q'
	MESSAGE_TRADE_BROKEN         uint8 = 'B'
	MESSAGE_NOII                 uint8 = 'I'
	MESSAGE_RPII                 uint8 = 'N'
)
View Source
const (
	MARKET_CODE_NASDAQ MarketCode = 'Q'
	MARKET_CODE_BX     MarketCode = 'B'
	MARKET_CODE_PSX    MarketCode = 'X'

	HALT_ACTION_HALT   HaltAction = 'H'
	HALT_ACTION_LIFTED HaltAction = 'T'
)
View Source
const (
	MMMODE_NORMAL        MMMode = 'N'
	MMMODE_PASSIVE       MMMode = 'P'
	MMMODE_SYNDICATE     MMMode = 'S'
	MMMODE_PRE_SYNDICATE MMMode = 'R'
	MMMODE_PENALTY       MMMode = 'L'

	MMSTATE_ACTIVE    MMState = 'A'
	MMSTATE_EXCUSED   MMState = 'E'
	MMSTATE_WITHDRAWN MMState = 'W'
	MMSTATE_SUSPENDED MMState = 'S'
	MMSTATE_DELETED   MMState = 'D'
)
View Source
const (
	MKTCTG_NASDAQ_GLOBAL_SELECT MarketCategory = 'Q'
	MKTCTG_NASDAQ_GLOBAL        MarketCategory = 'G'
	MKTCTG_NASDAQ_CAPITAL       MarketCategory = 'S'
	MKTCTG_NYSE                 MarketCategory = 'N'
	MKTCTG_NYSE_AMERICAN        MarketCategory = 'A'
	MKTCTG_NYSE_ARCA            MarketCategory = 'P'
	MKTCTG_BATS_Z               MarketCategory = 'Z'
	MKTCTG_INVESTORS_EXCHANGE   MarketCategory = 'V'
	MKTCTG_NOT_AVAILABLE        MarketCategory = ' '

	FSI_DEFICIENT                       FinancialStatusIndicator = 'D'
	FSI_DELINQUENT                      FinancialStatusIndicator = 'E'
	FSI_BANKRUPT                        FinancialStatusIndicator = 'Q'
	FSI_SUSPENDED                       FinancialStatusIndicator = 'S'
	FSI_DEFICIENT_AND_BANKRUPT          FinancialStatusIndicator = 'G'
	FSI_DEFICIENT_AND_DELINQUENT        FinancialStatusIndicator = 'H'
	FSI_DELINQUENT_AND_BANKRUPT         FinancialStatusIndicator = 'J'
	FSI_DEFICIENT_DELINQUENT_BANKRUPT   FinancialStatusIndicator = 'K'
	FSI_CREATIONS_REDEMPTIONS_SUSPENDED FinancialStatusIndicator = 'C'
	FSI_NORMAL                          FinancialStatusIndicator = 'N'
	FSI_NOT_AVAILABLE                   FinancialStatusIndicator = ' '

	IC_AMERICAN_DEPOSITORY_SHARE  IssueClassification = 'A'
	IC_BOND                       IssueClassification = 'B'
	IC_COMMON_STOCK               IssueClassification = 'C'
	IC_DEPOSITORY_RECEIPT         IssueClassification = 'F'
	IC_144A                       IssueClassification = 'I'
	IC_LIMITED_PARTNERSHIP        IssueClassification = 'L'
	IC_NOTES                      IssueClassification = 'N'
	IC_ORDINARY_SHARE             IssueClassification = 'O'
	IC_PREFERRED_STOCK            IssueClassification = 'P'
	IC_OTHER_SECURITIES           IssueClassification = 'Q'
	IC_RIGHT                      IssueClassification = 'R'
	IC_SHARES_BENEFICIAL_INTEREST IssueClassification = 'S'
	IC_CONVERTIBLE_DEBENTURE      IssueClassification = 'T'
	IC_UNIT                       IssueClassification = 'U'
	IC_UNITS_BENIF                IssueClassification = 'V'
	IC_WARRANT                    IssueClassification = 'W'

	ICS_PREFERRED_TRUST_SECURITIES                       IssueSubType = "A"
	ICS_ALPHA_INDEX_ETN                                  IssueSubType = "AI"
	ICS_INDEX_BASED_DERIVATIVE                           IssueSubType = "B"
	ICS_COMMON_SHARES                                    IssueSubType = "C"
	ICS_COMMODITY_BASED_TRUST_SHARES                     IssueSubType = "CB"
	ICS_COMMODITY_FUTURES_TRUST_SHARES                   IssueSubType = "CF"
	ICS_COMMODITY_LINKED_SECURITIES                      IssueSubType = "CL"
	ICS_COMMODITY_INDEX_TRUST_SHARES                     IssueSubType = "CM"
	ICS_COLLATERALIZED_MORTGAGE_OBLIGATION               IssueSubType = "CO"
	ICS_CURRENCY_TRUST_SHARES                            IssueSubType = "CT"
	ICS_COMMODITY_CURRENCY_LINKED_SECURITIES             IssueSubType = "CU"
	ICS_CURRENCY_WARRANTS                                IssueSubType = "CW"
	ICS_GLOBAL_DEPOSITORY_SHARES                         IssueSubType = "D"
	ICS_ETF_PORTFOLIO_DEPOSITARY_RECEIPT                 IssueSubType = "E"
	ICS_EQUITY_GOLD_SHARES                               IssueSubType = "EG"
	ICS_ETN_EQUITY_INDEX_LINKED_SECURITIES               IssueSubType = "EI"
	ICS_NEXTSHARES_EXCHANGE_TRADED_MANAGED_FUND          IssueSubType = "EM"
	ICS_EXCHANGE_TRADED_NOTES                            IssueSubType = "EN"
	ICS_EQUITY_UNITS                                     IssueSubType = "EU"
	ICS_HOLDRS                                           IssueSubType = "F"
	ICS_ETN_FIXED_INCOME_LINKED_SECURITIES               IssueSubType = "FI"
	ICS_ETN_FUTURES_LINKED_SECURITIES                    IssueSubType = "FL"
	ICS_GLOBAL_SHARES                                    IssueSubType = "G"
	ICS_ETF_INDEX_FUND_SHARES                            IssueSubType = "I"
	ICS_INTEREST_RATE                                    IssueSubType = "IR"
	ICS_INDEX_WARRANT                                    IssueSubType = "IW"
	ICS_INDEX_LINKED_EXCHANGEABLE_NOTES                  IssueSubType = "IX"
	ICS_CORPORATE_BACKED_TRUST_SECURITY                  IssueSubType = "J"
	ICS_CONTINGENT_LITIGATION_RIGHT                      IssueSubType = "L"
	ICS_LLC                                              IssueSubType = "LL"
	ICS_EQUITY_BASED_DERIVATIVE                          IssueSubType = "M"
	ICS_MANAGED_FUND_SHARES                              IssueSubType = "MF"
	ICS_ETN_MULTI_FACTOR_INDEX_LINKED_SECURITIES         IssueSubType = "ML"
	ICS_MANAGED_TRUST_SECURITIES                         IssueSubType = "MT"
	ICS_NY_REGISTRY_SHARES                               IssueSubType = "N"
	ICS_OPEN_ENDED_MUTUAL_FUND                           IssueSubType = "O"
	ICS_PRIVATELY_HELD_SECURITY                          IssueSubType = "P"
	ICS_POISON_PILL                                      IssueSubType = "PP"
	ICS_PARTNERSHIP_UNITS                                IssueSubType = "PU"
	ICS_CLOSED_END_FUNDS                                 IssueSubType = "Q"
	ICS_REG_S                                            IssueSubType = "R"
	ICS_COMMODITY_REDEEMABLE_COMMODITY_LINKED_SECURITIES IssueSubType = "RC"
	ICS_ETN_REDEEMABLE_FUTURES_LINKED_SECURITIES         IssueSubType = "RF"
	ICS_REIT                                             IssueSubType = "RT"
	ICS_COMMODITY_REDEEMABLE_CURRENCY_LINKED_SECURITIES  IssueSubType = "RU"
	ICS_SEED                                             IssueSubType = "S"
	ICS_SPOT_RATE_CLOSING                                IssueSubType = "SC"
	ICS_SPOT_RATE_INTRADAY                               IssueSubType = "SI"
	ICS_TRACKING_STOCK                                   IssueSubType = "T"
	ICS_TRUST_CERTIFICATES                               IssueSubType = "TC"
	ICS_TRUST_UNITS                                      IssueSubType = "TU"
	ICS_PORTAL                                           IssueSubType = "U"
	ICS_CONTINGENT_VALUE_RIGHT                           IssueSubType = "V"
	ICS_TRUST_ISSUED_RECEIPTS                            IssueSubType = "W"
	ICS_WORLD_CURRENCY_OPTION                            IssueSubType = "WC"
	ICS_TRUST                                            IssueSubType = "X"
	ICS_OTHER                                            IssueSubType = "Y"
	ICS_NOT_APPLICABLE                                   IssueSubType = "Z"

	AUTHENTICITY_LIVE Authenticity = 'P'
	AUTHENTICITY_TEST Authenticity = 'T'
)
View Source
const (
	MESSAGE_SYSTEM_EVENT uint8 = 'S'

	EVENT_START_MESSAGES EventCode = 'O'
	EVENT_START_HOURS    EventCode = 'S'
	EVENT_START_MARKET   EventCode = 'Q'
	EVENT_END_MARKET     EventCode = 'M'
	EVENT_END_HOURS      EventCode = 'E'
	EVENT_END_MESSAGES   EventCode = 'C'
)
View Source
const (
	OneGB = 1 << (10 * 3)
)

Variables

View Source
var (
	StockMap  = make(map[string]uint16)
	Directory = make(map[uint16]StockDirectory)
)
View Source
var (
	MarketParticipants = make(map[string][]ParticipantPosition)
)

Functions

This section is empty.

Types

type Authenticity

type Authenticity uint8

func (Authenticity) String

func (a Authenticity) String() string

type Configuration

type Configuration struct {
	// Set which message types to parse
	MessageTypes []byte
	// Maximum amount of messages to parse
	MaxMessages int
	// Set buffer size for io.reader when using ParseFile
	ReadBufferSize uint64
	// Whether the ITCH messages are prefixed by two byte length field (e.g. a sample file from NASDAQ FTP server)
	LengthFieldPrefixed bool
}

Configuration contains settings for adjusting how messages are parsed

type CrossType

type CrossType uint8
const (
	CROSS_TYPE_NASDAQ_OPEN            CrossType = 'O'
	CROSS_TYPE_NASDAQ_CLOSE           CrossType = 'C'
	CROSS_TYPE_IPO_HALTED             CrossType = 'H'
	CROSS_TYPE_EXTENDED_TRADING_CLOSE CrossType = 'A'
)

func (CrossType) String

func (c CrossType) String() string

type EventCode

type EventCode uint8

func (EventCode) String

func (e EventCode) String() string

type FinancialStatusIndicator

type FinancialStatusIndicator uint8

func (FinancialStatusIndicator) String

func (i FinancialStatusIndicator) String() string

type HaltAction

type HaltAction uint8

func (HaltAction) String

func (h HaltAction) String() string

type ImbalanceDirection

type ImbalanceDirection uint8
const (
	IMBALANCE_BUY          ImbalanceDirection = 'B'
	IMBALANCE_SELL         ImbalanceDirection = 'S'
	IMBALANCE_NONE         ImbalanceDirection = 'N'
	IMBALANCE_INSUFFICIENT ImbalanceDirection = 'O'
)

func (ImbalanceDirection) String

func (i ImbalanceDirection) String() string

type IpoQuotation

type IpoQuotation struct {
	StockLocate    uint16
	TrackingNumber uint16
	Timestamp      time.Duration
	Stock          string
	ReleaseTime    time.Duration
	Qualifier      ReleaseQualifier
	Price          uint32
}

func ParseIpoQuotation

func ParseIpoQuotation(data []byte) IpoQuotation

func (IpoQuotation) Bytes

func (i IpoQuotation) Bytes() []byte

func (IpoQuotation) String

func (i IpoQuotation) String() string

func (IpoQuotation) Type

func (i IpoQuotation) Type() uint8

type IssueClassification

type IssueClassification uint8

func (IssueClassification) String

func (c IssueClassification) String() string

type IssueSubType

type IssueSubType string

func (IssueSubType) String

func (i IssueSubType) String() string

type ItchMessage

type ItchMessage interface {
	Bytes() []byte
	Type() uint8
}

func Parse

func Parse(data []byte) ItchMessage

Parse will parse a single ITCH message - it should not have a length field prefixed, just give the actual ITCH message

func ParseFile

func ParseFile(path string, config Configuration) ([]ItchMessage, error)

ParseFile parses ITCH messages from an uncompressed file. It uses ParseReader internally

func ParseMany

func ParseMany(data []byte, config Configuration) ([]ItchMessage, error)

ParseMany parses multiple ITCH messages from byte data already loaded into memory

func ParseReader

func ParseReader(reader *bufio.Reader, config Configuration) ([]ItchMessage, error)

ParseReader parses ITCH messages from a bufio.Reader

type LuldCollar

type LuldCollar struct {
	StockLocate    uint16
	TrackingNumber uint16
	Timestamp      time.Duration
	Stock          string
	ReferencePrice uint32
	UpperPrice     uint32
	LowerPrice     uint32
	Extension      uint32
}

func ParseLuldCollar

func ParseLuldCollar(data []byte) LuldCollar

func (LuldCollar) Bytes

func (l LuldCollar) Bytes() []byte

func (LuldCollar) String

func (l LuldCollar) String() string

func (LuldCollar) Type

func (l LuldCollar) Type() uint8

type MMMode

type MMMode uint8

func (MMMode) String

func (m MMMode) String() string

type MMState

type MMState uint8

func (MMState) String

func (m MMState) String() string

type MarketCategory

type MarketCategory uint8

func (MarketCategory) String

func (c MarketCategory) String() string

type MarketCode

type MarketCode uint8

func (MarketCode) String

func (m MarketCode) String() string

type MwcbLevel

type MwcbLevel struct {
	StockLocate    uint16
	TrackingNumber uint16
	Timestamp      time.Duration
	LevelOne       uint64
	LevelTwo       uint64
	LevelThree     uint64
}

func ParseMwcbLevel

func ParseMwcbLevel(data []byte) MwcbLevel

func (MwcbLevel) Bytes

func (m MwcbLevel) Bytes() []byte

func (MwcbLevel) String

func (l MwcbLevel) String() string

func (MwcbLevel) Type

func (m MwcbLevel) Type() uint8

type MwcbStatus

type MwcbStatus struct {
	Timestamp      time.Duration
	StockLocate    uint16
	TrackingNumber uint16
	BreachedLevel  uint8
}

func ParseMwcbStatus

func ParseMwcbStatus(data []byte) MwcbStatus

func (MwcbStatus) Bytes

func (m MwcbStatus) Bytes() []byte

func (MwcbStatus) String

func (l MwcbStatus) String() string

func (MwcbStatus) Type

func (m MwcbStatus) Type() uint8

type Noii

type Noii struct {
	Stock              string
	Timestamp          time.Duration
	PairedShares       uint64
	ImbalanceShares    uint64
	FarPrice           uint32
	NearPrice          uint32
	CurrentPrice       uint32
	StockLocate        uint16
	TrackingNumber     uint16
	ImbalanceDirection ImbalanceDirection
	CrossType          CrossType
	VariationIndicator uint8
}

func ParseNoii

func ParseNoii(data []byte) Noii

func (Noii) Bytes

func (n Noii) Bytes() []byte

func (Noii) String

func (n Noii) String() string

func (Noii) Type

func (n Noii) Type() uint8

type OperationalHalt

type OperationalHalt struct {
	Stock          string
	Timestamp      time.Duration
	StockLocate    uint16
	TrackingNumber uint16
	MarketCode     MarketCode
	HaltAction     HaltAction
}

func ParseOperationalHalt

func ParseOperationalHalt(data []byte) OperationalHalt

func (OperationalHalt) Bytes

func (o OperationalHalt) Bytes() []byte

func (OperationalHalt) String

func (h OperationalHalt) String() string

func (OperationalHalt) Type

func (o OperationalHalt) Type() uint8

type OrderAdd

type OrderAdd struct {
	Stock          string
	Timestamp      time.Duration
	Reference      uint64
	Shares         uint32
	Price          uint32
	StockLocate    uint16
	TrackingNumber uint16
	OrderIndicator OrderIndicator
}

func ParseOrderAdd

func ParseOrderAdd(data []byte) OrderAdd

func (OrderAdd) Bytes

func (o OrderAdd) Bytes() []byte

func (OrderAdd) String

func (a OrderAdd) String() string

func (OrderAdd) Type

func (o OrderAdd) Type() uint8

type OrderAddAttributed

type OrderAddAttributed struct {
	Stock          string
	Attribution    string
	Timestamp      time.Duration
	Reference      uint64
	Shares         uint32
	Price          uint32
	StockLocate    uint16
	TrackingNumber uint16
	OrderIndicator OrderIndicator
}

func ParseOrderAddAttributed

func ParseOrderAddAttributed(data []byte) OrderAddAttributed

func (OrderAddAttributed) Bytes

func (o OrderAddAttributed) Bytes() []byte

func (OrderAddAttributed) String

func (a OrderAddAttributed) String() string

func (OrderAddAttributed) Type

func (o OrderAddAttributed) Type() uint8

type OrderCancel

type OrderCancel struct {
	Timestamp      time.Duration
	Reference      uint64
	Shares         uint32
	StockLocate    uint16
	TrackingNumber uint16
}

func ParseOrderCancel

func ParseOrderCancel(data []byte) OrderCancel

func (OrderCancel) Bytes

func (o OrderCancel) Bytes() []byte

func (OrderCancel) String

func (o OrderCancel) String() string

func (OrderCancel) Type

func (o OrderCancel) Type() uint8

type OrderDelete

type OrderDelete struct {
	StockLocate    uint16
	TrackingNumber uint16
	Timestamp      time.Duration
	Reference      uint64
}

func ParseOrderDelete

func ParseOrderDelete(data []byte) OrderDelete

func (OrderDelete) Bytes

func (o OrderDelete) Bytes() []byte

func (OrderDelete) String

func (o OrderDelete) String() string

func (OrderDelete) Type

func (o OrderDelete) Type() uint8

type OrderExecuted

type OrderExecuted struct {
	Timestamp      time.Duration
	Reference      uint64
	MatchNumber    uint64
	Shares         uint32
	StockLocate    uint16
	TrackingNumber uint16
}

func ParseOrderExecuted

func ParseOrderExecuted(data []byte) OrderExecuted

func (OrderExecuted) Bytes

func (o OrderExecuted) Bytes() []byte

func (OrderExecuted) String

func (o OrderExecuted) String() string

func (OrderExecuted) Type

func (o OrderExecuted) Type() uint8

type OrderExecutedPrice

type OrderExecutedPrice struct {
	Timestamp      time.Duration
	Reference      uint64
	MatchNumber    uint64
	Shares         uint32
	ExecutionPrice uint32
	StockLocate    uint16
	TrackingNumber uint16
	Printable      bool
}

func ParseOrderExecutedPrice

func ParseOrderExecutedPrice(data []byte) OrderExecutedPrice

func (OrderExecutedPrice) Bytes

func (o OrderExecutedPrice) Bytes() []byte

func (OrderExecutedPrice) String

func (o OrderExecutedPrice) String() string

func (OrderExecutedPrice) Type

func (o OrderExecutedPrice) Type() uint8

type OrderIndicator

type OrderIndicator uint8
const (
	ORDER_INDICATOR_BUY  OrderIndicator = 'B'
	ORDER_INDICATOR_SELL OrderIndicator = 'S'
)

func (OrderIndicator) String

func (o OrderIndicator) String() string

type OrderReplace

type OrderReplace struct {
	StockLocate       uint16
	TrackingNumber    uint16
	Timestamp         time.Duration
	OriginalReference uint64
	NewReference      uint64
	Shares            uint32
	Price             uint32
}

func ParseOrderReplace

func ParseOrderReplace(data []byte) OrderReplace

func (OrderReplace) Bytes

func (o OrderReplace) Bytes() []byte

func (OrderReplace) String

func (o OrderReplace) String() string

func (OrderReplace) Type

func (o OrderReplace) Type() uint8

type ParticipantPosition

type ParticipantPosition struct {
	Timestamp      time.Duration
	Mpid           string
	Stock          string
	StockLocate    uint16
	TrackingNumber uint16
	PrimaryMM      bool
	Mode           MMMode
	State          MMState
}

func ParseParticipantPosition

func ParseParticipantPosition(data []byte) ParticipantPosition

func (ParticipantPosition) Bytes

func (p ParticipantPosition) Bytes() []byte

func (ParticipantPosition) String

func (p ParticipantPosition) String() string

func (ParticipantPosition) Type

func (p ParticipantPosition) Type() uint8

type RegSho

type RegSho struct {
	Stock          string
	Timestamp      time.Duration
	StockLocate    uint16
	TrackingNumber uint16
	Action         RegShoAction
}

func ParseRegSho

func ParseRegSho(data []byte) RegSho

func (RegSho) Bytes

func (r RegSho) Bytes() []byte

func (RegSho) String

func (r RegSho) String() string

func (RegSho) Type

func (r RegSho) Type() uint8

type RegShoAction

type RegShoAction uint8
const (
	REGSHO_NO_PRICE_TEST RegShoAction = '0'
	REGSHO_INTRADAY_DROP RegShoAction = '1'
	REGSHO_REMAINS       RegShoAction = '2'
)

func (RegShoAction) String

func (a RegShoAction) String() string

type ReleaseQualifier

type ReleaseQualifier uint8
const (
	QUALIFIER_ANTICIPATED       ReleaseQualifier = 'A'
	QUALIFER_CANCELED_POSTPONED ReleaseQualifier = 'C'
)

func (ReleaseQualifier) String

func (r ReleaseQualifier) String() string

type RpiInterestFlag

type RpiInterestFlag uint8
const (
	RPI_INTEREST_BUY  RpiInterestFlag = 'B'
	RPI_INTEREST_SELL RpiInterestFlag = 'S'
	RPI_INTEREST_BOTH RpiInterestFlag = 'A'
	RPI_INTEREST_NONE RpiInterestFlag = 'N'
)

func (RpiInterestFlag) String

func (i RpiInterestFlag) String() string

type Rpii

type Rpii struct {
	Stock          string
	Timestamp      time.Duration
	StockLocate    uint16
	TrackingNumber uint16
	InterestFlag   RpiInterestFlag
}

func ParseRpii

func ParseRpii(data []byte) Rpii

func (Rpii) Bytes

func (r Rpii) Bytes() []byte

func (Rpii) String

func (n Rpii) String() string

func (Rpii) Type

func (r Rpii) Type() uint8

type StockDirectory

type StockDirectory struct {
	Timestamp                   time.Duration
	Stock                       string
	StockLocate                 uint16
	TrackingNumber              uint16
	RoundLotSize                uint32
	IssueSubType                IssueSubType
	IssueClassification         IssueClassification
	InverseIndicator            bool
	RoundLotsOnly               bool
	Authenticity                Authenticity
	EtpLeverageFactor           uint32
	ShortSaleThresholdIndicator string
	IpoFlag                     string
	LuldReferencePriceTier      string
	EtpFlag                     string
	MarketCategory              MarketCategory
	FinancialStatusIndicator    FinancialStatusIndicator
}

func ParseStockDirectory

func ParseStockDirectory(data []byte) StockDirectory

func (StockDirectory) Bytes

func (s StockDirectory) Bytes() []byte

func (StockDirectory) String

func (e StockDirectory) String() string

func (StockDirectory) Type

func (s StockDirectory) Type() uint8

type StockTradingAction

type StockTradingAction struct {
	Stock          string
	Reason         string
	Timestamp      time.Duration
	StockLocate    uint16
	TrackingNumber uint16
	TradingState   TradingState
	Reserved       uint8
}

func ParseStockTradingAction

func ParseStockTradingAction(data []byte) StockTradingAction

func (StockTradingAction) Bytes

func (t StockTradingAction) Bytes() []byte

func (StockTradingAction) String

func (a StockTradingAction) String() string

func (StockTradingAction) Type

func (t StockTradingAction) Type() uint8

type SystemEvent

type SystemEvent struct {
	Timestamp      time.Duration
	StockLocate    uint16
	TrackingNumber uint16
	EventCode      EventCode
}

func MakeSystemEvent

func MakeSystemEvent(timestamp time.Duration, trackingNumber uint16, eventCode EventCode) SystemEvent

func ParseSystemEvent

func ParseSystemEvent(data []byte) SystemEvent

func (SystemEvent) Bytes

func (e SystemEvent) Bytes() []byte

func (SystemEvent) String

func (e SystemEvent) String() string

func (SystemEvent) Type

func (e SystemEvent) Type() uint8

type TradeBroken

type TradeBroken struct {
	StockLocate    uint16
	TrackingNumber uint16
	Timestamp      time.Duration
	MatchNumber    uint64
}

func ParseTradeBroken

func ParseTradeBroken(data []byte) TradeBroken

func (TradeBroken) Bytes

func (t TradeBroken) Bytes() []byte

func (TradeBroken) String

func (o TradeBroken) String() string

func (TradeBroken) Type

func (t TradeBroken) Type() uint8

type TradeCross

type TradeCross struct {
	Stock          string
	Timestamp      time.Duration
	MatchNumber    uint64
	Shares         uint32
	CrossPrice     uint32
	StockLocate    uint16
	TrackingNumber uint16
	CrossType      CrossType
}

func ParseTradeCross

func ParseTradeCross(data []byte) TradeCross

func (TradeCross) Bytes

func (t TradeCross) Bytes() []byte

func (TradeCross) String

func (o TradeCross) String() string

func (TradeCross) Type

func (t TradeCross) Type() uint8

type TradeNonCross

type TradeNonCross struct {
	Stock          string
	Timestamp      time.Duration
	Reference      uint64
	MatchNumber    uint64
	Shares         uint32
	Price          uint32
	StockLocate    uint16
	TrackingNumber uint16
	OrderIndicator OrderIndicator
}

func ParseTradeNonCross

func ParseTradeNonCross(data []byte) TradeNonCross

func (TradeNonCross) Bytes

func (t TradeNonCross) Bytes() []byte

func (TradeNonCross) String

func (o TradeNonCross) String() string

func (TradeNonCross) Type

func (t TradeNonCross) Type() uint8

type TradingState

type TradingState uint8
const (
	STATE_HALTED    TradingState = 'H'
	STATE_PAUSED    TradingState = 'P'
	STATE_QUOTATION TradingState = 'Q'
	STATE_TRADING   TradingState = 'T'
)

func (TradingState) String

func (t TradingState) String() string

Jump to

Keyboard shortcuts

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