Documentation ¶
Overview ¶
Package activetick provides an API for accessing and using the ActiveTick HTTP API.
http://www.activetick.com/activetick/contents/PersonalServicesDataAPIOverview.aspx
Index ¶
- type BarDataRecord
- type BarDataRequest
- type BarDataResponse
- type Client
- type DataItemType
- type Exchange
- type HistoryType
- type OptionChainRequest
- type OptionChainResponse
- type PagingClient
- type QuoteDataRequest
- type QuoteDataResponse
- type QuoteField
- type QuoteSnapshotRecord
- type QuoteStreamRecord
- type QuoteStreamRequest
- type SymbolStatus
- type TickDataRequest
- type TickDataResponse
- type TickRecord
- type TickType
- type TradeCondition
- type TradeFlag
- type TradeStreamRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BarDataRecord ¶
type BarDataRequest ¶
type BarDataResponse ¶
type BarDataResponse struct {
Records []*BarDataRecord
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides methods to interact with the ActiveTick HTTP API. TODO: Implement snapshot quotes (/quoteData) and streaming quotes (/quoteStream).
func (*Client) GetBarData ¶
func (c *Client) GetBarData(req *BarDataRequest) (*BarDataResponse, error)
func (*Client) GetTickData ¶
func (c *Client) GetTickData(req *TickDataRequest) (*TickDataResponse, error)
type DataItemType ¶
type DataItemType int
const ( DataByte DataItemType = 1 DataByteArray DataItemType = 2 DataUInteger32 DataItemType = 3 DataUInteger64 DataItemType = 4 DataInteger32 DataItemType = 5 DataInteger64 DataItemType = 6 DataPrice DataItemType = 7 DataString DataItemType = 8 DataUnicodeString DataItemType = 9 DataDateTime DataItemType = 10 DataDouble DataItemType = 11 )
type Exchange ¶
type Exchange string
const ( ExchangeAMEX Exchange = "A" ExchangeNasdaqOmxBx Exchange = "B" ExchangeNationalStockExchange Exchange = "C" ExchangeFinraAdf Exchange = "D" ExchangeCQS Exchange = "E" ExchangeForex Exchange = "F" ExchangeInternationalSecuritiesExchange Exchange = "I" ExchangeEdgaExchange Exchange = "J" ExchangeEdgxExchange Exchange = "K" ExchangeChicagoStockExchange Exchange = "M" ExchangeNyseEuronext Exchange = "N" ExchangeNyseArcaExchange Exchange = "P" ExchangeNasdaqOmx Exchange = "Q" ExchangeCTS Exchange = "S" ExchangeCTANasdaqOMX Exchange = "T" ExchangeOTCBB Exchange = "U" ExchangeNNOTC Exchange = "u" ExchangeChicagoBoardOptionsExchange Exchange = "W" ExchangeNasdaqOmxPhlx Exchange = "X" ExchangeBatsYExchange Exchange = "Y" ExchangeBatsExchange Exchange = "Z" ExchangeCanadaToronto Exchange = "T" ExchangeCanadaVenture Exchange = "V" ExchangeComposite Exchange = " " )
type HistoryType ¶
type HistoryType int
const ( HistoryTypeIntraday HistoryType = 0 HistoryTypeDaily HistoryType = 1 HistoryTypeWeekly HistoryType = 2 )
type OptionChainRequest ¶
type OptionChainRequest struct {
Symbol string
}
type OptionChainResponse ¶
type OptionChainResponse struct {
Records []string
}
type PagingClient ¶
type PagingClient struct {
// contains filtered or unexported fields
}
PagingClient wraps Client to automatically manage multiple paged requests.
func NewPagingClient ¶
func NewPagingClient(client *Client) *PagingClient
func (*PagingClient) GetBarData ¶
func (pc *PagingClient) GetBarData(req *BarDataRequest) (*BarDataResponse, error)
The HTTP API will return at most 20,000 records. If there are more than that, only the latest 20,000 in time are returned. So to fetch all data we need to page backward.
func (*PagingClient) GetTickData ¶
func (pc *PagingClient) GetTickData(req *TickDataRequest) (*TickDataResponse, error)
The HTTP API will return at most 100,000 ticks. If there are more than that, only the first 100,000 in time are returned. So to fetch all data we need to page forward.
type QuoteDataRequest ¶
type QuoteDataRequest struct { Symbols []string QuoteFields []QuoteField }
type QuoteDataResponse ¶
type QuoteDataResponse struct {
Records []*QuoteSnapshotRecord
}
type QuoteField ¶
type QuoteField int
const ( QuoteFieldSymbol QuoteField = 1 QuoteFieldOpenPrice QuoteField = 2 QuoteFieldPreviousClosePrice QuoteField = 3 QuoteFieldClosePrice QuoteField = 4 QuoteFieldLastPrice QuoteField = 5 QuoteFieldBidPrice QuoteField = 6 QuoteFieldAskPrice QuoteField = 7 QuoteFieldHighPrice QuoteField = 8 QuoteFieldLowPrice QuoteField = 9 QuoteFieldDayHighPrice QuoteField = 10 QuoteFieldDayLowPrice QuoteField = 11 QuoteFieldPreMarketOpenPrice QuoteField = 12 QuoteFieldExtendedHoursLastPrice QuoteField = 13 QuoteFieldAfterMarketClosePrice QuoteField = 14 QuoteFieldBidExchange QuoteField = 15 QuoteFieldAskExchange QuoteField = 16 QuoteFieldLastExchange QuoteField = 17 QuoteFieldLastCondition QuoteField = 18 QuoteFieldQuoteCondition QuoteField = 19 QuoteFieldLastTradeDateTime QuoteField = 20 QuoteFieldLastQuoteDateTime QuoteField = 21 QuoteFieldDayHighDateTime QuoteField = 22 QuoteFieldDayLowDateTime QuoteField = 23 QuoteFieldLastSize QuoteField = 24 QuoteFieldBidSize QuoteField = 25 QuoteFieldAskSize QuoteField = 26 QuoteFieldVolume QuoteField = 27 QuoteFieldPreMarketVolume QuoteField = 28 QuoteFieldAfterMarketVolume QuoteField = 29 QuoteFieldTradeCount QuoteField = 30 QuoteFieldPreMarketTradeCount QuoteField = 31 QuoteFieldAfterMarketTradeCount QuoteField = 32 QuoteFieldFundamentalEquityName QuoteField = 33 QuoteFieldFundamentalEquityPrimaryExchange QuoteField = 34 )
type QuoteSnapshotRecord ¶
type QuoteSnapshotRecord struct { Symbol string OpenPrice float64 PreviousClosePrice float64 ClosePrice float64 LastPrice float64 BidPrice float64 AskPrice float64 HighPrice float64 LowPrice float64 DayHighPrice float64 DayLowPrice float64 PreMarketOpenPrice float64 ExtendedHoursLastPrice float64 AfterMarketClosePrice float64 BidExchange Exchange AskExchange Exchange LastExchange Exchange LastCondition int QuoteCondition int LastTradeTime time.Time LastQuoteTime time.Time DayHighTime time.Time DayLowTime time.Time LastSize int BidSize int AskSize int Volume int PreMarketVolume int AfterMarketVolume int TradeCount int PreMarketTradeCount int AfterMarketTradeCount int FundamentalEquityName string FundamentalEquityPrimaryExchange Exchange }
type QuoteStreamRecord ¶
type QuoteStreamRequest ¶
type QuoteStreamRequest struct {
Symbols []string
}
type SymbolStatus ¶
type SymbolStatus int
const ( SymbolStatusSuccess SymbolStatus = 1 SymbolStatusInvalid SymbolStatus = 2 SymbolStatusNoPermission SymbolStatus = 4 )
type TickDataRequest ¶
type TickDataResponse ¶
type TickDataResponse struct {
Records []*TickRecord
}
type TickRecord ¶
type TradeCondition ¶
type TradeCondition int
const ( TradeConditionRegular TradeCondition = 0 TradeConditionAcquisition TradeCondition = 1 TradeConditionAveragePrice TradeCondition = 2 TradeConditionAutomaticExecution TradeCondition = 3 TradeConditionBunched TradeCondition = 4 TradeConditionBunchSold TradeCondition = 5 TradeConditionCAPElection TradeCondition = 6 TradeConditionCash TradeCondition = 7 TradeConditionClosing TradeCondition = 8 TradeConditionCross TradeCondition = 9 TradeConditionDerivativelyPriced TradeCondition = 10 TradeConditionDistribution TradeCondition = 11 TradeConditionFormT TradeCondition = 12 TradeConditionFormTOutOfSequence TradeCondition = 13 TradeConditionInterMarketSweep TradeCondition = 14 TradeConditionMarketCenterOfficialClose TradeCondition = 15 TradeConditionMarketCenterOfficialOpen TradeCondition = 16 TradeConditionMarketCenterOpening TradeCondition = 17 TradeConditionMarketCenterReOpenning TradeCondition = 18 TradeConditionMarketCenterClosing TradeCondition = 19 TradeConditionNextDay TradeCondition = 20 TradeConditionPriceVariation TradeCondition = 21 TradeConditionPriorReferencePrice TradeCondition = 22 TradeConditionRule155Amex TradeCondition = 23 TradeConditionRule127Nyse TradeCondition = 24 TradeConditionOpening TradeCondition = 25 TradeConditionOpened TradeCondition = 26 TradeConditionRegularStoppedStock TradeCondition = 27 TradeConditionReOpening TradeCondition = 28 TradeConditionSeller TradeCondition = 29 TradeConditionSoldLast TradeCondition = 30 TradeConditionSoldLastStoppedStock TradeCondition = 31 TradeConditionSoldOutOfSequence TradeCondition = 32 TradeConditionSoldOutOfSequenceStoppedStock TradeCondition = 33 TradeConditionSplit TradeCondition = 34 TradeConditionStockOption TradeCondition = 35 TradeConditionYellowFlag TradeCondition = 36 )
type TradeFlag ¶
type TradeFlag int
const ( TradeFlagRegularMarketLastPrice TradeFlag = 0x1 TradeFlagRegularMarketVolume TradeFlag = 0x2 TradeFlagHighPrice TradeFlag = 0x4 TradeFlagLowPrice TradeFlag = 0x8 TradeFlagDayHighPrice TradeFlag = 0x10 TradeFlagDayLowPrice TradeFlag = 0x20 TradeFlagExtendedMarketLastPrice TradeFlag = 0x40 TradeFlagPreMarketVolume TradeFlag = 0x80 TradeFlagAfterMarketVolume TradeFlag = 0x100 TradeFlagPreMarketOpenPrice TradeFlag = 0x200 TradeFlagOpenPrice TradeFlag = 0x400 )