Versions in this module Expand all Collapse all v2 v2.0.0 Jan 14, 2021 Changes in this version + const DefaultClientID + const EPAccounts + const EPBase + const EPCryptoAccount + const EPCryptoBase + const EPCryptoCurrencyPairs + const EPCryptoHoldings + const EPCryptoOrders + const EPCryptoPortfolio + const EPFundamentals + const EPInstruments + const EPLogin + const EPMarket + const EPOptionQuote + const EPOptions + const EPOrders + const EPPortfolios + const EPPositions + const EPQuotes + const EPWatchlists + const HrClose + const HrExtendedClose + const HrExtendedOpen + const HrRHExtendedClose + const HrRHExtendedOpen + const MinClose + const MinExtendedClose + const MinExtendedOpen + const MinOpen + const MinRHExtendedClose + const MinRHExtendedOpen + var ErrMFARequired = fmt.Errorf("Two Factor Auth code required and not supplied") + func IsExtendedTradingTime() bool + func IsRegularTradingTime() bool + func IsRobinhoodExtendedTradingTime() bool + func IsWeekDay(t time.Time) bool + func MinuteOfDay(t time.Time) int + func NextMarketClose() time.Time + func NextMarketExtendedClose() time.Time + func NextMarketExtendedOpen() time.Time + func NextMarketOpen() time.Time + func NextRobinhoodExtendedClose() time.Time + func NextRobinhoodExtendedOpen() time.Time + func NextWeekday() time.Time + type Account struct + AccountNumber string + BuyingPower float64 + Cash float64 + CashAvailableForWithdrawal float64 + CashBalances CashBalances + CashHeldForOrders float64 + Deactivated bool + DepositHalted bool + MarginBalances MarginBalances + MaxAchEarlyAccessAmount string + OnlyPositionClosingTrades bool + Portfolio string + Positions string + Sma interface{} + SmaHeldForOrders interface{} + SweepEnabled bool + Type string + UnclearedDeposits float64 + UnsettledFunds float64 + User string + WithdrawalHalted bool + type AssetCurrency struct + BrandColor string + Code string + ID string + Increment float64 + Name string + type CashBalances struct + BuyingPower float64 + Cash float64 + CashAvailableForWithdrawal float64 + CashHeldForOrders float64 + UnclearedDeposits float64 + UnsettledFunds float64 + type Client struct + Account *Account + CryptoAccount *CryptoAccount + Token string + func Dial(ctx context.Context, s oauth2.TokenSource) (*Client, error) + func (c *Client) AllOrders(ctx context.Context) ([]OrderOutput, error) + func (c *Client) CryptoOrder(ctx context.Context, cryptoPair CryptoCurrencyPair, o CryptoOrderOpts) (*CryptoOrderOutput, error) + func (c *Client) DoAndDecode(ctx context.Context, req *http.Request, dest interface{}) error + func (c *Client) GetAccounts(ctx context.Context) ([]Account, error) + func (c *Client) GetAndDecode(ctx context.Context, url string, dest interface{}) error + func (c *Client) GetCryptoAccounts(ctx context.Context) ([]CryptoAccount, error) + func (c *Client) GetCryptoCurrencyPairs(ctx context.Context) ([]CryptoCurrencyPair, error) + func (c *Client) GetCryptoInstrument(ctx context.Context, symbol string) (*CryptoCurrencyPair, error) + func (c *Client) GetCryptoPortfolios(ctx context.Context) (CryptoPortfolio, error) + func (c *Client) GetFundamentals(ctx context.Context, stocks ...string) ([]Fundamental, error) + func (c *Client) GetInstrument(ctx context.Context, instURL string) (*Instrument, error) + func (c *Client) GetInstrumentForSymbol(ctx context.Context, sym string) (*Instrument, error) + func (c *Client) GetOptionChains(ctx context.Context, is ...*Instrument) ([]*OptionChain, error) + func (c *Client) GetOptionPositions(ctx context.Context) ([]OptionPostion, error) + func (c *Client) GetOptionPositionsParams(ctx context.Context, p PositionParams) ([]OptionPostion, error) + func (c *Client) GetOptionsOrders(ctx context.Context) (json.RawMessage, error) + func (c *Client) GetPortfolios(ctx context.Context) ([]Portfolio, error) + func (c *Client) GetPositions(ctx context.Context) ([]Position, error) + func (c *Client) GetPositionsParams(ctx context.Context, p PositionParams) ([]Position, error) + func (c *Client) GetQuote(ctx context.Context, stocks ...string) ([]Quote, error) + func (c *Client) GetWatchlists(ctx context.Context) ([]Watchlist, error) + func (c *Client) MarketData(ctx context.Context, opts ...*OptionInstrument) ([]*MarketData, error) + func (c *Client) Order(ctx context.Context, i *Instrument, o OrderOpts) (*OrderOutput, error) + func (c *Client) OrderOptions(ctx context.Context, q *OptionInstrument, o OptionsOrderOpts) (json.RawMessage, error) + func (c *Client) Pricebook(ctx context.Context, instrumentID string) (*PriceBookData, error) + func (c *Client) RecentOrders(ctx context.Context) ([]OrderOutput, error) + type CredsCacher struct + Creds oauth2.TokenSource + Path string + func (c *CredsCacher) Token() (*oauth2.Token, error) + type CryptoAccount struct + ID string + Status string + UserID string + type CryptoCurrencyPair struct + CrytoQuoteCurrency QuoteCurrency + CyrptoAssetCurrency AssetCurrency + ID string + MaxOrderSize float64 + MinOrderPriceIncrement float64 + MinOrderSize float64 + Name string + Symbol string + Tradability string + type CryptoOrder struct + AccountID string + CurrencyPairID string + Price float64 + Quantity float64 + RefID string + Side string + TimeInForce string + Type string + type CryptoOrderOpts struct + AmountInDollars float64 + ExtendedHours bool + Force bool + Price float64 + Quantity float64 + Side OrderSide + Stop bool + TimeInForce TimeInForce + Type OrderType + type CryptoOrderOutput struct + Account string + AveragePrice float64 + CancelURL string + CreatedAt string + CumulativeQuantity string + CurrencyPairID string + Executions []interface{} + ID string + LastTransactionAt string + Price float64 + Quantity string + RejectReason string + Side string + State string + StopPrice float64 + TimeInForce string + Type string + func (o CryptoOrderOutput) Cancel(ctx context.Context) error + type CryptoPortfolio struct + AccountID string + Equity float64 + ExtendedHoursEquity float64 + ExtendedHoursMarketValue float64 + ID string + MarketValue float64 + type Date struct + func NewDate(y, m, d int) Date + func NewZonedDate(y, m, d int, z *time.Location) Date + func (d *Date) UnmarshalJSON(bs []byte) error + func (d Date) MarshalJSON() ([]byte, error) + func (d Date) String() string + type EntryPrice struct + Amount string + Currency_code string + type ErrorMap map[string]interface + func (e ErrorMap) Error() string + type Fundamental struct + AverageVolume float64 + Description string + DividendYield float64 + High float64 + High52Weeks float64 + Instrument string + Low float64 + Low52Weeks float64 + MarketCap float64 + Open float64 + PERatio float64 + Volume float64 + type Instrument struct + BloombergUnique string + Country string + DayTradeRatio string + DefaultCollarFraction string + FractionalTradability string + Fundamentals string + ID string + ListDate string + MaintenanceRatio string + MarginInitialRatio string + Market string + MinTickSize interface{} + Name string + Quote string + RhsTradability string + SimpleName interface{} + Splits string + State string + Symbol string + Tradability string + TradableChainID string + Tradeable bool + Type string + URL string + func (i Instrument) OrderSymbol() string + func (i Instrument) OrderURL() string + type Leg struct + Option string + PositionEffect string + RatioQuantity float64 + Side OrderSide + type LegPosition struct + ExpirationDate string + Id string + Option string + OptionType string + Position string + PositionType string + RatioQuantity string + StrikePrice string + type MarginBalances struct + Cash float64 + CashAvailableForWithdrawal float64 + CashHeldForOrders float64 + DayTradeBuyingPower float64 + DayTradeBuyingPowerHeldForOrders float64 + DayTradeRatio float64 + MarginLimit float64 + MarkedPatternDayTraderDate string + OvernightBuyingPower float64 + OvernightBuyingPowerHeldForOrders float64 + OvernightRatio float64 + UnallocatedMarginCash float64 + UnclearedDeposits float64 + UnsettledFunds float64 + type MarketData struct + AdjustedMarkPrice float64 + AskPrice float64 + AskSize int + BidPrice float64 + BidSize int + BreakEvenPrice float64 + ChanceOfProfitLong float64 + ChanceOfProfitShort float64 + Delta float64 + Gamma float64 + HighPrice float64 + ImpliedVolatility string + Instrument string + LastTradePrice float64 + LastTradeSize int + LowPrice float64 + MarkPrice float64 + OpenInterest int + PreviousCloseDate Date + PreviousClosePrice float64 + Rho string + Theta string + Vega string + Volume int + type Meta struct + CreatedAt time.Time + URL string + UpdatedAt time.Time + type MinTicks struct + AboveTick float64 + BelowTick float64 + CutoffPrice float64 + type OAuth struct + ClientID string + Endpoint string + MFA string + Password string + Username string + func (p *OAuth) Token() (*oauth2.Token, error) + type OptionChain struct + CanOpenPosition bool + CashComponent interface{} + ExpirationDates []string + ID string + MinTicks MinTicks + Symbol string + TradeValueMultiplier float64 + UnderlyingInstruments []UnderlyingInstrument + func (o *OptionChain) GetInstrument(ctx context.Context, tradeType string, date Date) ([]*OptionInstrument, error) + type OptionDirection int + const Credit + const Debit + func (i OptionDirection) String() string + func (o OptionDirection) MarshalJSON() ([]byte, error) + type OptionInstrument struct + ChainID string + ChainSymbol string + CreatedAt string + ExpirationDate Date + ID string + IssueDate string + MinTicks MinTicks + RHSTradability string + State string + StrikePrice float64 + Tradability string + Type string + URL string + UpdatedAt string + func OIsForDate(os []*OptionInstrument, d Date) []*OptionInstrument + type OptionPostion struct + Account string + AverageOpenPrice string + Chain string + CreatedAt string + Direction string + Id string + IntradayAverageOpenPrice string + IntradayDirection string + IntradayQuantity string + Legs []LegPosition + Quantity string + Strategy string + Symbol string + TradeValueMultiplier string + UpdatedAt string + type OptionsOrderOpts struct + Direction OptionDirection + Price float64 + Quantity float64 + Side OrderSide + TimeInForce TimeInForce + Type OrderType + type OrderOpts struct + ExtendedHours bool + Force bool + Price float64 + Quantity uint64 + Side OrderSide + Stop bool + TimeInForce TimeInForce + Type OrderType + type OrderOutput struct + Account string + AveragePrice float64 + CancelURL string + CreatedAt string + CumulativeQuantity string + Executions []interface{} + ExtendedHours bool + Fees string + ID string + Instrument string + LastTransactionAt string + OverrideDayTradeChecks bool + OverrideDtbpChecks bool + Position string + Price float64 + Quantity string + RejectReason string + Side string + State string + StopPrice float64 + TimeInForce string + Trigger string + Type string + func (o *OrderOutput) Update(ctx context.Context) error + func (o OrderOutput) Cancel(ctx context.Context) error + type OrderSide int + const Buy + const Sell + func (i OrderSide) String() string + func (o OrderSide) MarshalJSON() ([]byte, error) + type OrderType int + const Limit + const Market + func (i OrderType) String() string + func (o OrderType) MarshalJSON() ([]byte, error) + type Pager struct + Next string + Previous string + func (p *Pager) GetNext(ctx context.Context, c *Client, out interface{}) error + func (p Pager) HasMore() bool + type Portfolio struct + Account string + AdjustedEquityPreviousClose float64 + Equity float64 + EquityPreviousClose float64 + ExcessMaintenance float64 + ExcessMaintenanceWithUnclearedDeposits float64 + ExcessMargin float64 + ExcessMarginWithUnclearedDeposits float64 + ExtendedHoursEquity float64 + ExtendedHoursMarketValue float64 + LastCoreEquity float64 + LastCoreMarketValue float64 + MarketValue float64 + StartDate string + URL string + UnwithdrawableDeposits float64 + UnwithdrawableGrants float64 + WithdrawableAmount float64 + type Position struct + Account string + AverageBuyPrice float64 + Instrument string + IntradayAverageBuyPrice float64 + IntradayQuantity float64 + Quantity float64 + SharesHeldForBuys float64 + SharesHeldForSells float64 + type PositionParams struct + NonZero bool + type PriceBookData struct + Asks []PriceBookEntry + Bids []PriceBookEntry + InstrumentID string + UpdatedAt string + type PriceBookEntry struct + Price EntryPrice + Quantity float64 + Side string + type Quote struct + AdjustedPreviousClose float64 + AskPrice float64 + AskSize int + BidPrice float64 + BidSize int + LastExtendedHoursTradePrice float64 + LastTradePrice float64 + PreviousClose float64 + PreviousCloseDate string + Symbol string + TradingHalted bool + UpdatedAt string + func (q Quote) Price() float64 + type QuoteCurrency struct + Code string + ID string + Increment float64 + Name string + Type string + type TimeInForce int + const FOK + const GFD + const GTC + const IOC + const OPG + func (i TimeInForce) String() string + func (t TimeInForce) MarshalJSON() ([]byte, error) + type UnderlyingInstrument struct + ID string + Instrument string + Quantity int + type Unknown interface + type Watchlist struct + Client *Client + Name string + URL string + User string + func (w *Watchlist) GetInstruments(ctx context.Context) ([]Instrument, error) Other modules containing this package astuart.co/go-robinhood