Documentation ¶
Index ¶
- Constants
- Variables
- func Bool(v bool) *bool
- func BoolVal(src *bool, def bool) *bool
- func NewYorkTZ() *time.Location
- type Account
- type Accounts
- type AchStatus
- type ActivityType
- type Any
- type AssetType
- type AuthParams
- type AuthTokenTimeout
- type Authorizations
- type CallExpDateMap
- type CancelTime
- type Candle
- type Candles
- type ChartType
- type Client
- func (c *Client) Account(ctx context.Context, accountID string) (out *Account, err error)
- func (c *Client) Accounts(ctx context.Context) (out []*Account, err error)
- func (c *Client) CancelOrder(ctx context.Context, accountID, orderID string) error
- func (c *Client) CreateOrder()
- func (c *Client) OptionChain(ctx context.Context, symbol string, params *OptionChainParams) (out *OptionChain, err error)
- func (c *Client) Order(ctx context.Context, accountID, orderID string) (out *Order, err error)
- func (c *Client) Orders(ctx context.Context, accountID string, maxResults int, ...) (out []*Order, err error)
- func (c *Client) PriceHistory(ctx context.Context, symbol string, params *HistoryParams) (_ Candles, err error)
- func (c *Client) Quote(ctx context.Context, symbol string) (q *Quote, err error)
- func (c *Client) Quotes(ctx context.Context, symbols ...string) (out map[string]*Quote, err error)
- func (c *Client) Request(ctx context.Context, method, ep string, in, out interface{}) error
- func (c *Client) Streamer(ctx context.Context, qos int) (s *Streamer, err error)
- func (c *Client) Token(ctx context.Context) (*oauth2.Token, error)
- func (c *Client) UserPrincipals(ctx context.Context, fields []string) (out *UserPrincipal, err error)
- type ComplexOrderStrategyType
- type ContractType
- type CurrencyType
- type CurrentBalances
- type DateTime
- type DefaultAdvancedToolLaunch
- type DefaultEquityOrderDuration
- type DefaultEquityOrderLegInstruction
- type DefaultEquityOrderMarketSession
- type DefaultEquityOrderPriceLinkType
- type DefaultEquityOrderType
- type Direction
- type Duration
- type EquityTaxLotMethod
- type ExecutionLegs
- type ExecutionType
- type FrequencyType
- type HistoryParams
- type Hours
- type InitialBalances
- type Instruction
- type Instrument
- type Keys
- type MarketType
- type MonthlyStrategyList
- type Mover
- type MutualFundTaxLotMethod
- type Option
- type OptionChain
- type OptionChainDate
- type OptionChainParams
- type OptionDeliverables
- type OptionStrategyList
- type OptionTaxLotMethod
- type OptionTradingLevel
- type Order
- type OrderActivityCollection
- type OrderLegCollection
- type OrderLegType
- type OrderStrategies
- type OrderStrategyType
- type OrderType
- type PeriodType
- type PositionEffect
- type Positions
- type Preferences
- type PriceLinkBasis
- type PriceLinkType
- type ProfessionalStatus
- type ProjectedBalances
- type PutCall
- type PutExpDateMap
- type QuantityType
- type Quote
- type Quotes
- type RequestedDestination
- type SecuritiesAccount
- type Session
- type SpecialInstruction
- type Status
- type StopPriceLinkBasis
- type StopPriceLinkType
- type StopType
- type Strategy
- type StrategyLeg
- type StreamRequestParams
- type Streamer
- func (s *Streamer) AccountActivity(ctx context.Context) (<-chan Any, error)
- func (s *Streamer) Chart(ctx context.Context, chartType ChartType, symbols ...string) (<-chan Any, error)
- func (s *Streamer) Close() error
- func (s *Streamer) SetQoS(ctx context.Context, qos int) error
- func (s *Streamer) Subscribe(ctx context.Context, svc string, params StreamRequestParams) (<-chan Any, error)
- func (s *Streamer) Unsubcribe(ctx context.Context, svc string) error
- type StreamerInfo
- type StreamerSubscriptionKeys
- type Strike
- type StrikeRange
- type TaxLotMethod
- type Transaction
- type TransactionItem
- type Type
- type Underlying
- type UserPrincipal
- type Watchlist
- type WatchlistItems
Constants ¶
View Source
const ( DayPeriod = PeriodType("day") MonthPeriod = PeriodType("month") YearPeriod = PeriodType("year") YearToDatePeriod = PeriodType("ytd") )
View Source
const ( MinuteFrequency = FrequencyType("minute") DailyFrequency = FrequencyType("daily") WeeklyFrequency = FrequencyType("weekly") MonthlyFrequency = FrequencyType("monthly") )
View Source
const APIPath = "https://api.tdameritrade.com/v1/"
View Source
const DateTimeFormat = `2006-01-02T15:04:05+0000`
View Source
const Version = "v0.1"
Variables ¶
View Source
var ( ErrNoSymbols = errors.New("must provide at least one symbol") ErrMissingAccountID = errors.New("missing account id and DefaultAccountID isn't set") ErrMissingAuthParams = errors.New("token is invalid and no auth params were provided") )
View Source
var AllUserPrincipalFields = []string{"streamerConnectionInfo", "streamerSubscriptionKeys", "preferences", "surrogateIds"}
View Source
var Endpoint = oauth2.Endpoint{ AuthURL: "https://auth.tdameritrade.com/auth", TokenURL: APIPath + "oauth2/token", }
Functions ¶
Types ¶
type Account ¶
type Account struct { AccountID string `json:"accountId,omitempty"` ActivityType ActivityType `json:"activityType,omitempty"` AssetType AssetType `json:"assetType,omitempty"` CurrentBalances *CurrentBalances `json:"currentBalances,omitempty"` Cusip string `json:"cusip,omitempty"` Description string `json:"description,omitempty"` ExecutionLegs []*ExecutionLegs `json:"executionLegs,omitempty"` ExecutionType ExecutionType `json:"executionType,omitempty"` Factor float64 `json:"factor,omitempty"` InitialBalances *InitialBalances `json:"initialBalances,omitempty"` IsClosingOnlyRestricted bool `json:"isClosingOnlyRestricted,omitempty"` IsDayTrader bool `json:"isDayTrader,omitempty"` MaturityDate DateTime `json:"maturityDate,omitempty"` OptionDeliverables []*OptionDeliverables `json:"optionDeliverables,omitempty"` OptionMultiplier int64 `json:"optionMultiplier,omitempty"` OrderRemainingQuantity float64 `json:"orderRemainingQuantity,omitempty"` OrderStrategies []*OrderStrategies `json:"orderStrategies,omitempty"` Positions []*Positions `json:"positions,omitempty"` ProjectedBalances *ProjectedBalances `json:"projectedBalances,omitempty"` PutCall PutCall `json:"putCall,omitempty"` Quantity float64 `json:"quantity,omitempty"` RoundTrips int64 `json:"roundTrips,omitempty"` SecuritiesAccount *SecuritiesAccount `json:"securitiesAccount,omitempty"` Symbol string `json:"symbol,omitempty"` Type Type `json:"type,omitempty"` UnderlyingSymbol string `json:"underlyingSymbol,omitempty"` VariableRate float64 `json:"variableRate,omitempty"` }
type Accounts ¶
type Accounts struct { AccountCdDomainID string `json:"accountCdDomainId,omitempty"` AccountID string `json:"accountId,omitempty"` Acl string `json:"acl,omitempty"` Authorizations *Authorizations `json:"authorizations,omitempty"` Company string `json:"company,omitempty"` Description string `json:"description,omitempty"` DisplayName string `json:"displayName,omitempty"` Preferences *Preferences `json:"preferences,omitempty"` Segment string `json:"segment,omitempty"` SurrogateIDs Any `json:"surrogateIds,omitempty"` }
type ActivityType ¶
type ActivityType string
const ( ActivityTypeExecution ActivityType = "EXECUTION" ActivityTypeOrderAction ActivityType = "ORDER_ACTION" )
type AssetType ¶
type AssetType string
const ( AssetTypeEquity AssetType = "EQUITY" AssetTypeOption AssetType = "OPTION" AssetTypeIndex AssetType = "INDEX" AssetTypeMutualFund AssetType = "MUTUAL_FUND" AssetTypeCashEquivalent AssetType = "CASH_EQUIVALENT" AssetTypeFixedIncome AssetType = "FIXED_INCOME" AssetTypeCurrency AssetType = "CURRENCY" )
type AuthParams ¶
type AuthTokenTimeout ¶
type AuthTokenTimeout string
const ( AuthTokenTimeoutFiftyFiveMinutes AuthTokenTimeout = "FIFTY_FIVE_MINUTES" AuthTokenTimeoutTwoHours AuthTokenTimeout = "TWO_HOURS" AuthTokenTimeoutFourHours AuthTokenTimeout = "FOUR_HOURS" AuthTokenTimeoutEightHours AuthTokenTimeout = "EIGHT_HOURS" )
type Authorizations ¶
type Authorizations struct { AdvancedMargin bool `json:"advancedMargin,omitempty"` Apex bool `json:"apex,omitempty"` LevelTwoQuotes bool `json:"levelTwoQuotes,omitempty"` MarginTrading bool `json:"marginTrading,omitempty"` OptionTradingLevel OptionTradingLevel `json:"optionTradingLevel,omitempty"` ScottradeAccount bool `json:"scottradeAccount,omitempty"` StockTrading bool `json:"stockTrading,omitempty"` StreamerAccess bool `json:"streamerAccess,omitempty"` StreamingNews bool `json:"streamingNews,omitempty"` }
type CallExpDateMap ¶
type CancelTime ¶
type Client ¶
type Client struct { DefaultAccountID string OnRawResponse func(method, url string, req, resp []byte) // contains filtered or unexported fields }
func NewWithAutoAuth ¶
func NewWithAutoAuth(ctx context.Context, consumerID string, addr string, tok *oauth2.Token) (c *Client, err error)
NewWithAutoAuth will return a client if the token is valid, otherwise will create a server listening on addr and print an auth url.
func (*Client) CancelOrder ¶
func (*Client) CreateOrder ¶
func (c *Client) CreateOrder()
func (*Client) OptionChain ¶
func (c *Client) OptionChain(ctx context.Context, symbol string, params *OptionChainParams) (out *OptionChain, err error)
OptionChain is complicated... check https://developer.tdameritrade.com/option-chains/apis/get/marketdata/chains
func (*Client) Orders ¶
func (c *Client) Orders(ctx context.Context, accountID string, maxResults int, fromEnteredTime, toEnteredTime string, status Status) (out []*Order, err error)
Orders returns either all the orders for the given accountID, if accountID and DefaultAccountID are empty, it returns all orders for all accounts.
func (*Client) PriceHistory ¶
func (*Client) UserPrincipals ¶
type ComplexOrderStrategyType ¶
type ComplexOrderStrategyType string
const ( ComplexOrderStrategyTypeNone ComplexOrderStrategyType = "NONE" ComplexOrderStrategyTypeCovered ComplexOrderStrategyType = "COVERED" ComplexOrderStrategyTypeVertical ComplexOrderStrategyType = "VERTICAL" ComplexOrderStrategyTypeBackRatio ComplexOrderStrategyType = "BACK_RATIO" ComplexOrderStrategyTypeCalendar ComplexOrderStrategyType = "CALENDAR" ComplexOrderStrategyTypeDiagonal ComplexOrderStrategyType = "DIAGONAL" ComplexOrderStrategyTypeStraddle ComplexOrderStrategyType = "STRADDLE" ComplexOrderStrategyTypeStrangle ComplexOrderStrategyType = "STRANGLE" ComplexOrderStrategyTypeCollarSynthetic ComplexOrderStrategyType = "COLLAR_SYNTHETIC" ComplexOrderStrategyTypeButterfly ComplexOrderStrategyType = "BUTTERFLY" ComplexOrderStrategyTypeCondor ComplexOrderStrategyType = "CONDOR" ComplexOrderStrategyTypeIronCondor ComplexOrderStrategyType = "IRON_CONDOR" ComplexOrderStrategyTypeVerticalRoll ComplexOrderStrategyType = "VERTICAL_ROLL" ComplexOrderStrategyTypeCollarWithStock ComplexOrderStrategyType = "COLLAR_WITH_STOCK" ComplexOrderStrategyTypeDoubleDiagonal ComplexOrderStrategyType = "DOUBLE_DIAGONAL" ComplexOrderStrategyTypeUnbalancedButterfly ComplexOrderStrategyType = "UNBALANCED_BUTTERFLY" ComplexOrderStrategyTypeUnbalancedCondor ComplexOrderStrategyType = "UNBALANCED_CONDOR" ComplexOrderStrategyTypeUnbalancedIronCondor ComplexOrderStrategyType = "UNBALANCED_IRON_CONDOR" ComplexOrderStrategyTypeUnbalancedVerticalRoll ComplexOrderStrategyType = "UNBALANCED_VERTICAL_ROLL" ComplexOrderStrategyTypeCustom ComplexOrderStrategyType = "CUSTOM" )
type ContractType ¶
type ContractType string
const ( PutContracts ContractType = "PUT" CallContracts ContractType = "CALL" AllContracts ContractType = "ALL" )
type CurrencyType ¶
type CurrencyType string
const ( CurrencyTypeUsd CurrencyType = "USD" CurrencyTypeCad CurrencyType = "CAD" CurrencyTypeEur CurrencyType = "EUR" CurrencyTypeJpy CurrencyType = "JPY" )
type CurrentBalances ¶
type CurrentBalances struct { AccruedInterest float64 `json:"accruedInterest,omitempty"` AvailableFunds float64 `json:"availableFunds,omitempty"` AvailableFundsNonMarginableTrade float64 `json:"availableFundsNonMarginableTrade,omitempty"` BondValue float64 `json:"bondValue,omitempty"` BuyingPower float64 `json:"buyingPower,omitempty"` BuyingPowerNonMarginableTrade float64 `json:"buyingPowerNonMarginableTrade,omitempty"` CashBalance float64 `json:"cashBalance,omitempty"` CashReceipts float64 `json:"cashReceipts,omitempty"` DayTradingBuyingPower float64 `json:"dayTradingBuyingPower,omitempty"` DayTradingBuyingPowerCall float64 `json:"dayTradingBuyingPowerCall,omitempty"` Equity float64 `json:"equity,omitempty"` EquityPercentage float64 `json:"equityPercentage,omitempty"` IsInCall bool `json:"isInCall,omitempty"` LiquidationValue float64 `json:"liquidationValue,omitempty"` LongMarginValue float64 `json:"longMarginValue,omitempty"` LongMarketValue float64 `json:"longMarketValue,omitempty"` LongOptionMarketValue float64 `json:"longOptionMarketValue,omitempty"` MaintenanceCall float64 `json:"maintenanceCall,omitempty"` MaintenanceRequirement float64 `json:"maintenanceRequirement,omitempty"` MarginBalance float64 `json:"marginBalance,omitempty"` MoneyMarketFund float64 `json:"moneyMarketFund,omitempty"` MutualFundValue float64 `json:"mutualFundValue,omitempty"` OptionBuyingPower float64 `json:"optionBuyingPower,omitempty"` PendingDeposits float64 `json:"pendingDeposits,omitempty"` RegTCall float64 `json:"regTCall,omitempty"` Savings float64 `json:"savings,omitempty"` ShortBalance float64 `json:"shortBalance,omitempty"` ShortMarginValue float64 `json:"shortMarginValue,omitempty"` ShortMarketValue float64 `json:"shortMarketValue,omitempty"` ShortOptionMarketValue float64 `json:"shortOptionMarketValue,omitempty"` Sma float64 `json:"sma,omitempty"` StockBuyingPower float64 `json:"stockBuyingPower,omitempty"` }
type DateTime ¶
type DateTime string
DateTime represents a timestamp in TD's format
func (DateTime) MarshalJSON ¶
func (*DateTime) UnmarshalJSON ¶
type DefaultAdvancedToolLaunch ¶
type DefaultAdvancedToolLaunch string
const ( DefaultAdvancedToolLaunchTa DefaultAdvancedToolLaunch = "TA" DefaultAdvancedToolLaunchN DefaultAdvancedToolLaunch = "N" DefaultAdvancedToolLaunchY DefaultAdvancedToolLaunch = "Y" DefaultAdvancedToolLaunchTos DefaultAdvancedToolLaunch = "TOS" DefaultAdvancedToolLaunchNone DefaultAdvancedToolLaunch = "NONE" DefaultAdvancedToolLaunchCc2 DefaultAdvancedToolLaunch = "CC2" )
type DefaultEquityOrderDuration ¶
type DefaultEquityOrderDuration string
const ( DefaultEquityOrderDurationDay DefaultEquityOrderDuration = "DAY" DefaultEquityOrderDurationGoodTillCancel DefaultEquityOrderDuration = "GOOD_TILL_CANCEL" DefaultEquityOrderDurationNone DefaultEquityOrderDuration = "NONE" )
type DefaultEquityOrderLegInstruction ¶
type DefaultEquityOrderLegInstruction string
const ( DefaultEquityOrderLegInstructionBuy DefaultEquityOrderLegInstruction = "BUY" DefaultEquityOrderLegInstructionSell DefaultEquityOrderLegInstruction = "SELL" DefaultEquityOrderLegInstructionBuyToCover DefaultEquityOrderLegInstruction = "BUY_TO_COVER" DefaultEquityOrderLegInstructionSellShort DefaultEquityOrderLegInstruction = "SELL_SHORT" DefaultEquityOrderLegInstructionNone DefaultEquityOrderLegInstruction = "NONE" )
type DefaultEquityOrderMarketSession ¶
type DefaultEquityOrderMarketSession string
const ( DefaultEquityOrderMarketSessionAm DefaultEquityOrderMarketSession = "AM" DefaultEquityOrderMarketSessionPm DefaultEquityOrderMarketSession = "PM" DefaultEquityOrderMarketSessionNormal DefaultEquityOrderMarketSession = "NORMAL" DefaultEquityOrderMarketSessionSeamless DefaultEquityOrderMarketSession = "SEAMLESS" DefaultEquityOrderMarketSessionNone DefaultEquityOrderMarketSession = "NONE" )
type DefaultEquityOrderPriceLinkType ¶
type DefaultEquityOrderPriceLinkType string
const ( DefaultEquityOrderPriceLinkTypeValue DefaultEquityOrderPriceLinkType = "VALUE" DefaultEquityOrderPriceLinkTypePercent DefaultEquityOrderPriceLinkType = "PERCENT" DefaultEquityOrderPriceLinkTypeNone DefaultEquityOrderPriceLinkType = "NONE" )
type DefaultEquityOrderType ¶
type DefaultEquityOrderType string
const ( DefaultEquityOrderTypeMarket DefaultEquityOrderType = "MARKET" DefaultEquityOrderTypeLimit DefaultEquityOrderType = "LIMIT" DefaultEquityOrderTypeStop DefaultEquityOrderType = "STOP" DefaultEquityOrderTypeStopLimit DefaultEquityOrderType = "STOP_LIMIT" DefaultEquityOrderTypeTrailingStop DefaultEquityOrderType = "TRAILING_STOP" DefaultEquityOrderTypeMarketOnClose DefaultEquityOrderType = "MARKET_ON_CLOSE" DefaultEquityOrderTypeNone DefaultEquityOrderType = "NONE" )
type EquityTaxLotMethod ¶
type EquityTaxLotMethod string
const ( EquityTaxLotMethodFifo EquityTaxLotMethod = "FIFO" EquityTaxLotMethodLifo EquityTaxLotMethod = "LIFO" EquityTaxLotMethodHighCost EquityTaxLotMethod = "HIGH_COST" EquityTaxLotMethodLowCost EquityTaxLotMethod = "LOW_COST" EquityTaxLotMethodMinimumTax EquityTaxLotMethod = "MINIMUM_TAX" EquityTaxLotMethodAverageCost EquityTaxLotMethod = "AVERAGE_COST" EquityTaxLotMethodNone EquityTaxLotMethod = "NONE" )
type ExecutionLegs ¶
type FrequencyType ¶
type FrequencyType string
type HistoryParams ¶
type HistoryParams struct { // The type of period to show. Valid values are day, month, year, or ytd (year to date). Default is day. PeriodType PeriodType `json:"periodType,omitempty"` // The number of periods to show. // Example: For a 2 day / 1 min chart, the values would be: // period: 2 // periodType: day // frequency: 1 // frequencyType: min // Valid periods by periodType (defaults marked with an asterisk): // day: 1, 2, 3, 4, 5, 10* // month: 1*, 2, 3, 6 // year: 1*, 2, 3, 5, 10, 15, 20 // ytd: 1* Period int `json:"period,omitempty"` // The type of frequency with which a new candle is formed. // Valid frequencyTypes by periodType (defaults marked with an asterisk): // day: minute* // month: daily, weekly* // year: daily, weekly, monthly* // ytd: daily, weekly* FrequencyType FrequencyType `json:"frequencyType,omitempty"` // minute: 1*, 5, 10, 15, 30 // daily: 1* // weekly: 1* // monthly: 1* Frequency int `json:"frequency,omitempty"` // End date as milliseconds since epoch. If startDate and endDate are provided, period should not be provided. Default is previous trading day. StartDate time.Time `json:"startDate,omitempty"` // Start date as milliseconds since epoch. If startDate and endDate are provided, period should not be provided. EndDate time.Time `json:"endDate,omitempty"` // true to return extended hours data, false for regular market hours only. Default is true // use Bool to easily return a pointer NeedExtendedHoursData *bool `json:"needExtendedHoursData,omitempty"` }
func (*HistoryParams) Query ¶
func (p *HistoryParams) Query() string
type Hours ¶
type Hours struct { Category string `json:"category,omitempty"` Date string `json:"date,omitempty"` Exchange string `json:"exchange,omitempty"` IsOpen bool `json:"isOpen,omitempty"` MarketType MarketType `json:"marketType,omitempty"` Product string `json:"product,omitempty"` ProductName string `json:"productName,omitempty"` SessionHours Any `json:"sessionHours,omitempty"` }
type InitialBalances ¶
type InitialBalances struct { AccountValue float64 `json:"accountValue,omitempty"` AccruedInterest float64 `json:"accruedInterest,omitempty"` AvailableFundsNonMarginableTrade float64 `json:"availableFundsNonMarginableTrade,omitempty"` BondValue float64 `json:"bondValue,omitempty"` BuyingPower float64 `json:"buyingPower,omitempty"` CashAvailableForTrading float64 `json:"cashAvailableForTrading,omitempty"` CashBalance float64 `json:"cashBalance,omitempty"` CashReceipts float64 `json:"cashReceipts,omitempty"` DayTradingBuyingPower float64 `json:"dayTradingBuyingPower,omitempty"` DayTradingBuyingPowerCall float64 `json:"dayTradingBuyingPowerCall,omitempty"` DayTradingEquityCall float64 `json:"dayTradingEquityCall,omitempty"` Equity float64 `json:"equity,omitempty"` EquityPercentage float64 `json:"equityPercentage,omitempty"` IsInCall bool `json:"isInCall,omitempty"` LiquidationValue float64 `json:"liquidationValue,omitempty"` LongMarginValue float64 `json:"longMarginValue,omitempty"` LongOptionMarketValue float64 `json:"longOptionMarketValue,omitempty"` LongStockValue float64 `json:"longStockValue,omitempty"` MaintenanceCall float64 `json:"maintenanceCall,omitempty"` MaintenanceRequirement float64 `json:"maintenanceRequirement,omitempty"` Margin float64 `json:"margin,omitempty"` MarginBalance float64 `json:"marginBalance,omitempty"` MarginEquity float64 `json:"marginEquity,omitempty"` MoneyMarketFund float64 `json:"moneyMarketFund,omitempty"` MutualFundValue float64 `json:"mutualFundValue,omitempty"` PendingDeposits float64 `json:"pendingDeposits,omitempty"` RegTCall float64 `json:"regTCall,omitempty"` ShortBalance float64 `json:"shortBalance,omitempty"` ShortMarginValue float64 `json:"shortMarginValue,omitempty"` ShortOptionMarketValue float64 `json:"shortOptionMarketValue,omitempty"` ShortStockValue float64 `json:"shortStockValue,omitempty"` TotalCash float64 `json:"totalCash,omitempty"` UnsettledCash float64 `json:"unsettledCash,omitempty"` }
type Instruction ¶
type Instruction string
const ( InstructionBuy Instruction = "BUY" InstructionSell Instruction = "SELL" InstructionBuyToCover Instruction = "BUY_TO_COVER" InstructionSellShort Instruction = "SELL_SHORT" InstructionBuyToOpen Instruction = "BUY_TO_OPEN" InstructionBuyToClose Instruction = "BUY_TO_CLOSE" InstructionSellToOpen Instruction = "SELL_TO_OPEN" InstructionSellToClose Instruction = "SELL_TO_CLOSE" InstructionExchange Instruction = "EXCHANGE" )
type Instrument ¶
type MarketType ¶
type MarketType string
const ( MarketTypeBond MarketType = "BOND" MarketTypeEquity MarketType = "EQUITY" MarketTypeEtf MarketType = "ETF" MarketTypeForex MarketType = "FOREX" MarketTypeFuture MarketType = "FUTURE" MarketTypeFutureOption MarketType = "FUTURE_OPTION" MarketTypeIndex MarketType = "INDEX" MarketTypeIndicator MarketType = "INDICATOR" MarketTypeMutualFund MarketType = "MUTUAL_FUND" MarketTypeOption MarketType = "OPTION" MarketTypeUnknown MarketType = "UNKNOWN" )
type MonthlyStrategyList ¶
type MonthlyStrategyList struct { Month string `json:"month,omitempty"` Year int `json:"year,omitempty"` Day int `json:"day,omitempty"` DaysToExp int `json:"daysToExp,omitempty"` SecondaryMonth string `json:"secondaryMonth,omitempty"` SecondaryYear int `json:"secondaryYear,omitempty"` SecondaryDay int `json:"secondaryDay,omitempty"` SecondaryDaysToExp int `json:"secondaryDaysToExp,omitempty"` Type string `json:"type,omitempty"` SecondaryType string `json:"secondaryType,omitempty"` Leap bool `json:"leap,omitempty"` OptionStrategyList []OptionStrategyList `json:"optionStrategyList,omitempty"` SecondaryLeap bool `json:"secondaryLeap,omitempty"` }
type MutualFundTaxLotMethod ¶
type MutualFundTaxLotMethod string
const ( MutualFundTaxLotMethodFifo MutualFundTaxLotMethod = "FIFO" MutualFundTaxLotMethodLifo MutualFundTaxLotMethod = "LIFO" MutualFundTaxLotMethodHighCost MutualFundTaxLotMethod = "HIGH_COST" MutualFundTaxLotMethodLowCost MutualFundTaxLotMethod = "LOW_COST" MutualFundTaxLotMethodMinimumTax MutualFundTaxLotMethod = "MINIMUM_TAX" MutualFundTaxLotMethodAverageCost MutualFundTaxLotMethod = "AVERAGE_COST" MutualFundTaxLotMethodNone MutualFundTaxLotMethod = "NONE" )
type Option ¶
type Option struct { PutCall string `json:"putCall,omitempty"` Symbol string `json:"symbol,omitempty"` Description string `json:"description,omitempty"` ExchangeName string `json:"exchangeName,omitempty"` Bid float64 `json:"bid,omitempty"` Ask float64 `json:"ask,omitempty"` Last float64 `json:"last,omitempty"` Mark float64 `json:"mark,omitempty"` BidSize int `json:"bidSize,omitempty"` AskSize int `json:"askSize,omitempty"` BidAskSize string `json:"bidAskSize,omitempty"` LastSize int `json:"lastSize,omitempty"` HighPrice float64 `json:"highPrice,omitempty"` LowPrice float64 `json:"lowPrice,omitempty"` OpenPrice float64 `json:"openPrice,omitempty"` ClosePrice float64 `json:"closePrice,omitempty"` TotalVolume int `json:"totalVolume,omitempty"` TradeDate interface{} `json:"tradeDate,omitempty"` TradeTimeInLong int64 `json:"tradeTimeInLong,omitempty"` QuoteTimeInLong int64 `json:"quoteTimeInLong,omitempty"` NetChange float64 `json:"netChange,omitempty"` Volatility float64 `json:"volatility,omitempty"` Delta float64 `json:"delta,omitempty"` Gamma float64 `json:"gamma,omitempty"` Theta float64 `json:"theta,omitempty"` Vega float64 `json:"vega,omitempty"` Rho float64 `json:"rho,omitempty"` OpenInterest int `json:"openInterest,omitempty"` TimeValue float64 `json:"timeValue,omitempty"` TheoreticalOptionValue float64 `json:"theoreticalOptionValue,omitempty"` TheoreticalVolatility float64 `json:"theoreticalVolatility,omitempty"` OptionDeliverablesList Any `json:"optionDeliverablesList,omitempty"` StrikePrice float64 `json:"strikePrice,omitempty"` ExpirationDate int64 `json:"expirationDate,omitempty"` DaysToExpiration int `json:"daysToExpiration,omitempty"` ExpirationType string `json:"expirationType,omitempty"` LastTradingDay int64 `json:"lastTradingDay,omitempty"` Multiplier float64 `json:"multiplier,omitempty"` SettlementType string `json:"settlementType,omitempty"` DeliverableNote string `json:"deliverableNote,omitempty"` IsIndexOption Any `json:"isIndexOption,omitempty"` PercentChange float64 `json:"percentChange,omitempty"` MarkChange float64 `json:"markChange,omitempty"` MarkPercentChange float64 `json:"markPercentChange,omitempty"` NonStandard bool `json:"nonStandard,omitempty"` InTheMoney bool `json:"inTheMoney,omitempty"` Mini bool `json:"mini,omitempty"` }
type OptionChain ¶
type OptionChain struct { Symbol string `json:"symbol,omitempty"` Status string `json:"status,omitempty"` Underlying *Underlying `json:"underlying,omitempty"` Strategy Strategy `json:"strategy,omitempty"` Interval float64 `json:"interval,omitempty"` IsDelayed bool `json:"isDelayed,omitempty"` IsIndex bool `json:"isIndex,omitempty"` InterestRate float64 `json:"interestRate,omitempty"` UnderlyingPrice float64 `json:"underlyingPrice,omitempty"` Volatility float64 `json:"volatility,omitempty"` DaysToExpiration float64 `json:"daysToExpiration,omitempty"` NumberOfContracts int `json:"numberOfContracts,omitempty"` MonthlyStrategyList []MonthlyStrategyList `json:"monthlyStrategyList,omitempty"` CallExpDateMap CallExpDateMap `json:"callExpDateMap,omitempty"` PutExpDateMap PutExpDateMap `json:"putExpDateMap,omitempty"` }
type OptionChainDate ¶
type OptionChainDate string
func (OptionChainDate) Time ¶
func (o OptionChainDate) Time() (t time.Time)
type OptionChainParams ¶
type OptionChainParams struct { // Type of contracts to return in the chain. Can be CALL, PUT, or ALL. Default is ALL. ContractType ContractType `json:"contractType,omitempty"` // The number of strikes to return above and below the at-the-money price. StrikeCount int // Include quotes for options in the option chain. Can be TRUE or FALSE. Default is FALSE. IncludeQuotes bool // Passing a value returns a Strategy Chain. Possible values are SINGLE, ANALYTICAL (allows use of the volatility, underlyingPrice, interestRate, and daysToExpiration params to calculate theoretical values), COVERED, VERTICAL, CALENDAR, STRANGLE, STRADDLE, BUTTERFLY, CONDOR, DIAGONAL, COLLAR, or ROLL. Default is SINGLE. Strategy Strategy // Strike interval for spread strategy chains (see strategy param). Interval int // Provide a strike price to return options only at that strike price. Strike float64 // Returns options for the given range. Possible values are: // ITM: In-the-money // NTM: Near-the-money // OTM: Out-of-the-money // SAK: Strikes Above Market // SBK: Strikes Below Market // SNK: Strikes Near Market // ALL: All Strikes // Default is ALL. Range StrikeRange // Only return expirations after this date. For strategies, expiration refers to the nearest term expiration in the strategy. // Valid ISO-8601 formats are: 2006-01-02 and 2006-01-02T15:04:05 FromDate DateTime // Only return expirations before this date. For strategies, expiration refers to the nearest term expiration in the strategy. // Valid ISO-8601 formats are: 2006-01-02 and 2006-01-02T15:04:05 ToDate DateTime // Volatility to use in calculations. Applies only to ANALYTICAL strategy chains (see strategy param). Volatility float64 // Underlying price to use in calculations. Applies only to ANALYTICAL strategy chains (see strategy param). UnderlyingPrice float64 // Interest rate to use in calculations. Applies only to ANALYTICAL strategy chains (see strategy param). InterestRate float64 // Days to expiration to use in calculations. Applies only to ANALYTICAL strategy chains (see strategy param). DaysToExpiration int // Return only options expiring in the specified month. Month is given in the three character format. // Example: JAN // Default is ALL. ExpMonth string // Type of contracts to return. Possible values are: // S: Standard contracts // NS: Non-standard contracts // ALL: All contracts OptionType string }
type OptionDeliverables ¶
type OptionDeliverables struct { AssetType AssetType `json:"assetType,omitempty"` CurrencyType CurrencyType `json:"currencyType,omitempty"` DeliverableUnits float64 `json:"deliverableUnits,omitempty"` Symbol string `json:"symbol,omitempty"` }
type OptionStrategyList ¶
type OptionStrategyList struct { PrimaryLeg *StrategyLeg `json:"primaryLeg,omitempty"` SecondaryLeg *StrategyLeg `json:"secondaryLeg,omitempty"` StrategyStrike string `json:"strategyStrike,omitempty"` StrategyBid float64 `json:"strategyBid,omitempty"` StrategyAsk float64 `json:"strategyAsk,omitempty"` }
type OptionTaxLotMethod ¶
type OptionTaxLotMethod string
const ( OptionTaxLotMethodFifo OptionTaxLotMethod = "FIFO" OptionTaxLotMethodLifo OptionTaxLotMethod = "LIFO" OptionTaxLotMethodHighCost OptionTaxLotMethod = "HIGH_COST" OptionTaxLotMethodLowCost OptionTaxLotMethod = "LOW_COST" OptionTaxLotMethodMinimumTax OptionTaxLotMethod = "MINIMUM_TAX" OptionTaxLotMethodAverageCost OptionTaxLotMethod = "AVERAGE_COST" OptionTaxLotMethodNone OptionTaxLotMethod = "NONE" )
type OptionTradingLevel ¶
type OptionTradingLevel string
const ( OptionTradingLevelCovered OptionTradingLevel = "COVERED" OptionTradingLevelFull OptionTradingLevel = "FULL" OptionTradingLevelLong OptionTradingLevel = "LONG" OptionTradingLevelSpread OptionTradingLevel = "SPREAD" OptionTradingLevelNone OptionTradingLevel = "NONE" )
type Order ¶
type Order struct { AccountID int64 `json:"accountId,omitempty"` ActivationPrice float64 `json:"activationPrice,omitempty"` ActivityType ActivityType `json:"activityType,omitempty"` AssetType AssetType `json:"assetType,omitempty"` Cancelable bool `json:"cancelable,omitempty"` CancelTime *CancelTime `json:"cancelTime,omitempty"` ChildOrderStrategies []Any `json:"childOrderStrategies,omitempty"` CloseTime DateTime `json:"closeTime,omitempty"` ComplexOrderStrategyType ComplexOrderStrategyType `json:"complexOrderStrategyType,omitempty"` Cusip string `json:"cusip,omitempty"` Description string `json:"description,omitempty"` DestinationLinkName string `json:"destinationLinkName,omitempty"` Duration Duration `json:"duration,omitempty"` Editable bool `json:"editable,omitempty"` EnteredTime DateTime `json:"enteredTime,omitempty"` ExecutionLegs []*ExecutionLegs `json:"executionLegs,omitempty"` ExecutionType ExecutionType `json:"executionType,omitempty"` Factor float64 `json:"factor,omitempty"` FilledQuantity float64 `json:"filledQuantity,omitempty"` MaturityDate DateTime `json:"maturityDate,omitempty"` OptionDeliverables []*OptionDeliverables `json:"optionDeliverables,omitempty"` OptionMultiplier int64 `json:"optionMultiplier,omitempty"` OrderActivityCollection []*OrderActivityCollection `json:"orderActivityCollection,omitempty"` OrderID int64 `json:"orderId,omitempty"` OrderLegCollection []*OrderLegCollection `json:"orderLegCollection,omitempty"` OrderRemainingQuantity float64 `json:"orderRemainingQuantity,omitempty"` OrderStrategyType OrderStrategyType `json:"orderStrategyType,omitempty"` OrderType OrderType `json:"orderType,omitempty"` Price float64 `json:"price,omitempty"` PriceLinkBasis PriceLinkBasis `json:"priceLinkBasis,omitempty"` PriceLinkType PriceLinkType `json:"priceLinkType,omitempty"` PutCall PutCall `json:"putCall,omitempty"` Quantity float64 `json:"quantity,omitempty"` ReleaseTime DateTime `json:"releaseTime,omitempty"` RemainingQuantity float64 `json:"remainingQuantity,omitempty"` ReplacingOrderCollection []Any `json:"replacingOrderCollection,omitempty"` RequestedDestination RequestedDestination `json:"requestedDestination,omitempty"` Session Session `json:"session,omitempty"` SpecialInstruction SpecialInstruction `json:"specialInstruction,omitempty"` Status Status `json:"status,omitempty"` StatusDescription string `json:"statusDescription,omitempty"` StopPrice float64 `json:"stopPrice,omitempty"` StopPriceLinkBasis StopPriceLinkBasis `json:"stopPriceLinkBasis,omitempty"` StopPriceLinkType StopPriceLinkType `json:"stopPriceLinkType,omitempty"` StopPriceOffset float64 `json:"stopPriceOffset,omitempty"` StopType StopType `json:"stopType,omitempty"` Symbol string `json:"symbol,omitempty"` Tag string `json:"tag,omitempty"` TaxLotMethod TaxLotMethod `json:"taxLotMethod,omitempty"` Type Type `json:"type,omitempty"` UnderlyingSymbol string `json:"underlyingSymbol,omitempty"` VariableRate float64 `json:"variableRate,omitempty"` }
type OrderActivityCollection ¶
type OrderActivityCollection struct {
ActivityType ActivityType `json:"activityType,omitempty"`
}
type OrderLegCollection ¶
type OrderLegCollection struct { Instruction Instruction `json:"instruction,omitempty"` Instrument *Instrument `json:"instrument,omitempty"` LegID int64 `json:"legId,omitempty"` OrderLegType OrderLegType `json:"orderLegType,omitempty"` PositionEffect PositionEffect `json:"positionEffect,omitempty"` Quantity float64 `json:"quantity,omitempty"` QuantityType QuantityType `json:"quantityType,omitempty"` }
type OrderLegType ¶
type OrderLegType string
const ( OrderLegTypeEquity OrderLegType = "EQUITY" OrderLegTypeOption OrderLegType = "OPTION" OrderLegTypeIndex OrderLegType = "INDEX" OrderLegTypeMutualFund OrderLegType = "MUTUAL_FUND" OrderLegTypeCashEquivalent OrderLegType = "CASH_EQUIVALENT" OrderLegTypeFixedIncome OrderLegType = "FIXED_INCOME" OrderLegTypeCurrency OrderLegType = "CURRENCY" )
type OrderStrategies ¶
type OrderStrategies struct { AccountID int64 `json:"accountId,omitempty"` ActivationPrice float64 `json:"activationPrice,omitempty"` Cancelable bool `json:"cancelable,omitempty"` CancelTime *CancelTime `json:"cancelTime,omitempty"` ChildOrderStrategies []Any `json:"childOrderStrategies,omitempty"` CloseTime DateTime `json:"closeTime,omitempty"` ComplexOrderStrategyType ComplexOrderStrategyType `json:"complexOrderStrategyType,omitempty"` DestinationLinkName string `json:"destinationLinkName,omitempty"` Duration Duration `json:"duration,omitempty"` Editable bool `json:"editable,omitempty"` EnteredTime DateTime `json:"enteredTime,omitempty"` FilledQuantity float64 `json:"filledQuantity,omitempty"` OrderActivityCollection []*OrderActivityCollection `json:"orderActivityCollection,omitempty"` OrderID int64 `json:"orderId,omitempty"` OrderLegCollection []*OrderLegCollection `json:"orderLegCollection,omitempty"` OrderStrategyType OrderStrategyType `json:"orderStrategyType,omitempty"` OrderType OrderType `json:"orderType,omitempty"` Price float64 `json:"price,omitempty"` PriceLinkBasis PriceLinkBasis `json:"priceLinkBasis,omitempty"` PriceLinkType PriceLinkType `json:"priceLinkType,omitempty"` Quantity float64 `json:"quantity,omitempty"` ReleaseTime DateTime `json:"releaseTime,omitempty"` RemainingQuantity float64 `json:"remainingQuantity,omitempty"` ReplacingOrderCollection []Any `json:"replacingOrderCollection,omitempty"` RequestedDestination RequestedDestination `json:"requestedDestination,omitempty"` Session Session `json:"session,omitempty"` SpecialInstruction SpecialInstruction `json:"specialInstruction,omitempty"` Status Status `json:"status,omitempty"` StatusDescription string `json:"statusDescription,omitempty"` StopPrice float64 `json:"stopPrice,omitempty"` StopPriceLinkBasis StopPriceLinkBasis `json:"stopPriceLinkBasis,omitempty"` StopPriceLinkType StopPriceLinkType `json:"stopPriceLinkType,omitempty"` StopPriceOffset float64 `json:"stopPriceOffset,omitempty"` StopType StopType `json:"stopType,omitempty"` Tag string `json:"tag,omitempty"` TaxLotMethod TaxLotMethod `json:"taxLotMethod,omitempty"` }
type OrderStrategyType ¶
type OrderStrategyType string
const ( OrderStrategyTypeSingle OrderStrategyType = "SINGLE" OrderStrategyTypeOco OrderStrategyType = "OCO" OrderStrategyTypeTrigger OrderStrategyType = "TRIGGER" )
type OrderType ¶
type OrderType string
const ( OrderTypeMarket OrderType = "MARKET" OrderTypeLimit OrderType = "LIMIT" OrderTypeStop OrderType = "STOP" OrderTypeStopLimit OrderType = "STOP_LIMIT" OrderTypeTrailingStop OrderType = "TRAILING_STOP" OrderTypeMarketOnClose OrderType = "MARKET_ON_CLOSE" OrderTypeExercise OrderType = "EXERCISE" OrderTypeTrailingStopLimit OrderType = "TRAILING_STOP_LIMIT" OrderTypeNetDebit OrderType = "NET_DEBIT" OrderTypeNetCredit OrderType = "NET_CREDIT" OrderTypeNetZero OrderType = "NET_ZERO" )
type PeriodType ¶
type PeriodType string
type PositionEffect ¶
type PositionEffect string
const ( PositionEffectOpening PositionEffect = "OPENING" PositionEffectClosing PositionEffect = "CLOSING" PositionEffectAutomatic PositionEffect = "AUTOMATIC" )
type Positions ¶
type Positions struct { AgedQuantity float64 `json:"agedQuantity,omitempty"` AveragePrice float64 `json:"averagePrice,omitempty"` CurrentDayProfitLoss float64 `json:"currentDayProfitLoss,omitempty"` CurrentDayProfitLossPercentage float64 `json:"currentDayProfitLossPercentage,omitempty"` Instrument *Instrument `json:"instrument,omitempty"` LongQuantity float64 `json:"longQuantity,omitempty"` MarketValue float64 `json:"marketValue,omitempty"` SettledLongQuantity float64 `json:"settledLongQuantity,omitempty"` SettledShortQuantity float64 `json:"settledShortQuantity,omitempty"` ShortQuantity float64 `json:"shortQuantity,omitempty"` }
type Preferences ¶
type Preferences struct { AuthTokenTimeout AuthTokenTimeout `json:"authTokenTimeout,omitempty"` DefaultAdvancedToolLaunch DefaultAdvancedToolLaunch `json:"defaultAdvancedToolLaunch,omitempty"` DefaultEquityOrderDuration DefaultEquityOrderDuration `json:"defaultEquityOrderDuration,omitempty"` DefaultEquityOrderLegInstruction DefaultEquityOrderLegInstruction `json:"defaultEquityOrderLegInstruction,omitempty"` DefaultEquityOrderMarketSession DefaultEquityOrderMarketSession `json:"defaultEquityOrderMarketSession,omitempty"` DefaultEquityOrderPriceLinkType DefaultEquityOrderPriceLinkType `json:"defaultEquityOrderPriceLinkType,omitempty"` DefaultEquityOrderType DefaultEquityOrderType `json:"defaultEquityOrderType,omitempty"` DefaultEquityQuantity int64 `json:"defaultEquityQuantity,omitempty"` DirectEquityRouting bool `json:"directEquityRouting,omitempty"` DirectOptionsRouting bool `json:"directOptionsRouting,omitempty"` EquityTaxLotMethod EquityTaxLotMethod `json:"equityTaxLotMethod,omitempty"` ExpressTrading bool `json:"expressTrading,omitempty"` MutualFundTaxLotMethod MutualFundTaxLotMethod `json:"mutualFundTaxLotMethod,omitempty"` OptionTaxLotMethod OptionTaxLotMethod `json:"optionTaxLotMethod,omitempty"` }
type PriceLinkBasis ¶
type PriceLinkBasis string
const ( PriceLinkBasisManual PriceLinkBasis = "MANUAL" PriceLinkBasisBase PriceLinkBasis = "BASE" PriceLinkBasisTrigger PriceLinkBasis = "TRIGGER" PriceLinkBasisLast PriceLinkBasis = "LAST" PriceLinkBasisBid PriceLinkBasis = "BID" PriceLinkBasisAsk PriceLinkBasis = "ASK" PriceLinkBasisAskBid PriceLinkBasis = "ASK_BID" PriceLinkBasisMark PriceLinkBasis = "MARK" PriceLinkBasisAverage PriceLinkBasis = "AVERAGE" )
type PriceLinkType ¶
type PriceLinkType string
const ( PriceLinkTypeValue PriceLinkType = "VALUE" PriceLinkTypePercent PriceLinkType = "PERCENT" PriceLinkTypeTick PriceLinkType = "TICK" )
type ProfessionalStatus ¶
type ProfessionalStatus string
const ( ProfessionalStatusProfessional ProfessionalStatus = "PROFESSIONAL" ProfessionalStatusNonProfessional ProfessionalStatus = "NON_PROFESSIONAL" ProfessionalStatusUnknownStatus ProfessionalStatus = "UNKNOWN_STATUS" )
type ProjectedBalances ¶
type ProjectedBalances struct { AccruedInterest float64 `json:"accruedInterest,omitempty"` AvailableFunds float64 `json:"availableFunds,omitempty"` AvailableFundsNonMarginableTrade float64 `json:"availableFundsNonMarginableTrade,omitempty"` BondValue float64 `json:"bondValue,omitempty"` BuyingPower float64 `json:"buyingPower,omitempty"` BuyingPowerNonMarginableTrade float64 `json:"buyingPowerNonMarginableTrade,omitempty"` CashBalance float64 `json:"cashBalance,omitempty"` CashReceipts float64 `json:"cashReceipts,omitempty"` DayTradingBuyingPower float64 `json:"dayTradingBuyingPower,omitempty"` DayTradingBuyingPowerCall float64 `json:"dayTradingBuyingPowerCall,omitempty"` Equity float64 `json:"equity,omitempty"` EquityPercentage float64 `json:"equityPercentage,omitempty"` IsInCall bool `json:"isInCall,omitempty"` LiquidationValue float64 `json:"liquidationValue,omitempty"` LongMarginValue float64 `json:"longMarginValue,omitempty"` LongMarketValue float64 `json:"longMarketValue,omitempty"` LongOptionMarketValue float64 `json:"longOptionMarketValue,omitempty"` MaintenanceCall float64 `json:"maintenanceCall,omitempty"` MaintenanceRequirement float64 `json:"maintenanceRequirement,omitempty"` MarginBalance float64 `json:"marginBalance,omitempty"` MoneyMarketFund float64 `json:"moneyMarketFund,omitempty"` MutualFundValue float64 `json:"mutualFundValue,omitempty"` OptionBuyingPower float64 `json:"optionBuyingPower,omitempty"` PendingDeposits float64 `json:"pendingDeposits,omitempty"` RegTCall float64 `json:"regTCall,omitempty"` Savings float64 `json:"savings,omitempty"` ShortBalance float64 `json:"shortBalance,omitempty"` ShortMarginValue float64 `json:"shortMarginValue,omitempty"` ShortMarketValue float64 `json:"shortMarketValue,omitempty"` ShortOptionMarketValue float64 `json:"shortOptionMarketValue,omitempty"` Sma float64 `json:"sma,omitempty"` StockBuyingPower float64 `json:"stockBuyingPower,omitempty"` }
type PutExpDateMap ¶
type Quote ¶
type Quote struct { AskID string `json:"askId,omitempty"` AskPrice float64 `json:"askPrice,omitempty"` AskPriceInDouble float64 `json:"askPriceInDouble,omitempty"` AskSize int64 `json:"askSize,omitempty"` BidID string `json:"bidId,omitempty"` BidPrice float64 `json:"bidPrice,omitempty"` BidPriceInDouble float64 `json:"bidPriceInDouble,omitempty"` BidSize int64 `json:"bidSize,omitempty"` ChangeInDouble float64 `json:"changeInDouble,omitempty"` ClosePrice float64 `json:"closePrice,omitempty"` ClosePriceInDouble float64 `json:"closePriceInDouble,omitempty"` ContractType string `json:"contractType,omitempty"` Deliverables string `json:"deliverables,omitempty"` Delta float64 `json:"delta,omitempty"` DeltaInDouble float64 `json:"deltaInDouble,omitempty"` Description string `json:"description,omitempty"` Digits int64 `json:"digits,omitempty"` DivAmount float64 `json:"divAmount,omitempty"` DivDate string `json:"divDate,omitempty"` DivYield float64 `json:"divYield,omitempty"` Exchange string `json:"exchange,omitempty"` ExchangeName string `json:"exchangeName,omitempty"` ExerciseType string `json:"exerciseType,omitempty"` ExpirationType string `json:"expirationType,omitempty"` FiftyTwoWkHigh float64 `json:"52WkHigh,omitempty"` FiftyTwoWkHighInDouble float64 `json:"52WkHighInDouble,omitempty"` FiftyTwoWkLow float64 `json:"52WkLow,omitempty"` FiftyTwoWkLowInDouble float64 `json:"52WkLowInDouble,omitempty"` FutureActiveSymbol string `json:"futureActiveSymbol,omitempty"` FutureExpirationDate string `json:"futureExpirationDate,omitempty"` FutureIsActive bool `json:"futureIsActive,omitempty"` FutureIsTradable bool `json:"futureIsTradable,omitempty"` FutureMultiplier float64 `json:"futureMultiplier,omitempty"` FuturePercentChange float64 `json:"futurePercentChange,omitempty"` FuturePriceFormat string `json:"futurePriceFormat,omitempty"` FutureSettlementPrice float64 `json:"futureSettlementPrice,omitempty"` FutureTradingHours string `json:"futureTradingHours,omitempty"` Gamma float64 `json:"gamma,omitempty"` GammaInDouble float64 `json:"gammaInDouble,omitempty"` HighPrice float64 `json:"highPrice,omitempty"` HighPriceInDouble float64 `json:"highPriceInDouble,omitempty"` InTheMoney bool `json:"inTheMoney,omitempty"` IsTradable bool `json:"isTradable,omitempty"` LastID string `json:"lastId,omitempty"` LastPrice float64 `json:"lastPrice,omitempty"` LastPriceInDouble float64 `json:"lastPriceInDouble,omitempty"` LastSize int64 `json:"lastSize,omitempty"` LowPrice float64 `json:"lowPrice,omitempty"` LowPriceInDouble float64 `json:"lowPriceInDouble,omitempty"` Marginable bool `json:"marginable,omitempty"` Mark float64 `json:"mark,omitempty"` MarketMaker string `json:"marketMaker,omitempty"` MoneyIntrinsicValue float64 `json:"moneyIntrinsicValue,omitempty"` MoneyIntrinsicValueInDouble float64 `json:"moneyIntrinsicValueInDouble,omitempty"` Multiplier float64 `json:"multiplier,omitempty"` MultiplierInDouble float64 `json:"multiplierInDouble,omitempty"` NAV float64 `json:"nAV,omitempty"` NetChange float64 `json:"netChange,omitempty"` NetChangeInDouble float64 `json:"netChangeInDouble,omitempty"` OpenInterest float64 `json:"openInterest,omitempty"` OpenPrice float64 `json:"openPrice,omitempty"` OpenPriceInDouble float64 `json:"openPriceInDouble,omitempty"` PeRatio float64 `json:"peRatio,omitempty"` PercentChange float64 `json:"percentChange,omitempty"` Product string `json:"product,omitempty"` QuoteTimeInLong int64 `json:"quoteTimeInLong,omitempty"` RegularMarketLastPrice float64 `json:"regularMarketLastPrice,omitempty"` RegularMarketLastSize int64 `json:"regularMarketLastSize,omitempty"` RegularMarketNetChange float64 `json:"regularMarketNetChange,omitempty"` RegularMarketTradeTimeInLong int64 `json:"regularMarketTradeTimeInLong,omitempty"` Rho float64 `json:"rho,omitempty"` RhoInDouble float64 `json:"rhoInDouble,omitempty"` SecurityStatus string `json:"securityStatus,omitempty"` SettlementType string `json:"settlementType,omitempty"` Shortable bool `json:"shortable,omitempty"` StrikePrice float64 `json:"strikePrice,omitempty"` StrikePriceInDouble float64 `json:"strikePriceInDouble,omitempty"` Symbol string `json:"symbol,omitempty"` TheoreticalOptionValue float64 `json:"theoreticalOptionValue,omitempty"` Theta float64 `json:"theta,omitempty"` ThetaInDouble float64 `json:"thetaInDouble,omitempty"` Tick float64 `json:"tick,omitempty"` TickAmount float64 `json:"tickAmount,omitempty"` TimeValue float64 `json:"timeValue,omitempty"` TimeValueInDouble float64 `json:"timeValueInDouble,omitempty"` TotalVolume int64 `json:"totalVolume,omitempty"` TradeTimeInLong int64 `json:"tradeTimeInLong,omitempty"` TradingHours string `json:"tradingHours,omitempty"` Underlying string `json:"underlying,omitempty"` UnderlyingPrice float64 `json:"underlyingPrice,omitempty"` UvExpirationType string `json:"uvExpirationType,omitempty"` Vega float64 `json:"vega,omitempty"` VegaInDouble float64 `json:"vegaInDouble,omitempty"` Volatility float64 `json:"volatility,omitempty"` }
type Quotes ¶
type Quotes struct { IsAmexDelayed bool `json:"isAmexDelayed,omitempty"` IsCmeDelayed bool `json:"isCmeDelayed,omitempty"` IsForexDelayed bool `json:"isForexDelayed,omitempty"` IsIceDelayed bool `json:"isIceDelayed,omitempty"` IsNasdaqDelayed bool `json:"isNasdaqDelayed,omitempty"` IsNyseDelayed bool `json:"isNyseDelayed,omitempty"` IsOpraDelayed bool `json:"isOpraDelayed,omitempty"` }
type RequestedDestination ¶
type RequestedDestination string
const ( RequestedDestinationInet RequestedDestination = "INET" RequestedDestinationEcnArca RequestedDestination = "ECN_ARCA" RequestedDestinationCboe RequestedDestination = "CBOE" RequestedDestinationAmex RequestedDestination = "AMEX" RequestedDestinationPhlx RequestedDestination = "PHLX" RequestedDestinationIse RequestedDestination = "ISE" RequestedDestinationBox RequestedDestination = "BOX" RequestedDestinationNyse RequestedDestination = "NYSE" RequestedDestinationNasdaq RequestedDestination = "NASDAQ" RequestedDestinationBats RequestedDestination = "BATS" RequestedDestinationC2 RequestedDestination = "C2" RequestedDestinationAuto RequestedDestination = "AUTO" )
type SecuritiesAccount ¶
type SecuritiesAccount struct { AccountID string `json:"accountId,omitempty"` IsClosingOnlyRestricted bool `json:"isClosingOnlyRestricted,omitempty"` IsDayTrader bool `json:"isDayTrader,omitempty"` OrderStrategies []*OrderStrategies `json:"orderStrategies,omitempty"` Positions []*Positions `json:"positions,omitempty"` RoundTrips int64 `json:"roundTrips,omitempty"` Type Type `json:"type,omitempty"` }
type SpecialInstruction ¶
type SpecialInstruction string
const ( SpecialInstructionAllOrNone SpecialInstruction = "ALL_OR_NONE" SpecialInstructionDoNotReduce SpecialInstruction = "DO_NOT_REDUCE" SpecialInstructionAllOrNoneDoNotReduce SpecialInstruction = "ALL_OR_NONE_DO_NOT_REDUCE" )
type Status ¶
type Status string
const ( StatusAwaitingParentOrder Status = "AWAITING_PARENT_ORDER" StatusAwaitingCondition Status = "AWAITING_CONDITION" StatusAwaitingManualReview Status = "AWAITING_MANUAL_REVIEW" StatusAccepted Status = "ACCEPTED" StatusAwaitingUrOut Status = "AWAITING_UR_OUT" StatusPendingActivation Status = "PENDING_ACTIVATION" StatusQueued Status = "QUEUED" StatusWorking Status = "WORKING" StatusRejected Status = "REJECTED" StatusPendingCancel Status = "PENDING_CANCEL" StatusCanceled Status = "CANCELED" StatusPendingReplace Status = "PENDING_REPLACE" StatusReplaced Status = "REPLACED" StatusFilled Status = "FILLED" StatusExpired Status = "EXPIRED" )
type StopPriceLinkBasis ¶
type StopPriceLinkBasis string
const ( StopPriceLinkBasisManual StopPriceLinkBasis = "MANUAL" StopPriceLinkBasisBase StopPriceLinkBasis = "BASE" StopPriceLinkBasisTrigger StopPriceLinkBasis = "TRIGGER" StopPriceLinkBasisLast StopPriceLinkBasis = "LAST" StopPriceLinkBasisBid StopPriceLinkBasis = "BID" StopPriceLinkBasisAsk StopPriceLinkBasis = "ASK" StopPriceLinkBasisAskBid StopPriceLinkBasis = "ASK_BID" StopPriceLinkBasisMark StopPriceLinkBasis = "MARK" StopPriceLinkBasisAverage StopPriceLinkBasis = "AVERAGE" )
type StopPriceLinkType ¶
type StopPriceLinkType string
const ( StopPriceLinkTypeValue StopPriceLinkType = "VALUE" StopPriceLinkTypePercent StopPriceLinkType = "PERCENT" StopPriceLinkTypeTick StopPriceLinkType = "TICK" )
type Strategy ¶
type Strategy string
const ( StrategySingle Strategy = "SINGLE" StrategyAnalytical Strategy = "ANALYTICAL" StrategyCovered Strategy = "COVERED" StrategyVertical Strategy = "VERTICAL" StrategyCalendar Strategy = "CALENDAR" StrategyStrangle Strategy = "STRANGLE" StrategyStraddle Strategy = "STRADDLE" StrategyButterfly Strategy = "BUTTERFLY" StrategyCondor Strategy = "CONDOR" StrategyDiagonal Strategy = "DIAGONAL" StrategyCollar Strategy = "COLLAR" StrategyRoll Strategy = "ROLL" )
type StrategyLeg ¶
type StrategyLeg struct { Symbol string `json:"symbol,omitempty"` PutCallInd string `json:"putCallInd,omitempty"` Description string `json:"description,omitempty"` Bid float64 `json:"bid,omitempty"` Ask float64 `json:"ask,omitempty"` Range string `json:"range,omitempty"` StrikePrice float64 `json:"strikePrice,omitempty"` TotalVolume float64 `json:"totalVolume,omitempty"` }
type StreamRequestParams ¶
type Streamer ¶
type Streamer struct { OnData func(data []Any) OnResponse func(code int, message string) // contains filtered or unexported fields }
func (*Streamer) AccountActivity ¶
type StreamerInfo ¶
type StreamerInfo struct { AccessLevel string `json:"accessLevel,omitempty"` Acl string `json:"acl,omitempty"` AppID string `json:"appId,omitempty"` StreamerBinaryUrl string `json:"streamerBinaryUrl,omitempty"` StreamerSocketUrl string `json:"streamerSocketUrl,omitempty"` Token string `json:"token,omitempty"` TokenTimestamp DateTime `json:"tokenTimestamp,omitempty"` UserGroup string `json:"userGroup,omitempty"` }
type StreamerSubscriptionKeys ¶
type StreamerSubscriptionKeys struct {
Keys []*Keys `json:"keys,omitempty"`
}
type StrikeRange ¶
type StrikeRange string
const ( InTheMoney StrikeRange = "ITM" NearTheMoney StrikeRange = "NTM" OutOfTheMoney StrikeRange = "OTM" StrikesAboveMarket StrikeRange = "SAK" StrikesBelowMarket StrikeRange = "SBK" StrikesNearMarket StrikeRange = "SNK" AllStrikes StrikeRange = "ALL" )
type TaxLotMethod ¶
type TaxLotMethod string
const ( TaxLotMethodFifo TaxLotMethod = "FIFO" TaxLotMethodLifo TaxLotMethod = "LIFO" TaxLotMethodHighCost TaxLotMethod = "HIGH_COST" TaxLotMethodLowCost TaxLotMethod = "LOW_COST" TaxLotMethodAverageCost TaxLotMethod = "AVERAGE_COST" TaxLotMethodSpecificLot TaxLotMethod = "SPECIFIC_LOT" )
type Transaction ¶
type Transaction struct { AccruedInterest float64 `json:"accruedInterest,omitempty"` AchStatus AchStatus `json:"achStatus,omitempty"` CashBalanceEffectFlag bool `json:"cashBalanceEffectFlag,omitempty"` ClearingReferenceNumber string `json:"clearingReferenceNumber,omitempty"` DayTradeBuyingPowerEffect float64 `json:"dayTradeBuyingPowerEffect,omitempty"` Description string `json:"description,omitempty"` Fees Any `json:"fees,omitempty"` NetAmount float64 `json:"netAmount,omitempty"` OrderDate DateTime `json:"orderDate,omitempty"` OrderID string `json:"orderId,omitempty"` RequirementReallocationAmount float64 `json:"requirementReallocationAmount,omitempty"` SettlementDate DateTime `json:"settlementDate,omitempty"` Sma float64 `json:"sma,omitempty"` SubAccount string `json:"subAccount,omitempty"` TransactionDate DateTime `json:"transactionDate,omitempty"` TransactionID int64 `json:"transactionId,omitempty"` TransactionItem *TransactionItem `json:"transactionItem,omitempty"` TransactionSubType string `json:"transactionSubType,omitempty"` Type Type `json:"type,omitempty"` }
type TransactionItem ¶
type TransactionItem struct { AccountID int64 `json:"accountId,omitempty"` Amount float64 `json:"amount,omitempty"` Cost float64 `json:"cost,omitempty"` Instruction Instruction `json:"instruction,omitempty"` Instrument *Instrument `json:"instrument,omitempty"` ParentChildIndicator string `json:"parentChildIndicator,omitempty"` ParentOrderKey int64 `json:"parentOrderKey,omitempty"` PositionEffect PositionEffect `json:"positionEffect,omitempty"` Price float64 `json:"price,omitempty"` }
type Underlying ¶
type Underlying struct { Symbol string `json:"symbol,omitempty"` Description string `json:"description,omitempty"` Change float64 `json:"change,omitempty"` PercentChange float64 `json:"percentChange,omitempty"` Close float64 `json:"close,omitempty"` QuoteTime int64 `json:"quoteTime,omitempty"` TradeTime int64 `json:"tradeTime,omitempty"` Bid float64 `json:"bid,omitempty"` Ask float64 `json:"ask,omitempty"` Last float64 `json:"last,omitempty"` Mark float64 `json:"mark,omitempty"` MarkChange float64 `json:"markChange,omitempty"` MarkPercentChange float64 `json:"markPercentChange,omitempty"` BidSize int `json:"bidSize,omitempty"` AskSize int `json:"askSize,omitempty"` HighPrice float64 `json:"highPrice,omitempty"` LowPrice float64 `json:"lowPrice,omitempty"` OpenPrice float64 `json:"openPrice,omitempty"` TotalVolume int `json:"totalVolume,omitempty"` ExchangeName string `json:"exchangeName,omitempty"` FiftyTwoWeekHigh float64 `json:"fiftyTwoWeekHigh,omitempty"` FiftyTwoWeekLow float64 `json:"fiftyTwoWeekLow,omitempty"` Delayed bool `json:"delayed,omitempty"` }
type UserPrincipal ¶
type UserPrincipal struct { AccessLevel string `json:"accessLevel,omitempty"` Accounts []*Accounts `json:"accounts,omitempty"` AuthToken string `json:"authToken,omitempty"` LastLoginTime DateTime `json:"lastLoginTime,omitempty"` LoginTime DateTime `json:"loginTime,omitempty"` PrimaryAccountID string `json:"primaryAccountId,omitempty"` ProfessionalStatus ProfessionalStatus `json:"professionalStatus,omitempty"` Quotes *Quotes `json:"quotes,omitempty"` StalePassword bool `json:"stalePassword,omitempty"` StreamerInfo *StreamerInfo `json:"streamerInfo,omitempty"` StreamerSubscriptionKeys *StreamerSubscriptionKeys `json:"streamerSubscriptionKeys,omitempty"` TokenExpirationTime DateTime `json:"tokenExpirationTime,omitempty"` UserCdDomainID string `json:"userCdDomainId,omitempty"` UserID string `json:"userId,omitempty"` }
type Watchlist ¶
type Watchlist struct { AccountID string `json:"accountId,omitempty"` Name string `json:"name,omitempty"` Status Status `json:"status,omitempty"` WatchlistID string `json:"watchlistId,omitempty"` WatchlistItems []*WatchlistItems `json:"watchlistItems,omitempty"` }
type WatchlistItems ¶
type WatchlistItems struct { AveragePrice float64 `json:"averagePrice,omitempty"` Commission float64 `json:"commission,omitempty"` Instrument *Instrument `json:"instrument,omitempty"` PurchasedDate Any `json:"purchasedDate,omitempty"` Quantity float64 `json:"quantity,omitempty"` SequenceID int64 `json:"sequenceId,omitempty"` Status Status `json:"status,omitempty"` }
Click to show internal directories.
Click to hide internal directories.