tdameritrade

package
Version: v0.0.0-...-30167a5 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ChangeTypes    = []string{"value", "percent"}
	DirectionTypes = []string{"up", "down"}
)

Functions

This section is empty.

Types

type Account

type Account struct {
	SecuritiesAccount `json:"securitiesAccount"`
}

type AccountOptions

type AccountOptions struct {
	Position bool
	Orders   bool
}

type Accounts

type Accounts []*Account

type AccountsService

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

AccountsService handles communication with the account related methods of the TDAmeritrade API.

TDAmeritrade API docs: https://developer.tdameritrade.com/account-access/apis

func (*AccountsService) CancelOrder

func (s *AccountsService) CancelOrder(ctx context.Context, accountID, orderID string) (*Response, error)

func (*AccountsService) CreateSavedOrder

func (s *AccountsService) CreateSavedOrder(ctx context.Context, accountID string, order *Order) (*Response, error)

func (*AccountsService) DeleteSavedOrder

func (s *AccountsService) DeleteSavedOrder(ctx context.Context, accountID, savedOrderID string) (*Response, error)

func (*AccountsService) GetAccount

func (s *AccountsService) GetAccount(ctx context.Context, accountID string, opts *AccountOptions) (*Account, *Response, error)

func (*AccountsService) GetAccounts

func (s *AccountsService) GetAccounts(ctx context.Context, opts *AccountOptions) (*Accounts, *Response, error)

func (*AccountsService) GetOrder

func (s *AccountsService) GetOrder(ctx context.Context, accountID, orderID string) (*Response, error)

func (*AccountsService) GetOrderByPath

func (s *AccountsService) GetOrderByPath(ctx context.Context, accountID string, orderParams *OrderParams) (*Orders, *Response, error)

func (*AccountsService) GetOrderByQuery

func (s *AccountsService) GetOrderByQuery(ctx context.Context, accountID string, orderParams *OrderParams) (*Response, error)

func (*AccountsService) GetSavedOrder

func (s *AccountsService) GetSavedOrder(ctx context.Context, accountID, savedOrderID string, orderParams *OrderParams) (*Response, error)

func (*AccountsService) PlaceOrder

func (s *AccountsService) PlaceOrder(ctx context.Context, accountID string, order *Order) (*Response, error)

func (*AccountsService) ReplaceOrder

func (s *AccountsService) ReplaceOrder(ctx context.Context, accountID string, orderID string, order *Order) (*Response, error)

func (*AccountsService) ReplaceSavedOrder

func (s *AccountsService) ReplaceSavedOrder(ctx context.Context, accountID, savedOrderID string, order *Order) (*Response, error)

type Balance

type Balance struct {
	AccruedInterest              float64 `json:"accruedInterest"`
	CashBalance                  float64 `json:"cashBalance"`
	CashReceipts                 float64 `json:"cashReceipts"`
	LongOptionMarketValue        float64 `json:"longOptionMarketValue"`
	LiquidationValue             float64 `json:"liquidationValue"`
	LongMarketValue              float64 `json:"longMarketValue"`
	MoneyMarketFund              float64 `json:"moneyMarketFund"`
	Savings                      float64 `json:"savings"`
	ShortMarketValue             float64 `json:"shortMarketValue"`
	PendingDeposits              float64 `json:"pendingDeposits"`
	CashAvailableForTrading      float64 `json:"cashAvailableForTrading"`
	CashAvailableForWithdrawal   float64 `json:"cashAvailableForWithdrawal"`
	CashCall                     float64 `json:"cashCall"`
	LongNonMarginableMarketValue float64 `json:"longNonMarginableMarketValue"`
	TotalCash                    float64 `json:"totalCash"`
	ShortOptionMarketValue       float64 `json:"shortOptionMarketValue"`
	MutualFundValue              float64 `json:"mutualFundValue"`
	BondValue                    float64 `json:"bondValue"`
	CashDebitCallValue           float64 `json:"cashDebitCallValue"`
	UnsettledCash                float64 `json:"unsettledCash"`
}

type CancelTime

type CancelTime struct {
	Date        string `json:"date,omitempty"`
	ShortFormat bool   `json:"shortFormat,omitempty"`
}

type CashEquivalent

type CashEquivalent struct {
	Cusip       string `json:"cusip,omitempty"`
	Symbol      string `json:"symbol"`
	Description string `json:"description,omitempty"`
	Type        string `json:"type"` //"'SAVINGS' or 'MONEY_MARKET_FUND'"
}

type Chains

type Chains struct {
	Symbol            string     `json:"symbol"`
	Status            string     `json:"status"`
	Underlying        Underlying `json:"underlying"`
	Strategy          string     `json:"strategy"`
	Interval          float64    `json:"interval"`
	IsDelayed         bool       `json:"isDelayed"`
	IsIndex           bool       `json:"isIndex"`
	InterestRate      float64    `json:"interestRate"`
	UnderlyingPrice   float64    `json:"underlyingPrice"`
	Volatility        float64    `json:"volatility"`
	DaysToExpiration  float64    `json:"daysToExpiration"`
	NumberOfContracts int        `json:"numberOfContracts"`
	CallExpDateMap    ExpDateMap `json:"callExpDateMap"`
	PutExpDateMap     ExpDateMap `json:"putExpDateMap"`
}

type ChainsService

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

ChainsService handles communication with the chains related methods of the TDAmeritrade API.

TDAmeritrade API docs: https://developer.tdameritrade.com/option-chains/apis

func (*ChainsService) GetChains

func (s *ChainsService) GetChains(ctx context.Context, queryValues url.Values) (*Chains, *Response, error)

Users must provide the required URL queryValues for this function to work. TD Ameritrade url values: https://developer.tdameritrade.com/option-chains/apis/get/marketdata/chains Instructions for using url.Values: https://golang.org/pkg/net/url/#Values

type Client

type Client struct {

	// Base URL for API requests. Defaults to the public TD-Ameritrade API, but can be
	// set to any endpoint. This allows for more manageable testing.
	BaseURL *url.URL

	// services used for talking to different parts of the tdameritrade api
	PriceHistory *PriceHistoryService
	Account      *AccountsService
	MarketHours  *MarketHoursService
	Quotes       *QuotesService
	Instrument   *InstrumentService
	Chains       *ChainsService
	Mover        *MoverService
	// contains filtered or unexported fields
}

A Client manages communication with the TD-Ameritrade API.

func NewClient

func NewClient(httpClient *http.Client) (*Client, error)

NewClient returns a new TD-Ameritrade API client. If a nil httpClient is provided, a new http.Client will be used. To use API methods which require authentication, provide an http.Client that will perform the authentication for you (such as that provided by the golang.org/x/oauth2 library).

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error)

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.

func (*Client) UpdateBaseURL

func (c *Client) UpdateBaseURL(baseURL string) error

type Equity

type Equity struct {
	Cusip       string `json:"cusip,omitempty"`
	Symbol      string `json:"symbol"`
	Description string `json:"description,omitempty"`
}

type Execution

type Execution struct {
	ActivityType           string          `json:"activityType"`  //"'EXECUTION' or 'ORDER_ACTION'",
	ExecutionType          string          `json:"executionType"` //"'FILL'",
	Quantity               float64         `json:"quantity"`
	OrderRemainingQuantity float64         `json:"orderRemainingQuantity"`
	ExecutionLegs          []*ExecutionLeg `json:"executionLegs"`
}

type ExecutionLeg

type ExecutionLeg struct {
	LegID             int64   `json:"legId"`
	Quantity          float64 `json:"quantity"`
	MismarkedQuantity float64 `json:"mismarkedQuantity"`
	Price             float64 `json:"price"`
	Time              string  `json:"time"`
}

type ExpDateMap

type ExpDateMap map[string]map[string][]ExpDateOption

the first string is the exp date. the second string is the strike price.

type ExpDateOption

type ExpDateOption struct {
	PutCall                string  `json:"putCall"`
	Symbol                 string  `json:"symbol"`
	Description            string  `json:"description"`
	ExchangeName           string  `json:"exchangeName"`
	Bid                    float64 `json:"bid"`
	Ask                    float64 `json:"ask"`
	Last                   float64 `json:"last"`
	Mark                   float64 `json:"mark"`
	BidSize                int     `json:"bidSize"`
	AskSize                int     `json:"askSize"`
	BidAskSize             string  `json:"bidAskSize"`
	LastSize               float64 `json:"lastSize"`
	HighPrice              float64 `json:"highPrice"`
	LowPrice               float64 `json:"lowPrice"`
	OpenPrice              float64 `json:"openPrice"`
	ClosePrice             float64 `json:"closePrice"`
	TotalVolume            int     `json:"totalVolume"`
	TradeDate              string  `json:"tradeDate"`
	TradeTimeInLong        int     `json:"tradeTimeInLong"`
	QuoteTimeInLong        int     `json:"quoteTimeInLong"`
	NetChange              float64 `json:"netChange"`
	Volatility             float64 `json:"volatility"`
	Delta                  float64 `json:"delta"`
	Gamma                  float64 `json:"gamma"`
	Theta                  float64 `json:"theta"`
	Vega                   float64 `json:"vega"`
	Rho                    float64 `json:"rho"`
	OpenInterest           int     `json:"openInterest"`
	TimeValue              float64 `json:"timeValue"`
	TheoreticalOptionValue float64 `json:"theoreticalOptionValue"`
	TheoreticalVolatility  float64 `json:"theoreticalVolatility"`
	OptionDeliverablesList string  `json:"optionDeliverablesList"`
	StrikePrice            float64 `json:"strikePrice"`
	ExpirationDate         int     `json:"expirationDate"`
	DaysToExpiration       int     `json:"daysToExpiration"`
	ExpirationType         string  `json:"expirationType"`
	LastTradingDate        int     `json:"lastTradingDay"`
	Multiplier             float64 `json:"multiplier"`
	SettlementType         string  `json:"settlementType"`
	DeliverableNote        string  `json:"deliverableNote"`
	IsIndexOption          bool    `json:"isIndexOption"`
	PercentChange          float64 `json:"percentChange"`
	MarkChange             float64 `json:"markChange"`
	MarkPercentChange      float64 `json:"markPercentChange"`
	InTheMoney             bool    `json:"inTheMoney"`
	Mini                   bool    `json:"mini"`
	NonStandard            bool    `json:"nonStandard"`
}

type FixedIncome

type FixedIncome struct {
	Cusip        string  `json:"cusip"`
	Symbol       string  `json:"symbol"`
	Description  string  `json:"description"`
	MaturityDate string  `json:"maturityDate"`
	VariableRate float64 `json:"variableRate"`
	Factor       float64 `json:"factor"`
}

type Hours

type Hours struct {
	Category     string       `json:"category"`
	Date         string       `json:"date"`
	Exchange     string       `json:"exchange"`
	IsOpen       bool         `json:"isOpen"`
	MarketType   string       `json:"marketType"`
	Product      string       `json:"product"`
	ProductName  string       `json:"productName"`
	SessionHours SessionHours `json:"sessionHours"`
}

type Instrument

type Instrument struct {
	AssetType string `json:"assetType"`
	Data      interface{}
}

func (*Instrument) MarshalJSON

func (i *Instrument) MarshalJSON() ([]byte, error)

func (*Instrument) UnmarshalJSON

func (i *Instrument) UnmarshalJSON(bs []byte) (err error)

type InstrumentInfo

type InstrumentInfo struct {
	Cusip       string `json:"cusip,omitempty"`
	Symbol      string `json:"symbol"`
	Description string `json:"description,omitempty"`
	Type        string `json:"assetType"` //"'NOT_APPLICABLE' or 'OPEN_END_NON_TAXABLE' or 'OPEN_END_TAXABLE' or 'NO_LOAD_NON_TAXABLE' or 'NO_LOAD_TAXABLE'"
	Exchange    string `json:"exchange"`
}

type InstrumentService

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

InstrumentService handles communication with the marketdata related methods of the TDAmeritrade API.

TDAmeritrade API docs: https://developer.tdameritrade.com/instruments/apis

func (*InstrumentService) GetInstrument

func (s *InstrumentService) GetInstrument(ctx context.Context, cusip string) (*Instruments, *Response, error)

func (*InstrumentService) SearchInstruments

func (s *InstrumentService) SearchInstruments(ctx context.Context, symbol, projection string) (*Instruments, *Response, error)

type Instruments

type Instruments map[string]*InstrumentInfo

type MarketHours

type MarketHours map[string]map[string]*Hours

type MarketHoursService

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

MarketHoursService handles communication with the marketdata related methods of the TDAmeritrade API.

TDAmeritrade API docs: https://developer.tdameritrade.com/market-hours/apis

func (*MarketHoursService) GetMarketHours

func (s *MarketHoursService) GetMarketHours(ctx context.Context, market string, date time.Time) (*MarketHours, *Response, error)

func (*MarketHoursService) GetMarketHoursMulti

func (s *MarketHoursService) GetMarketHoursMulti(ctx context.Context, markets string, date time.Time) (*MarketHours, *Response, error)

type Mover

type Mover struct {
	Change      float64 `json:"change"`
	Description string  `json:"description"`
	Direction   string  `json:"direction"`
	Last        float64 `json:"last"`
	TotalVolume float64 `json:"totalVolume"`
	Symbol      string  `json:"symbol"`
}

type MoverOptions

type MoverOptions struct {
	Direction  string `url:"direction"`
	ChangeType string `url:"change"`
}

type MoverService

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

func (*MoverService) Mover

func (s *MoverService) Mover(ctx context.Context, symbol string, opts *MoverOptions) (*[]Mover, *Response, error)

type MutualFund

type MutualFund struct {
	Cusip       string `json:"cusip,omitempty"`
	Symbol      string `json:"symbol"`
	Description string `json:"description,omitempty"`
	Type        string `json:"type"` //"'NOT_APPLICABLE' or 'OPEN_END_NON_TAXABLE' or 'OPEN_END_TAXABLE' or 'NO_LOAD_NON_TAXABLE' or 'NO_LOAD_TAXABLE'"
}

type OptionA

type OptionA struct {
	Cusip              string               `json:"cusip,omitempty"`
	Symbol             string               `json:"symbol"`
	Description        string               `json:"description,omitempty"`
	Type               string               `json:"type"`
	PutCall            string               `json:"putCall"`
	UnderlyingSymbol   string               `json:"underlyingSymbol"`
	OptionMultiplier   float64              `json:"optionMultiplier"`
	OptionDeliverables []*OptionDeliverable `json:"optionDeliverables"`
}

type OptionDeliverable

type OptionDeliverable struct {
	Symbol           string  `json:"symbol"`
	DeliverableUnits float64 `json:"deliverableUnits"`
	CurrencyType     string  `json:"currencyType"`
	AssetType        string  `json:"assetType"`
}

type Order

type Order struct {
	Session                  string                `json:"session"`
	Duration                 string                `json:"duration"`
	OrderType                string                `json:"orderType"`
	CancelTime               *CancelTime           `json:"cancelTime,omitempty"`
	ComplexOrderStrategyType string                `json:"complexOrderStrategyType,omitempty"`
	Quantity                 float64               `json:"quantity,omitempty"`
	FilledQuantity           float64               `json:"filledQuantity,omitempty"`
	RemainingQuantity        float64               `json:"remainingQuantity,omitempty"`
	RequestedDestination     string                `json:"requestedDestination,omitempty"`
	DestinationLinkName      string                `json:"destinationLinkName,omitempty"`
	ReleaseTime              string                `json:"releaseTime,omitempty"`
	StopPrice                float64               `json:"stopPrice,omitempty"`
	StopPriceLinkBasis       string                `json:"stopPriceLinkBasis,omitempty"`
	StopPriceLinkType        string                `json:"stopPriceLinkType,omitempty"`
	StopPriceOffset          float64               `json:"stopPriceOffset,omitempty"`
	StopType                 string                `json:"stopType,omitempty"`
	PriceLinkBasis           string                `json:"priceLinkBasis,omitempty"`
	PriceLinkType            string                `json:"priceLinkType,omitempty"`
	Price                    float64               `json:"price,omitempty"`
	TaxLotMethod             string                `json:"taxLotMethod,omitempty"`
	OrderLegCollection       []*OrderLegCollection `json:"orderLegCollection"`
	ActivationPrice          float64               `json:"activationPrice,omitempty"`
	SpecialInstruction       string                `json:"specialInstruction,omitempty"`
	OrderStrategyType        string                `json:"orderStrategyType"`
	OrderID                  int64                 `json:"orderId,omitempty"`
	Cancelable               bool                  `json:"cancelable,omitempty"`
	Editable                 bool                  `json:"editable,omitempty"`
	Status                   string                `json:"status,omitempty"`
	EnteredTime              string                `json:"enteredTime,omitempty"`
	CloseTime                string                `json:"closeTime,omitempty"`
	Tag                      string                `json:"tag,omitempty"`
	AccountID                float64               `json:"accountId,omitempty"`
	OrderActivityCollection  []*Execution          `json:"orderActivityCollection,omitempty"`
	ReplacingOrderCollection []*Order              `json:"replacingOrderCollection,omitempty"`
	ChildOrderStrategies     []*Order              `json:"childOrderStrategies,omitempty"`
	StatusDescription        string                `json:"statusDescription,omitempty"`
}

type OrderLegCollection

type OrderLegCollection struct {
	OrderLegType   string     `json:"orderLegType,omitempty"`
	LegID          int        `json:"legId,omitempty"`
	Instrument     Instrument `json:"instrument"`
	Instruction    string     `json:"instruction"`
	PositionEffect string     `json:"positionEffect,omitempty"`
	Quantity       float32    `json:"quantity"`
}

type OrderParams

type OrderParams struct {
	MaxResults int
	From       time.Time
	To         time.Time
	Status     string
}

type Orders

type Orders []*Order

type Period

type Period struct {
	Start string `json:"start"`
	End   string `json:"end"`
}

type PriceHistory

type PriceHistory struct {
	Candles []struct {
		Close    float64 `json:"close"`
		Datetime int     `json:"datetime"`
		High     float64 `json:"high"`
		Low      float64 `json:"low"`
		Open     float64 `json:"open"`
		Volume   float64 `json:"volume"`
	} `json:"candles"`
	Empty  bool   `json:"empty"`
	Symbol string `json:"symbol"`
}

type PriceHistoryOptions

type PriceHistoryOptions struct {
	PeriodType            string    `url:"periodType"`
	Period                int       `url:"period"`
	FrequencyType         string    `url:"frequencyType"`
	Frequency             int       `url:"frequency"`
	EndDate               time.Time `url:"endDate"`
	StartDate             time.Time `url:"startDate"`
	NeedExtendedHoursData *bool     `url:"needExtendedHoursData"`
}

PriceHistoryOptions is parsed and translated to query options in the https request

type PriceHistoryService

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

PriceHistoryService handles communication with the marketdata related methods of the TDAmeritrade API.

TDAmeritrade API docs: https://developer.tdameritrade.com/price-history/apis

func (*PriceHistoryService) PriceHistory

func (s *PriceHistoryService) PriceHistory(ctx context.Context, symbol string, opts *PriceHistoryOptions) (*PriceHistory, *Response, error)

PriceHistory get the price history for a symbol TDAmeritrade API Docs: https://developer.tdameritrade.com/price-history/apis/get/marketdata/%7Bsymbol%7D/pricehistory

type Quote

type Quote struct {
	AssetType                          string  `json:"assetType"`
	AssetMainType                      string  `json:"assetMainType"`
	Cusip                              string  `json:"cusip"`
	AssetSubType                       string  `json:"assetSubType"`
	Symbol                             string  `json:"symbol"`
	Description                        string  `json:"description"`
	BidPrice                           float64 `json:"bidPrice"`
	BidSize                            float64 `json:"bidSize"`
	BidID                              string  `json:"bidId"`
	AskPrice                           float64 `json:"askPrice"`
	AskSize                            float64 `json:"askSize"`
	AskID                              string  `json:"askId"`
	LastPrice                          float64 `json:"lastPrice"`
	LastSize                           float64 `json:"lastSize"`
	LastID                             string  `json:"lastId"`
	OpenPrice                          float64 `json:"openPrice"`
	HighPrice                          float64 `json:"highPrice"`
	LowPrice                           float64 `json:"lowPrice"`
	BidTick                            string  `json:"bidTick"`
	ClosePrice                         float64 `json:"closePrice"`
	NetChange                          float64 `json:"netChange"`
	TotalVolume                        float64 `json:"totalVolume"`
	QuoteTimeInLong                    int64   `json:"quoteTimeInLong"`
	TradeTimeInLong                    int64   `json:"tradeTimeInLong"`
	Mark                               float64 `json:"mark"`
	Exchange                           string  `json:"exchange"`
	ExchangeName                       string  `json:"exchangeName"`
	Marginable                         bool    `json:"marginable"`
	Shortable                          bool    `json:"shortable"`
	Volatility                         float64 `json:"volatility"`
	Digits                             int     `json:"digits"`
	Five2WkHigh                        float64 `json:"52WkHigh"`
	Five2WkLow                         float64 `json:"52WkLow"`
	NAV                                float64 `json:"nAV"`
	PeRatio                            float64 `json:"peRatio"`
	DivAmount                          float64 `json:"divAmount"`
	DivYield                           float64 `json:"divYield"`
	DivDate                            string  `json:"divDate"`
	SecurityStatus                     string  `json:"securityStatus"`
	RegularMarketLastPrice             float64 `json:"regularMarketLastPrice"`
	RegularMarketLastSize              int     `json:"regularMarketLastSize"`
	RegularMarketNetChange             float64 `json:"regularMarketNetChange"`
	RegularMarketTradeTimeInLong       int64   `json:"regularMarketTradeTimeInLong"`
	NetPercentChangeInDouble           float64 `json:"netPercentChangeInDouble"`
	MarkChangeInDouble                 float64 `json:"markChangeInDouble"`
	MarkPercentChangeInDouble          float64 `json:"markPercentChangeInDouble"`
	RegularMarketPercentChangeInDouble float64 `json:"regularMarketPercentChangeInDouble"`
	Delayed                            bool    `json:"delayed"`
}

type Quotes

type Quotes map[string]*Quote

type QuotesService

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

QuotesService handles communication with the marketdata related methods of the TDAmeritrade API.

TDAmeritrade API docs: https://developer.tdameritrade.com/quotes/apis

func (*QuotesService) GetQuotes

func (s *QuotesService) GetQuotes(ctx context.Context, symbols string) (*Quotes, *Response, error)

type Response

type Response struct {
	*http.Response
}

type SecuritiesAccount

type SecuritiesAccount struct {
	Type                    string  `json:"type"`
	AccountID               string  `json:"accountId"`
	RoundTrips              float64 `json:"roundTrips"`
	IsDayTrader             bool    `json:"isDayTrader"`
	IsClosingOnlyRestricted bool    `json:"isClosingOnlyRestricted"`
	Positions               []struct {
		ShortQuantity                  float64    `json:"shortQuantity"`
		AveragePrice                   float64    `json:"averagePrice"`
		CurrentDayProfitLoss           float64    `json:"currentDayProfitLoss"`
		CurrentDayProfitLossPercentage float64    `json:"currentDayProfitLossPercentage"`
		LongQuantity                   float64    `json:"longQuantity"`
		SettledLongQuantity            float64    `json:"settledLongQuantity"`
		SettledShortQuantity           float64    `json:"settledShortQuantity"`
		AgedQuantity                   float64    `json:"agedQuantity"`
		Instrument                     Instrument `json:"instrument"`
		MarketValue                    float64    `json:"marketValue"`
	} `json:"positions"`
	OrderStrategies []struct {
		Session    string `json:"session"`
		Duration   string `json:"duration"`
		OrderType  string `json:"orderType"`
		CancelTime struct {
			Date        string `json:"date"`
			ShortFormat bool   `json:"shortFormat"`
		} `json:"cancelTime"`
		ComplexOrderStrategyType string  `json:"complexOrderStrategyType"`
		Quantity                 float64 `json:"quantity"`
		FilledQuantity           float64 `json:"filledQuantity"`
		RemainingQuantity        float64 `json:"remainingQuantity"`
		RequestedDestination     string  `json:"requestedDestination"`
		DestinationLinkName      string  `json:"destinationLinkName"`
		ReleaseTime              string  `json:"releaseTime"`
		StopPrice                float64 `json:"stopPrice"`
		StopPriceLinkBasis       string  `json:"stopPriceLinkBasis"`
		StopPriceLinkType        string  `json:"stopPriceLinkType"`
		StopPriceOffset          float64 `json:"stopPriceOffset"`
		StopType                 string  `json:"stopType"`
		PriceLinkBasis           string  `json:"priceLinkBasis"`
		PriceLinkType            string  `json:"priceLinkType"`
		Price                    float64 `json:"price"`
		TaxLotMethod             string  `json:"taxLotMethod"`
		OrderLegCollection       []struct {
			OrderLegType   string  `json:"orderLegType"`
			LegID          int64   `json:"legId"`
			Instrument     string  `json:"instrument"`
			Instruction    string  `json:"instruction"`
			PositionEffect string  `json:"positionEffect"`
			Quantity       float64 `json:"quantity"`
			QuantityType   string  `json:"quantityType"`
		} `json:"orderLegCollection"`
		ActivationPrice          float64  `json:"activationPrice"`
		SpecialInstruction       string   `json:"specialInstruction"`
		OrderStrategyType        string   `json:"orderStrategyType"`
		OrderID                  int64    `json:"orderId"`
		Cancelable               bool     `json:"cancelable"`
		Editable                 bool     `json:"editable"`
		Status                   string   `json:"status"`
		EnteredTime              string   `json:"enteredTime"`
		CloseTime                string   `json:"closeTime"`
		Tag                      string   `json:"tag"`
		AccountID                int64    `json:"accountId, string"`
		OrderActivityCollection  []string `json:"orderActivityCollection"`
		ReplacingOrderCollection []struct {
		} `json:"replacingOrderCollection"`
		ChildOrderStrategies []struct {
		} `json:"childOrderStrategies"`
		StatusDescription string `json:"statusDescription"`
	} `json:"orderStrategies"`
	InitialBalances   Balance `json:"initialBalances"`
	CurrentBalances   Balance `json:"currentBalances"`
	ProjectedBalances Balance `json:"projectedBalances"`
}

type SessionHours

type SessionHours struct {
	PreMarket     []Period `json:"preMarket"`
	RegularMarket []Period `json:"regularMarket"`
	PostMarket    []Period `json:"postMarket"`
}

type Underlying

type Underlying struct {
	Symbol            string  `json:"symbol"`
	Description       string  `json:"description"`
	Change            float64 `json:"change"`
	PercentChange     float64 `json:"percentChange"`
	Close             float64 `json:"close"`
	QuoteTime         int     `json:"quoteTime"`
	TradeTime         int     `json:"tradeTime"`
	Bid               float64 `json:"bid"`
	Ask               float64 `json:"ask"`
	Last              float64 `json:"last"`
	Mark              float64 `json:"mark"`
	MarkChange        float64 `json:"markChange"`
	MarkPercentChange float64 `json:"markPercentChange"`
	BidSize           int     `json:"bidSize"`
	AskSize           int     `json:"askSize"`
	HighPrice         float64 `json:"highPrice"`
	LowPrice          float64 `json:"lowPrice"`
	OpenPrice         float64 `json:"openPrice"`
	TotalVolume       int     `json:"totalVolume"`
	ExchangeName      string  `json:"exchangeName"`
	FiftyTwoWeekHigh  float64 `json:"fiftyTwoWeekHigh"`
	FiftyTwoWeekLow   float64 `json:"fiftyTwoWeekLow"`
	Delayed           bool    `json:"delayed"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL