Documentation ¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomDay ¶
CustomDay is a date time object (UTC) in the cdLayout format.
func (*CustomDay) UnmarshalJSON ¶
UnmarshalJSON parses a string in the cdLayout.
type CustomTime ¶
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 []Exchange `json:"exchanges"` SymbolsUpdateTime time.Time `json:"symbols_update_time"` UpdateTime time.Time `json:"update_time"` StocksJSONURL string `json:"stocks_json_url"` StocksJSONBasicAuth string `json:"stocks_json_basic_auth"` Timeframe string `json:"timeframe"` APIKeyID string `json:"api_key_id"` APISecretKey string `json:"api_secret_key"` AuthMethod string `json:"auth_method"` OpenHourNY, OpenMinuteNY int CloseHourNY, CloseMinuteNY int ExtendedHours bool `json:"extended_hours"` 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 has only year, month, and day (00:00:00, UTC) Since CustomDay `json:"since"` Timeframe string `json:"timeframe"` } `json:"backfill"` }
DefaultConfig is the configuration for Alpaca Broker API Feeder 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.