Documentation
¶
Index ¶
- Variables
- func GetReqID() int
- func OnRsp[T any](resp *T, pRspInfo *ctp.CThostFtdcRspInfoField, nRequestID int, bIsLast bool)
- func Req[T any](ctx context.Context, req func(id int) error) (result *T, err error)
- func ReqWithResps[T any](ctx context.Context, req func(id int) error) (result []*T, err error)
- func WaitTradeTime()
- type CTPKline
- type MinuteOfDay
- type MinuteOfDayRange
- type SafeWait
- type SyncReq
- type TimeRangeList
- type TradeTime
- type TradeTimeRange
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TradeTimes = TradeTime{Range: map[time.Weekday]TimeRangeList{ time.Monday: TimeRangeList{ {Start: DayMinute(8, 50), End: DayMinute(11, 35)}, {Start: DayMinute(13, 30), End: DayMinute(15, 5)}, {Start: DayMinute(20, 50), End: DayMinute(24, 0)}, }, time.Tuesday: TimeRangeList{ {Start: DayMinute(0, 0), End: DayMinute(03, 5)}, {Start: DayMinute(8, 50), End: DayMinute(11, 35)}, {Start: DayMinute(13, 30), End: DayMinute(15, 5)}, {Start: DayMinute(20, 50), End: DayMinute(24, 0)}, }, time.Wednesday: TimeRangeList{ {Start: DayMinute(0, 0), End: DayMinute(03, 5)}, {Start: DayMinute(8, 50), End: DayMinute(11, 35)}, {Start: DayMinute(13, 30), End: DayMinute(15, 5)}, {Start: DayMinute(20, 50), End: DayMinute(24, 0)}, }, time.Thursday: TimeRangeList{ {Start: DayMinute(0, 0), End: DayMinute(03, 5)}, {Start: DayMinute(8, 50), End: DayMinute(11, 35)}, {Start: DayMinute(13, 30), End: DayMinute(15, 5)}, {Start: DayMinute(20, 50), End: DayMinute(24, 0)}, }, time.Friday: TimeRangeList{ {Start: DayMinute(0, 0), End: DayMinute(03, 5)}, {Start: DayMinute(8, 50), End: DayMinute(11, 35)}, {Start: DayMinute(13, 30), End: DayMinute(15, 5)}, }, }} )
Functions ¶
func OnRsp ¶
func OnRsp[T any](resp *T, pRspInfo *ctp.CThostFtdcRspInfoField, nRequestID int, bIsLast bool)
func ReqWithResps ¶
func WaitTradeTime ¶
func WaitTradeTime()
Types ¶
type CTPKline ¶
type CTPKline struct {
// contains filtered or unexported fields
}
func NewCTPKline ¶
func NewCTPKline() *CTPKline
func (*CTPKline) SetCb ¶
func (k *CTPKline) SetCb(cb func(*trademodel.Candle))
func (*CTPKline) Update ¶
func (k *CTPKline) Update(data *ctp.CThostFtdcDepthMarketDataField) (candle *trademodel.Candle)
type MinuteOfDay ¶
type MinuteOfDay int
func DayMinute ¶
func DayMinute(hour, minute int) MinuteOfDay
type MinuteOfDayRange ¶
type MinuteOfDayRange struct {
Start MinuteOfDay
End MinuteOfDay
}
type SyncReq ¶
func NewSyncReq ¶
type TimeRangeList ¶
type TimeRangeList []MinuteOfDayRange
type TradeTime ¶
type TradeTime struct {
Range map[time.Weekday]TimeRangeList
}
type TradeTimeRange ¶
type TradeTimeRange struct {
Weekdays []time.Weekday
Ranges []MinuteOfDayRange
}
Click to show internal directories.
Click to hide internal directories.