Documentation ¶
Index ¶
- Constants
- func GetSecurityTradeDates(security *entity.Security) []string
- func GetTradeDateRange(security *entity.Security, dateString string) (startTs string, endTs string)
- func GetTradeDateRangeByDateString(security *entity.Security, dateString string) (startTs string, endTs string, thisTradeDate string, prevTradeDate string)
- func GetTradeTickers(security *entity.Security, timestamp uint64) []uint64
- func LoadMeta()
- func ToTradeTicker(security *entity.Security, timestamp uint64) uint64
- type TimeSpan
- type TimeSpans
- type TradeDateMeta
- type TradeMeta
- func (this *TradeMeta) GetDateTimeSpans(security *entity.Security, date string) []TimeSpan
- func (this *TradeMeta) GetTimeSpans(security *entity.Security) []TimeSpans
- func (this *TradeMeta) GetTradeDateMeta(exchange string) *TradeDateMeta
- func (this *TradeMeta) IsNonNightDate(exchange string, d string) bool
- func (this *TradeMeta) IsWeekendTrading(exchange string) bool
- type TradeTimeSpanDesc
Constants ¶
View Source
const ( TRADE_DATE_SEP_TIME = "17:00:00" TRADE_DATE_DAY_START = "08:00:00" DAY_MILLIS = 24 * 60 * 60 * 1000 MINUTE_MILLIS = 60 * 1000 MINUTES_PER_DAY = DAY_MILLIS / MINUTE_MILLIS )
Variables ¶
This section is empty.
Functions ¶
func GetSecurityTradeDates ¶
func GetTradeDateRange ¶
FIXME:
Types ¶
type TradeDateMeta ¶
type TradeMeta ¶
type TradeMeta struct { WeekendTradingExchanges map[string]bool TradingTimeMeta map[string][]TimeSpans NonNightDates map[string][]string TradeDateMeta map[string]*TradeDateMeta }
var TRADE_META *TradeMeta = &TradeMeta{ WeekendTradingExchanges: map[string]bool{ "OKEX": true, "BITMEX": true, }, TradingTimeMeta: map[string][]TimeSpans{ "OKEX": []TimeSpans{ { From: "20130706", To: "20380101", Spans: []TimeSpan{ { Start: "00:00:00", End: "17:00:00", }, { Start: "17:00:00", End: "24:00:00", }, }, }, }, "BITMEX": []TimeSpans{ { From: "20130706", To: "20380101", Spans: []TimeSpan{ { Start: "00:00:00", End: "17:00:00", }, { Start: "17:00:00", End: "24:00:00", }, }, }, }, }, NonNightDates: map[string][]string{}, TradeDateMeta: map[string]*TradeDateMeta{ "OKEX": { From: "20150101", To: "20381230", NonTradingDates: []string{}, }, "BITMEX": { From: "20150101", To: "20381230", NonTradingDates: []string{}, }, }, }
func (*TradeMeta) GetDateTimeSpans ¶
func (*TradeMeta) GetTimeSpans ¶
func (*TradeMeta) GetTradeDateMeta ¶
func (this *TradeMeta) GetTradeDateMeta(exchange string) *TradeDateMeta
func (*TradeMeta) IsNonNightDate ¶
func (*TradeMeta) IsWeekendTrading ¶
type TradeTimeSpanDesc ¶
type TradeTimeSpanDesc struct {
Spans []TimeSpans
}
Click to show internal directories.
Click to hide internal directories.