Documentation ¶
Index ¶
- Constants
- Variables
- type ContractKey
- type ExpiryIBFormat
- type ExpiryOCCFormat
- type IB
- func (p *IB) AccountList(ctx context.Context) ([]*types.Account, error)
- func (p *IB) Close() error
- func (p *IB) Connect() (err error)
- func (p *IB) Error() error
- func (p *IB) GetHistoricalData(ctx context.Context, params types.HistoricalDataParams) ([]*types.Quote, error)
- func (p *IB) GetOptionsChain(ctx context.Context, underlying string) (types.OptionChain, error)
- func (p *IB) GetOptionsQuotes(ctx context.Context, params types.OptionsQuoteParams) ([]*types.OptionQuote, error)
- func (p *IB) GetPositions(ctx context.Context) ([]*types.Position, error)
- func (p *IB) GetStockQuote(ctx context.Context, symbol string) (*types.Quote, error)
- func (p *IB) GetTrades(ctx context.Context, startTime time.Time) ([]*types.Trade, error)
- func (p *IB) LogDebugNormal(msg string, args ...interface{})
- func (p *IB) LogDebugTrace(msg string, args ...interface{})
- func (p *IB) LogDebugVerbose(msg string, args ...interface{})
- func (p *IB) SetDebugLevel(level types.DebugLevel)
- func (p *IB) Status() *types.ConnectionStatus
Constants ¶
View Source
const ( IBErrNoDataReturned = 162 IBErrSymbolNotFound = 200 IBErrMarketDataConnectionOk = 2104 IBErrHistoricalDataConnectionOk = 2106 )
View Source
const ( REPLY_CONTINUE replyBehavior = iota REPLY_DONE )
View Source
const ( DEFAULT_GATEWAY = "localhost:7497" MAX_SENDS_PER_SECOND = 50 BrokerName = "ib" )
Variables ¶
View Source
var ( // This should never happen since we don't burst messages. ErrWayTooFast = errors.New("Could not send message at this rate") ErrConnectionClosed = errors.New("broker connection closed") )
View Source
var ErrContractNotFound = errors.New("Contract not found or is ambiguous")
Functions ¶
This section is empty.
Types ¶
type ContractKey ¶
type ContractKey struct { Symbol string SecurityType string Expiry ExpiryIBFormat Multiplier string Strike float64 PutOrCall types.PutOrCall }
func ContractKeyFromOption ¶
func ContractKeyFromOption(t *types.Option) ContractKey
func NewContractKey ¶
func NewContractKey(c *ib.Contract) ContractKey
func (ContractKey) ToContract ¶
func (ck ContractKey) ToContract() ib.Contract
type ExpiryIBFormat ¶
type ExpiryIBFormat string
Types with conversion functions to ensure that we don't mix up the different formats.
func (ExpiryIBFormat) String ¶
func (s ExpiryIBFormat) String() string
type ExpiryOCCFormat ¶
type ExpiryOCCFormat string
func (ExpiryOCCFormat) String ¶
func (s ExpiryOCCFormat) String() string
type IB ¶
type IB struct { Accounts []string // Debug logging level Debug types.DebugLevel Timeout time.Duration Logger log15.Logger // contains filtered or unexported fields }
func (*IB) GetHistoricalData ¶
func (*IB) GetOptionsChain ¶
func (*IB) GetOptionsQuotes ¶
func (p *IB) GetOptionsQuotes(ctx context.Context, params types.OptionsQuoteParams) ([]*types.OptionQuote, error)
func (*IB) GetStockQuote ¶
func (*IB) LogDebugNormal ¶
func (*IB) LogDebugTrace ¶
func (*IB) LogDebugVerbose ¶
func (*IB) SetDebugLevel ¶
func (p *IB) SetDebugLevel(level types.DebugLevel)
func (*IB) Status ¶
func (p *IB) Status() *types.ConnectionStatus
Click to show internal directories.
Click to hide internal directories.