Documentation ¶
Index ¶
- func NewDirectorCThostFtdcMdSpi(v interface{}) GoFuture.CThostFtdcMdSpi
- func NewDirectorCThostFtdcTraderSpi(v interface{}) GoFuture.CThostFtdcTraderSpi
- func Parse(file string, cfg interface{})
- func Start(tp string)
- func StartTrade()
- type CtpCfg
- type GoCThostFtdcMdSpi
- func (p *GoCThostFtdcMdSpi) IsErrorRspInfo(pRspInfo GoFuture.CThostFtdcRspInfoField) bool
- func (p *GoCThostFtdcMdSpi) OnFrontConnected()
- func (p *GoCThostFtdcMdSpi) OnFrontDisconnected(nReason int)
- func (p *GoCThostFtdcMdSpi) OnHeartBeatWarning(nTimeLapse int)
- func (p *GoCThostFtdcMdSpi) OnRspError(pRspInfo GoFuture.CThostFtdcRspInfoField, nRequestID int, bIsLast bool)
- func (p *GoCThostFtdcMdSpi) OnRspSubForQuoteRsp(pSpecificInstrument GoFuture.CThostFtdcSpecificInstrumentField, ...)
- func (p *GoCThostFtdcMdSpi) OnRspSubMarketData(pSpecificInstrument GoFuture.CThostFtdcSpecificInstrumentField, ...)
- func (p *GoCThostFtdcMdSpi) OnRspUnSubForQuoteRsp(pSpecificInstrument GoFuture.CThostFtdcSpecificInstrumentField, ...)
- func (p *GoCThostFtdcMdSpi) OnRspUnSubMarketData(pSpecificInstrument GoFuture.CThostFtdcSpecificInstrumentField, ...)
- func (p *GoCThostFtdcMdSpi) OnRspUserLogin(pRspUserLogin GoFuture.CThostFtdcRspUserLoginField, ...)
- func (p *GoCThostFtdcMdSpi) OnRtnDepthMarketData(pDepthMarketData GoFuture.CThostFtdcDepthMarketDataField)
- func (p *GoCThostFtdcMdSpi) OnRtnForQuoteRsp(pForQuoteRsp GoFuture.CThostFtdcForQuoteRspField)
- func (p *GoCThostFtdcMdSpi) ReqUserLogin()
- func (p *GoCThostFtdcMdSpi) SubscribeForQuoteRsp(name []string)
- func (p *GoCThostFtdcMdSpi) SubscribeMarketData(name []string)
- type GoCThostFtdcTraderSpi
- func (p *GoCThostFtdcTraderSpi) IsErrorRspInfo(pRspInfo GoFuture.CThostFtdcRspInfoField) bool
- func (p *GoCThostFtdcTraderSpi) IsFlowControl(iResult int) bool
- func (p *GoCThostFtdcTraderSpi) OnFrontConnected()
- func (p *GoCThostFtdcTraderSpi) OnFrontDisconnected(nReason int)
- func (p *GoCThostFtdcTraderSpi) OnHeartBeatWarning(nTimeLapse int)
- func (p *GoCThostFtdcTraderSpi) OnRspError(pRspInfo GoFuture.CThostFtdcRspInfoField, nRequestID int, bIsLast bool)
- func (p *GoCThostFtdcTraderSpi) OnRspQryInstrument(pInstrument GoFuture.CThostFtdcInstrumentField, ...)
- func (p *GoCThostFtdcTraderSpi) OnRspQryInvestorPosition(pInvestorPosition GoFuture.CThostFtdcInvestorPositionField, ...)
- func (p *GoCThostFtdcTraderSpi) OnRspQryTradingAccount(pTradingAccount GoFuture.CThostFtdcTradingAccountField, ...)
- func (p *GoCThostFtdcTraderSpi) OnRspSettlementInfoConfirm(pSettlementInfoConfirm GoFuture.CThostFtdcSettlementInfoConfirmField, ...)
- func (p *GoCThostFtdcTraderSpi) OnRspUserLogin(pRspUserLogin GoFuture.CThostFtdcRspUserLoginField, ...)
- func (p *GoCThostFtdcTraderSpi) ReqQryInstrument()
- func (p *GoCThostFtdcTraderSpi) ReqQryInvestorPosition()
- func (p *GoCThostFtdcTraderSpi) ReqQryTradingAccount()
- func (p *GoCThostFtdcTraderSpi) ReqSettlementInfoConfirm()
- func (p *GoCThostFtdcTraderSpi) ReqUserLogin()
- type QuoteTick
- type YamlCfg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDirectorCThostFtdcMdSpi ¶
func NewDirectorCThostFtdcMdSpi(v interface{}) GoFuture.CThostFtdcMdSpi
func NewDirectorCThostFtdcTraderSpi ¶
func NewDirectorCThostFtdcTraderSpi(v interface{}) GoFuture.CThostFtdcTraderSpi
func StartTrade ¶
func StartTrade()
Types ¶
type CtpCfg ¶
type CtpCfg struct { BrokerID string InvestorID string Password string MdFront string MdApi GoFuture.CThostFtdcMdApi TraderFront string TraderApi GoFuture.CThostFtdcTraderApi MdRequestID int TraderRequestID int }
var CTP CtpCfg
const (
Broker_id = "9999" Investor_id = "025458" Pass_word = "123456" Market_front = "tcp://180.168.146.187:10011" Trade_front = "tcp://180.168.146.187:10001"
)
func (*CtpCfg) GetMdRequestID ¶
func (*CtpCfg) GetTraderRequestID ¶
type GoCThostFtdcMdSpi ¶
type GoCThostFtdcMdSpi struct {
Client CtpCfg
}
func (*GoCThostFtdcMdSpi) IsErrorRspInfo ¶
func (p *GoCThostFtdcMdSpi) IsErrorRspInfo(pRspInfo GoFuture.CThostFtdcRspInfoField) bool
func (*GoCThostFtdcMdSpi) OnFrontConnected ¶
func (p *GoCThostFtdcMdSpi) OnFrontConnected()
func (*GoCThostFtdcMdSpi) OnFrontDisconnected ¶
func (p *GoCThostFtdcMdSpi) OnFrontDisconnected(nReason int)
func (*GoCThostFtdcMdSpi) OnHeartBeatWarning ¶
func (p *GoCThostFtdcMdSpi) OnHeartBeatWarning(nTimeLapse int)
func (*GoCThostFtdcMdSpi) OnRspError ¶
func (p *GoCThostFtdcMdSpi) OnRspError(pRspInfo GoFuture.CThostFtdcRspInfoField, nRequestID int, bIsLast bool)
func (*GoCThostFtdcMdSpi) OnRspSubForQuoteRsp ¶
func (p *GoCThostFtdcMdSpi) OnRspSubForQuoteRsp(pSpecificInstrument GoFuture.CThostFtdcSpecificInstrumentField, pRspInfo GoFuture.CThostFtdcRspInfoField, nRequestID int, bIsLast bool)
func (*GoCThostFtdcMdSpi) OnRspSubMarketData ¶
func (p *GoCThostFtdcMdSpi) OnRspSubMarketData(pSpecificInstrument GoFuture.CThostFtdcSpecificInstrumentField, pRspInfo GoFuture.CThostFtdcRspInfoField, nRequestID int, bIsLast bool)
func (*GoCThostFtdcMdSpi) OnRspUnSubForQuoteRsp ¶
func (p *GoCThostFtdcMdSpi) OnRspUnSubForQuoteRsp(pSpecificInstrument GoFuture.CThostFtdcSpecificInstrumentField, pRspInfo GoFuture.CThostFtdcRspInfoField, nRequestID int, bIsLast bool)
func (*GoCThostFtdcMdSpi) OnRspUnSubMarketData ¶
func (p *GoCThostFtdcMdSpi) OnRspUnSubMarketData(pSpecificInstrument GoFuture.CThostFtdcSpecificInstrumentField, pRspInfo GoFuture.CThostFtdcRspInfoField, nRequestID int, bIsLast bool)
func (*GoCThostFtdcMdSpi) OnRspUserLogin ¶
func (p *GoCThostFtdcMdSpi) OnRspUserLogin(pRspUserLogin GoFuture.CThostFtdcRspUserLoginField, pRspInfo GoFuture.CThostFtdcRspInfoField, nRequestID int, bIsLast bool)
func (*GoCThostFtdcMdSpi) OnRtnDepthMarketData ¶
func (p *GoCThostFtdcMdSpi) OnRtnDepthMarketData(pDepthMarketData GoFuture.CThostFtdcDepthMarketDataField)
func (*GoCThostFtdcMdSpi) OnRtnForQuoteRsp ¶
func (p *GoCThostFtdcMdSpi) OnRtnForQuoteRsp(pForQuoteRsp GoFuture.CThostFtdcForQuoteRspField)
func (*GoCThostFtdcMdSpi) ReqUserLogin ¶
func (p *GoCThostFtdcMdSpi) ReqUserLogin()
func (*GoCThostFtdcMdSpi) SubscribeForQuoteRsp ¶
func (p *GoCThostFtdcMdSpi) SubscribeForQuoteRsp(name []string)
func (*GoCThostFtdcMdSpi) SubscribeMarketData ¶
func (p *GoCThostFtdcMdSpi) SubscribeMarketData(name []string)
type GoCThostFtdcTraderSpi ¶
type GoCThostFtdcTraderSpi struct {
Client CtpCfg
}
func (*GoCThostFtdcTraderSpi) IsErrorRspInfo ¶
func (p *GoCThostFtdcTraderSpi) IsErrorRspInfo(pRspInfo GoFuture.CThostFtdcRspInfoField) bool
func (*GoCThostFtdcTraderSpi) IsFlowControl ¶
func (p *GoCThostFtdcTraderSpi) IsFlowControl(iResult int) bool
func (*GoCThostFtdcTraderSpi) OnFrontConnected ¶
func (p *GoCThostFtdcTraderSpi) OnFrontConnected()
func (*GoCThostFtdcTraderSpi) OnFrontDisconnected ¶
func (p *GoCThostFtdcTraderSpi) OnFrontDisconnected(nReason int)
func (*GoCThostFtdcTraderSpi) OnHeartBeatWarning ¶
func (p *GoCThostFtdcTraderSpi) OnHeartBeatWarning(nTimeLapse int)
func (*GoCThostFtdcTraderSpi) OnRspError ¶
func (p *GoCThostFtdcTraderSpi) OnRspError(pRspInfo GoFuture.CThostFtdcRspInfoField, nRequestID int, bIsLast bool)
func (*GoCThostFtdcTraderSpi) OnRspQryInstrument ¶
func (p *GoCThostFtdcTraderSpi) OnRspQryInstrument(pInstrument GoFuture.CThostFtdcInstrumentField, pRspInfo GoFuture.CThostFtdcRspInfoField, nRequestID int, bIsLast bool)
func (*GoCThostFtdcTraderSpi) OnRspQryInvestorPosition ¶
func (p *GoCThostFtdcTraderSpi) OnRspQryInvestorPosition(pInvestorPosition GoFuture.CThostFtdcInvestorPositionField, pRspInfo GoFuture.CThostFtdcRspInfoField, nRequestID int, bIsLast bool)
func (*GoCThostFtdcTraderSpi) OnRspQryTradingAccount ¶
func (p *GoCThostFtdcTraderSpi) OnRspQryTradingAccount(pTradingAccount GoFuture.CThostFtdcTradingAccountField, pRspInfo GoFuture.CThostFtdcRspInfoField, nRequestID int, bIsLast bool)
func (*GoCThostFtdcTraderSpi) OnRspSettlementInfoConfirm ¶
func (p *GoCThostFtdcTraderSpi) OnRspSettlementInfoConfirm(pSettlementInfoConfirm GoFuture.CThostFtdcSettlementInfoConfirmField, pRspInfo GoFuture.CThostFtdcRspInfoField, nRequestID int, bIsLast bool)
func (*GoCThostFtdcTraderSpi) OnRspUserLogin ¶
func (p *GoCThostFtdcTraderSpi) OnRspUserLogin(pRspUserLogin GoFuture.CThostFtdcRspUserLoginField, pRspInfo GoFuture.CThostFtdcRspInfoField, nRequestID int, bIsLast bool)
func (*GoCThostFtdcTraderSpi) ReqQryInstrument ¶
func (p *GoCThostFtdcTraderSpi) ReqQryInstrument()
func (*GoCThostFtdcTraderSpi) ReqQryInvestorPosition ¶
func (p *GoCThostFtdcTraderSpi) ReqQryInvestorPosition()
func (*GoCThostFtdcTraderSpi) ReqQryTradingAccount ¶
func (p *GoCThostFtdcTraderSpi) ReqQryTradingAccount()
func (*GoCThostFtdcTraderSpi) ReqSettlementInfoConfirm ¶
func (p *GoCThostFtdcTraderSpi) ReqSettlementInfoConfirm()
func (*GoCThostFtdcTraderSpi) ReqUserLogin ¶
func (p *GoCThostFtdcTraderSpi) ReqUserLogin()
type QuoteTick ¶
type QuoteTick struct { TradingDay string `json:"TradingDay"` InstrumentID string `json:"InstrumentID"` ExchangeID string `json:"ExchangeID"` ExchangeInstID string `json:"ExchangeInstID"` LastPrice string `json:"LastPrice"` PreSettlementPrice string `json:"PreSettlementPrice"` PreClosePrice string `json:"PreClosePrice"` PreOpenInterest string `json:"PreOpenInterest"` OpenPrice string `json:"OpenPrice"` HighestPrice string `json:"HighestPrice"` LowestPrice string `json:"LowestPrice"` Turnover string `json:"Turnover"` OpenInterest string `json:"OpenInterest"` ClosePrice string `json:"ClosePrice"` SettlementPrice string `json:"SettlementPrice"` UpperLimitPrice string `json:"UpperLimitPrice"` LowerLimitPrice string `json:"LowerLimitPrice"` PreDelta string `json:"PreDelta"` CurrDelta string `json:"CurrDelta"` UpdateTime string `json:"UpdateTime"` UpdateMillisec string `json:"UpdateMillisec"` BidPrice1 string `json:"BidPrice1"` BidVolume1 string `json:"BidVolume1"` AskPrice1 string `json:"AskPrice1"` AskVolume1 string `json:"AskVolume1"` BidPrice2 string `json:"BidPrice2"` BidVolume2 string `json:"BidVolume2"` AskPrice2 string `json:"AskPrice2"` AskVolume2 string `json:"AskVolume2"` BidPrice3 string `json:"BidPrice3"` BidVolume3 string `json:"BidVolume3"` AskPrice3 string `json:"AskPrice3"` AskVolume3 string `json:"AskVolume3"` BidPrice4 string `json:"BidPrice4"` BidVolume4 string `json:"BidVolume4"` AskPrice4 string `json:"AskPrice4"` AskVolume4 string `json:"AskVolume4"` BidPrice5 string `json:"BidPrice5"` BidVolume5 string `json:"BidVolume5"` AskPrice5 string `json:"AskPrice5"` AskVolume5 string `json:"AskVolume5"` AveragePrice string `json:"AveragePrice"` ActionDay string `json:"ActionDay"` }
func (*QuoteTick) Create ¶
func (q *QuoteTick) Create(data GoFuture.CThostFtdcDepthMarketDataField)
Click to show internal directories.
Click to hide internal directories.