ecal

package
v1.9.9 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCountryEmoji

func GetCountryEmoji(country EconomicCalendarCountry) string

GetCountryEmoji returns the country emoji for the specified country.

func GetCountryHashtag

func GetCountryHashtag(country EconomicCalendarCountry) string

GetCountryHashtag returns the country hashtag for the specified country.

Types

type EconomicCalendar

type EconomicCalendar struct{}

EconomicCalendar is the struct for economics calendar fetcher.

func (*EconomicCalendar) Fetch

Fetch fetches economics events for the specified period.

type EconomicCalendarCountry

type EconomicCalendarCountry = string
const (
	EconomicCalendarAustralia     EconomicCalendarCountry = "Australia"
	EconomicCalendarBrazil        EconomicCalendarCountry = "Brazil"
	EconomicCalendarCanada        EconomicCalendarCountry = "Canada"
	EconomicCalendarChina         EconomicCalendarCountry = "China"
	EconomicCalendarEuropeanUnion EconomicCalendarCountry = "European Union"
	EconomicCalendarFrance        EconomicCalendarCountry = "France"
	EconomicCalendarGermany       EconomicCalendarCountry = "Germany"
	EconomicCalendarHongKong      EconomicCalendarCountry = "Hong Kong"
	EconomicCalendarIndia         EconomicCalendarCountry = "India"
	EconomicCalendarItaly         EconomicCalendarCountry = "Italy"
	EconomicCalendarJapan         EconomicCalendarCountry = "Japan"
	EconomicCalendarMexico        EconomicCalendarCountry = "Mexico"
	EconomicCalendarNewZealand    EconomicCalendarCountry = "New Zealand"
	EconomicCalendarNorway        EconomicCalendarCountry = "Norway"
	EconomicCalendarSingapore     EconomicCalendarCountry = "Singapore"
	EconomicCalendarSouthAfrica   EconomicCalendarCountry = "South Africa"
	EconomicCalendarSouthKorea    EconomicCalendarCountry = "South Korea"
	EconomicCalendarSpain         EconomicCalendarCountry = "Spain"
	EconomicCalendarSweden        EconomicCalendarCountry = "Sweden"
	EconomicCalendarSwitzerland   EconomicCalendarCountry = "Switzerland"
	EconomicCalendarUnitedKingdom EconomicCalendarCountry = "United Kingdom"
	EconomicCalendarUnitedStates  EconomicCalendarCountry = "United States"
)

type EconomicCalendarCurrency

type EconomicCalendarCurrency = string

EconomicCalendarCurrency impacted currencies(economic markets) by the event.

const (
	EconomicCalendarUSD EconomicCalendarCurrency = "USD" // US Dollar
	EconomicCalendarEUR EconomicCalendarCurrency = "EUR" // Euro
	EconomicCalendarGBP EconomicCalendarCurrency = "GBP" // British Pound
	EconomicCalendarJPY EconomicCalendarCurrency = "JPY" // Japanese Yen
	EconomicCalendarCHF EconomicCalendarCurrency = "CHF" // Swiss Franc
	EconomicCalendarCNY EconomicCalendarCurrency = "CNY" // Chinese Yuan
	EconomicCalendarAUD EconomicCalendarCurrency = "AUD" // Australian Dollar
	EconomicCalendarNZD EconomicCalendarCurrency = "NZD" // New Zealand Dollar
	EconomicCalendarINR EconomicCalendarCurrency = "INR" // Indian Rupee
	EconomicCalendarALL EconomicCalendarCurrency = "ALL" // All currencies
)

type EconomicCalendarEvent

type EconomicCalendarEvent struct {
	DateTime  time.Time                // Date of the event
	EventTime time.Time                // Time of the event (if available)
	Country   EconomicCalendarCountry  // Country of the event
	Currency  EconomicCalendarCurrency // Currency impacted by the event
	Impact    EconomicCalendarImpact   // Impact of the event on the market
	Title     string                   // Event title
	Actual    string                   // Actual value of the event (if available)
	Forecast  string                   // Forecasted value of the event (if available)
	Previous  string                   // Previous value of the event (if available)
}

EconomicCalendarEvent is the struct for economics calendar event object.

type EconomicCalendarEvents

type EconomicCalendarEvents []*EconomicCalendarEvent

EconomicCalendarEvents is the slice of economics calendar events.

func (EconomicCalendarEvents) Distinct

Distinct removes duplicates from the slice.

func (EconomicCalendarEvents) FilterByDateRange

func (e EconomicCalendarEvents) FilterByDateRange(from, to time.Time) EconomicCalendarEvents

FilterByDateRange filters events by date range, returns new slice.

func (EconomicCalendarEvents) HasActualEvents

func (e EconomicCalendarEvents) HasActualEvents() bool

HasActualEvents checks if there are any events with EconomicCalendarEvent.Actual values.

func (EconomicCalendarEvents) SortByDate

func (e EconomicCalendarEvents) SortByDate()

SortByDate sorts events by date (ascending).

type EconomicCalendarImpact

type EconomicCalendarImpact = string

EconomicCalendarImpact impact of the event on the market (low, medium, high, holiday, none).

const (
	EconomicCalendarImpactLow     EconomicCalendarImpact = "Low"      // Low impact event
	EconomicCalendarImpactMedium  EconomicCalendarImpact = "Medium"   // Medium impact event
	EconomicCalendarImpactHigh    EconomicCalendarImpact = "High"     // High impact event
	EconomicCalendarImpactHoliday EconomicCalendarImpact = "Holidays" // Holiday event
	EconomicCalendarImpactNone    EconomicCalendarImpact = "None"     // No impact event
)

Jump to

Keyboard shortcuts

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