client

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultColumns = []string{
	"open", "high", "low", "close", "volume",
	"SMA10", "SMA20", "SMA30", "SMA50", "SMA100", "SMA200",
	"EMA9", "EMA20", "EMA50", "EMA100", "EMA200",
	"BB.upper", "BB.lower",
	"RSI", "RSI[1]",
	"MACD.macd", "MACD.signal",
	"Stoch.K", "Stoch.D",
	"ATR", "ADX", "CCI20", "W.R", "AO", "Mom",
	"P.SAR", "Ichimoku.BLine", "VWAP", "VWMA", "HullMA9",
	"Stoch.RSI.K",
	"average_volume_10d_calc", "relative_volume_10d_calc",
	"Pivot.M.Classic.Middle", "Pivot.M.Classic.R1", "Pivot.M.Classic.S1",
	"Recommend.All", "Recommend.MA", "Recommend.Other",
	"UO", "change", "Volatility.D",
}
View Source
var ExchangeToScreener = map[string]string{
	"KUCOIN":   "crypto",
	"BINANCE":  "crypto",
	"BITGET":   "crypto",
	"BYBIT":    "crypto",
	"OKX":      "crypto",
	"COINBASE": "crypto",
	"GATE":     "crypto",
	"MEXC":     "crypto",
	"HTX":      "crypto",
	"BITFINEX": "crypto",
	"BINGX":    "crypto",
	"PHEMEX":   "crypto",
	"KRAKEN":   "crypto",
	"NASDAQ":   "america",
	"NYSE":     "america",
}
View Source
var NewsFeeds = map[string]string{
	"coindesk":          "https://www.coindesk.com/arc/outboundfeeds/rss/",
	"cointelegraph":     "https://cointelegraph.com/rss",
	"reuters-business":  "https://feeds.reuters.com/reuters/businessNews",
	"reuters-companies": "https://feeds.reuters.com/reuters/companyNews",
}

Functions

func ScreenerForExchange

func ScreenerForExchange(exchange string) (string, error)

Types

type HTTPClient

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

func NewHTTPClient

func NewHTTPClient(cfg *config.Config) *HTTPClient

func (*HTTPClient) Get

func (c *HTTPClient) Get(ctx context.Context, url string) ([]byte, error)

func (*HTTPClient) GetWithHeaders

func (c *HTTPClient) GetWithHeaders(ctx context.Context, url string, headers map[string]string) ([]byte, error)

func (*HTTPClient) Post

func (c *HTTPClient) Post(ctx context.Context, url string, body io.Reader) ([]byte, error)

func (*HTTPClient) PostWithHeaders

func (c *HTTPClient) PostWithHeaders(ctx context.Context, url string, body io.Reader, headers map[string]string) ([]byte, error)

type RSSClient

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

func NewRSSClient

func NewRSSClient(http *HTTPClient) *RSSClient

func (*RSSClient) FetchFeed

func (c *RSSClient) FetchFeed(ctx context.Context, feedName string) ([]RSSItem, error)

func (*RSSClient) FetchMultiple

func (c *RSSClient) FetchMultiple(ctx context.Context, feedNames []string) ([]RSSItem, error)

FetchMultiple aggregates items from multiple feeds. Individual feed failures are skipped so a single unavailable source does not block the rest.

func (*RSSClient) FetchURL

func (c *RSSClient) FetchURL(ctx context.Context, feedURL, source string) ([]RSSItem, error)

type RSSItem

type RSSItem struct {
	Title       string    `json:"title"`
	Link        string    `json:"link"`
	Description string    `json:"description"`
	PubDate     time.Time `json:"pub_date"`
	Source      string    `json:"source"`
}

type RedditClient

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

func NewRedditClient

func NewRedditClient(http *HTTPClient) *RedditClient

func (*RedditClient) Search

func (c *RedditClient) Search(ctx context.Context, subreddit, query string, limit int) ([]RedditPost, error)

type RedditPost

type RedditPost struct {
	Title       string  `json:"title"`
	Subreddit   string  `json:"subreddit"`
	Score       int     `json:"score"`
	NumComments int     `json:"num_comments"`
	URL         string  `json:"url"`
	Permalink   string  `json:"permalink"`
	CreatedUTC  float64 `json:"created_utc"`
	Selftext    string  `json:"selftext"`
}

type TVSymbolData

type TVSymbolData struct {
	Symbol string
	Values map[string]interface{}
}

type TradingViewClient

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

func NewTradingViewClient

func NewTradingViewClient(http *HTTPClient) *TradingViewClient

func (*TradingViewClient) GetMultipleAnalysis

func (c *TradingViewClient) GetMultipleAnalysis(ctx context.Context, screener string, tickers []string, columns []string) ([]TVSymbolData, error)

type YahooChartResult

type YahooChartResult struct {
	Meta    YahooMeta
	Candles []YahooOHLCV
}

type YahooClient

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

func NewYahooClient

func NewYahooClient(http *HTTPClient) *YahooClient

func (*YahooClient) GetChart

func (c *YahooClient) GetChart(ctx context.Context, symbol, interval, rangeStr string) ([]YahooOHLCV, error)

func (*YahooClient) GetFullChart

func (c *YahooClient) GetFullChart(ctx context.Context, symbol, interval, rangeStr string) (*YahooChartResult, error)

type YahooMeta

type YahooMeta struct {
	Symbol             string  `json:"symbol"`
	Currency           string  `json:"currency"`
	ExchangeName       string  `json:"exchangeName"`
	RegularMarketPrice float64 `json:"regularMarketPrice"`
	PreviousClose      float64 `json:"previousClose"`
	ChartPreviousClose float64 `json:"chartPreviousClose"`
	FiftyTwoWeekHigh   float64 `json:"fiftyTwoWeekHigh"`
	FiftyTwoWeekLow    float64 `json:"fiftyTwoWeekLow"`
	MarketState        string  `json:"marketState"`
}

func (YahooMeta) EffectivePreviousClose

func (m YahooMeta) EffectivePreviousClose() float64

EffectivePreviousClose returns the best available previous close value.

type YahooOHLCV

type YahooOHLCV struct {
	Timestamp int64
	Open      float64
	High      float64
	Low       float64
	Close     float64
	Volume    int64
}

Jump to

Keyboard shortcuts

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