configs

package
v4.1.23 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomDay

type CustomDay time.Time

CustomDay is a date time object in the cdLayout format.

func (*CustomDay) UnmarshalJSON

func (cd *CustomDay) UnmarshalJSON(input []byte) error

UnmarshalJSON parses a string in the cdLayout.

type CustomTime

type CustomTime time.Time

CustomTime is a date time object in the ctLayout format.

func (*CustomTime) UnmarshalJSON

func (ct *CustomTime) UnmarshalJSON(input []byte) error

UnmarshalJSON parses a string in the ctLayout.

type DefaultConfig

type DefaultConfig struct {
	Exchanges           []string  `json:"exchanges"`
	IndexGroups         []string  `json:"index_groups"`
	NotQuoteStockList   []string  `json:"not_quote_stock_list"`
	UpdateTime          time.Time `json:"update_time"`
	Timeframe           string    `json:"timeframe"`
	APIToken            string    `json:"token"`
	Timeout             int       `json:"timeout"`
	BaseURL             string    `json:"base_url"`
	Endpoint            Endpoint  `json:"endpoint"`
	OpenTime            time.Time
	CloseTime           time.Time
	ClosedDaysOfTheWeek []time.Weekday
	ClosedDays          []time.Time
	Interval            int `json:"interval"`
	// The data-feeding is executed when 'minute' of the current time matches off_hours_schedule
	// even when the market is cloded. Example: "10" -> execute at 00:10, 01:10, 02:10,...,23:10
	// Numbers separated by commas are allowed.  Example: "0,15,30,45" -> execute every 15 minutes.
	// Whitespaces are ignored.
	OffHoursSchedule string `json:"off_hours_schedule"`
	Backfill         struct {
		Enabled   bool      `json:"enabled"`
		Since     CustomDay `json:"since"`
		Timeframe string    `json:"timeframe"`
	} `json:"backfill"`
	// for the past X market-open days,
	// Xignite Feeder can feed 5-minute chart data for the target symbols in addition to daily-chart data backfill.
	RecentBackfill struct {
		Enabled   bool   `json:"enabled"`
		Days      int    `json:"days"`
		Timeframe string `json:"timeframe"`
	} `json:"recentBackfill"`
}

DefaultConfig is the configuration for XigniteFeeder you can define in marketstore's config file through bgworker extension.

func NewConfig

func NewConfig(config map[string]interface{}) (*DefaultConfig, error)

NewConfig casts a map object to Config struct and returns it through json marshal->unmarshal.

func (*DefaultConfig) UnmarshalJSON

func (c *DefaultConfig) UnmarshalJSON(input []byte) error

UnmarshalJSON parses the config data to the DefaultConfig object. Because some parameters (OpenTime, ClosedDaysOfTheWeek, etc) have their original types and unmarshal methods but it's troublesome for other business logic to use those not-general types, so this method parses the data to an auxiliary struct and cast the types first, then parse to the DefaultConfig object.

type Endpoint added in v4.1.23

type Endpoint struct {
	EquityRealTimeGetQuotes        string `json:"equity_realtime_get_quotes"`
	EquityRealTimeListSymbols      string `json:"equity_realtime_list_symbols"`
	EquityRealTimeGetBars          string `json:"equity_realtime_get_bars"`
	EquityHistoricalGetQuotesRange string `json:"equity_historical_get_quotes_range"`
	IndexRealTimeGetBars           string `json:"index_realtime_get_bars"`
	IndexHistoricalListSymbols     string `json:"index_historical_list_symbols"`
	IndexHistoricalGetQuotesRange  string `json:"index_historical_get_quotes_range"`
}

Jump to

Keyboard shortcuts

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