iex

package module
v0.8.14-1e99c6f Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: MIT Imports: 5 Imported by: 0

README

iex

Build GoDoc Go Report Card

Purpose

iex is a simple client library for iextrading.com API.

Usage

package main

import (
    "fmt"
    "net/http"
    "time"

    "github.com/cameronnewman/iex"
)

func main() {

    iexClient := iex.NewIEX(&http.Client{
        Timeout: time.Second * 10,
    })

    fmt.Println(iexClient.GetDEEP("APPL"))

}

Issues

  • None

License

MIT Licensed

Documentation

Overview

Package iex is a simple client library for iextrading.com API. Package supports a Deep lookup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DEEP

type DEEP struct {
	Symbol        string        `json:"symbol"`
	MarketPercent int           `json:"marketPercent"`
	Volume        int           `json:"volume"`
	LastSalePrice int           `json:"lastSalePrice"`
	LastSaleSize  int           `json:"lastSaleSize"`
	LastSaleTime  int           `json:"lastSaleTime"`
	LastUpdated   int           `json:"lastUpdated"`
	Bids          []interface{} `json:"bids"`
	Asks          []interface{} `json:"asks"`
	SystemEvent   struct {
	} `json:"systemEvent"`
	TradingStatus struct {
		Status    string `json:"status"`
		Reason    string `json:"reason"`
		Timestamp int64  `json:"timestamp"`
	} `json:"tradingStatus"`
	OpHaltStatus struct {
		IsHalted  bool  `json:"isHalted"`
		Timestamp int64 `json:"timestamp"`
	} `json:"opHaltStatus"`
	SsrStatus struct {
		IsSSR     bool   `json:"isSSR"`
		Detail    string `json:"detail"`
		Timestamp int64  `json:"timestamp"`
	} `json:"ssrStatus"`
	SecurityEvent struct {
	} `json:"securityEvent"`
	Trades      []interface{} `json:"trades"`
	TradeBreaks []interface{} `json:"tradeBreaks"`
	Auction     struct {
	} `json:"auction"`
	OfficialPrice struct {
	} `json:"officialPrice"`
}

DEEP struct

type IEX

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

IEX struct

func NewIEX

func NewIEX(client *http.Client) *IEX

NewIEX returns a new IEX struct

func (*IEX) GetDEEP

func (i *IEX) GetDEEP(symbol string) (*DEEP, error)

GetDEEP is used to receive real-time depth of book quotations direct from IEX. The depth of book quotations received via DEEP provide an aggregated size of resting displayed orders at a price and side, and do not indicate the size or number of individual orders at any price level. Non-displayed orders and non-displayed portions of reserve orders are not represented in DEEP.

DEEP also provides last trade price and size information. Trades resulting from either displayed or non-displayed orders matching on IEX will be reported. Routed executions will not be reported.

func (*IEX) GetQuote

func (i *IEX) GetQuote(symbol string) (*Quote, error)

GetQuote is used to receive real-time depth of book quotations direct from IEX. The depth of book quotations received via DEEP provide an aggregated size of resting displayed orders at a price and side, and do not indicate the size or number of individual orders at any price level. Non-displayed orders and non-displayed portions of reserve orders are not represented in DEEP.

DEEP also provides last trade price and size information. Trades resulting from either displayed or non-displayed orders matching on IEX will be reported. Routed executions will not be reported.

func (*IEX) GetSymbols

func (i *IEX) GetSymbols() (*[]Symbol, error)

GetSymbols returns an array of symbols IEX supports for trading. This list is updated daily as of 7:45 a.m. ET. Symbols may be added or removed by IEX after the list was produced.

type Quote

type Quote struct {
	Symbol           string  `json:"symbol"`
	CompanyName      string  `json:"companyName"`
	PrimaryExchange  string  `json:"primaryExchange"`
	Sector           string  `json:"sector"`
	CalculationPrice string  `json:"calculationPrice"`
	Open             float64 `json:"open"`
	OpenTime         int64   `json:"openTime"`
	Close            float64 `json:"close"`
	CloseTime        int64   `json:"closeTime"`
	High             float64 `json:"high"`
	Low              float64 `json:"low"`
	LatestPrice      float64 `json:"latestPrice"`
	LatestSource     string  `json:"latestSource"`
	LatestTime       string  `json:"latestTime"`
	LatestUpdate     int64   `json:"latestUpdate"`
	LatestVolume     int     `json:"latestVolume"`
	IexRealtimePrice float64 `json:"iexRealtimePrice"`
	IexRealtimeSize  int     `json:"iexRealtimeSize"`
	IexLastUpdated   int64   `json:"iexLastUpdated"`
	DelayedPrice     float64 `json:"delayedPrice"`
	DelayedPriceTime int64   `json:"delayedPriceTime"`
	PreviousClose    float64 `json:"previousClose"`
	Change           float64 `json:"change"`
	ChangePercent    float64 `json:"changePercent"`
	IexMarketPercent float64 `json:"iexMarketPercent"`
	IexVolume        int     `json:"iexVolume"`
	AvgTotalVolume   int     `json:"avgTotalVolume"`
	IexBidPrice      int     `json:"iexBidPrice"`
	IexBidSize       int     `json:"iexBidSize"`
	IexAskPrice      int     `json:"iexAskPrice"`
	IexAskSize       int     `json:"iexAskSize"`
	MarketCap        int64   `json:"marketCap"`
	PeRatio          float64 `json:"peRatio"`
	Week52High       float64 `json:"week52High"`
	Week52Low        float64 `json:"week52Low"`
	YtdChange        float64 `json:"ytdChange"`
}

Quote struct

type Symbol

type Symbol struct {
	Symbol    string `json:"symbol"`
	Name      string `json:"name"`
	Date      string `json:"date"`
	IsEnabled bool   `json:"isEnabled"`
	Type      string `json:"type"`
	IexID     string `json:"iexId"`
}

Symbol struct

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL