utils

package
v0.0.0-...-5833f46 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LayoutISO = "02/01/2006"
)

Variables

View Source
var DefaultDurations = []string{"1M", "2M", "3M", "4M", "5M", "6M", "7M", "8M", "9M", "10M", "11M", "1Y", "2Y", "3Y"}
View Source
var DefaultPeriods = []string{"1", "7", "30", "365"}

Functions

func UpdateEODTicks

func UpdateEODTicks(symbol string) string

Types

type Asset

type Asset struct {
	Symbol         string `json:"symbol"`
	Name           string `json:"name"`
	LastPrice      string `json:"last_price"`
	PriceVariation string `json:"price_variation"`
}

func ScrapeSearchResult

func ScrapeSearchResult(query string) ([]Asset, error)

type EODTicks

type EODTicks struct {
	Name         string `json:"Name"`
	Symbol       string `json:"SymbolId"`
	Period       int    `json:"Xperiod"`
	ThreeDaysAgo Tick   `json:"qv"`
	CurrentDay   Tick   `json:"qd"`
	QuoteTab     []Tick `json:"QuoteTab"`
}

type EODTicksObject

type EODTicksObject struct {
	Content EODTicks `json:"d"`
}

func GetEODTicks

func GetEODTicks(symbol string, days string) (*EODTicksObject, error)

type Quote

type Quote struct {
	Date  string `json:"date"`
	Price string `json:"price"`
}

func GetQuotes

func GetQuotes(symbol string, startDate time.Time, duration string, period string) ([]Quote, error)

type Tick

type Tick struct {
	Date         int     `json:"d"`
	OpenPrice    float32 `json:"o"`
	HighestPrice float32 `json:"h"`
	LowestPrice  float32 `json:"l"`
	ClosingPrice float32 `json:"c"`
	Volume       uint    `json:"v"`
}

Jump to

Keyboard shortcuts

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