api

package
v1.6.11 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountArgs

type AccountArgs struct {
}

*

  • @Description: 资金账户信息

type AccountReply

type AccountReply struct {
	Code    int
	Msg     string
	Account common.AccountField
}

type AlarmArgs

type AlarmArgs struct {
	StaName string `json:"staname"`
	Alarm   common.AlarmInfo
}

*

  • @Description: 插件告警

type AlarmReply

type AlarmReply struct {
	Code int
	Msg  string
	Data interface{}
}

type Api

type Api interface {
	Common
}

type Args

type Args struct {
	Action string
	Data   interface{}
}

*

  • @Description: 通用请求

type Common

type Common interface {
}

type FutureInfoArgs

type FutureInfoArgs struct {
	SymbolT string
}

*

  • @Description: 订阅合约行情请求

type FutureInfoReply

type FutureInfoReply struct {
	Code    int
	Msg     string
	SymbolT string
	Unit    int64
	Minimum float64
}

type HistoryArgs

type HistoryArgs struct {
	Symbol string
	Period string
	Length int
}

*

  • @Description: 历史数据请求

type HistoryReply

type HistoryReply struct {
	Code       int
	Msg        string
	Symbol     string
	Kline      []common.Kline
	KlineCache *common.KlineCache
}

type IndicatorArgs

type IndicatorArgs struct {
	StaName    string `json:"staname"`
	Indicators map[string]string
}

*

  • @Description: 插件指标变化

type IndicatorFlagArgs

type IndicatorFlagArgs struct {
	StaName string `json:"staname"`
	Flags   []string
	Flags2  []string
}

*

  • @Description: 插件指标标识

type IndicatorFlagReply

type IndicatorFlagReply struct {
	Code int
	Msg  string
	Data interface{}
}

type IndicatorReply

type IndicatorReply struct {
	Code int
	Msg  string
	Data interface{}
}

type InstrumentOneArgs

type InstrumentOneArgs struct {
	StaName string
	Symbol  string
	SymbolT string
}

*

  • @Description: 单合约信息

type InstrumentOneReply

type InstrumentOneReply struct {
	Code           int
	Msg            string
	InstrumentId   string
	ExchangeId     string
	VolumeMultiple int64
	PriceTick      float64
}

type InstrumentPositionArgs

type InstrumentPositionArgs struct {
	Position goctp.PositionField
}

*

  • @Description: 合约持仓变化

type InstrumentPositionReply

type InstrumentPositionReply struct {
	Code int
	Msg  string
}

type InstrumentStatusArgs

type InstrumentStatusArgs struct {
	InstrumentStatus common.InstrumentStatus
}

*

  • @Description: 合约状态变化

type InstrumentStatusReply

type InstrumentStatusReply struct {
	Code int
	Msg  string
}

type InstrumentsArgs

type InstrumentsArgs struct {
}

*

  • @Description: ctp合约信息列表

type InstrumentsReply

type InstrumentsReply struct {
	Code        int
	Msg         string
	Instruments []goctp.InstrumentField
}

type KlineArgs

type KlineArgs struct {
	Symbol  string
	Period  string
	StaName string
}

*

  • @Description: 订阅合约K线请求

type KlineReplayArgs

type KlineReplayArgs struct {
	StartDate      string
	EndDate        string
	SubscribeKline []common.ReplaySubscribeKline
}

*

  • @Description: 回测K线请求
  • @Symbol: 合约代码
  • @Period: 周期
  • @StaName: 策略名称

type KlineReplayExArgs

type KlineReplayExArgs struct {
	StartDate      string
	EndDate        string
	Count          int64
	SubscribeKline []common.ReplaySubscribeKline
}

*

  • @Description: 回测K线请求
  • @Symbol: 合约代码
  • @Period: 周期
  • @StaName: 策略名称

type KlineReplayExReply

type KlineReplayExReply struct {
	Code    int
	Msg     string
	StaName string
	Symbol  string
	Period  string
	Kline   []common.Kline2
}

*

  • @Description: 回测K线响应
  • @Code: 返回码
  • @Msg: 消息
  • @Symbol: 合约代码
  • @Period: 周期
  • @StaName: 策略名称

type KlineReplayReply

type KlineReplayReply struct {
	Code    int
	Msg     string
	Symbol  string
	Period  string
	StaName string
}

*

  • @Description: 回测K线响应
  • @Code: 返回码
  • @Msg: 消息
  • @Symbol: 合约代码
  • @Period: 周期
  • @StaName: 策略名称

type KlineReply

type KlineReply struct {
	Code   int
	Msg    string
	Symbol string
	Period string
	Kline  []common.Kline
}

type LastPriceArgs

type LastPriceArgs struct {
	StaName string
	Symbol  string
}

*

  • @Description: 最新价

type LastPriceReply

type LastPriceReply struct {
	Code      int
	Msg       string
	LastPrice common.LastPrice
}

type NotifyIndicator

type NotifyIndicator struct {
	Action     string `json:"action"`
	StaName    string `json:"staname"`
	Indicators map[string]string
}

*

  • @Description: 通知指标消息

type OrderCancelArgs

type OrderCancelArgs struct {
	OrderSN string
	StaName string
}

*

  • @Description: 撤单请求

type OrderCancelReply

type OrderCancelReply struct {
	Code int
	Msg  string
}

type OrderErrArgs

type OrderErrArgs struct {
	RspInfoField common.RspInfoField
}

*

  • @Description: 报单错误

type OrderErrReply

type OrderErrReply struct {
	Code int
	Msg  string
}

type OrderInsertArgs

type OrderInsertArgs struct {
	StaName   string
	Symbol    string
	Exchange  string
	Price     float64
	Volume    int64
	OType     string
	Direction string
	Offset    string
}

*

  • @Description: 报单请求
  • @param requestid 请求id
  • @param ordersn 订单编号
  • @param staname 策略名称
  • @param symbol 合约代码
  • @param price 价格
  • @param volume 数量
  • @param otype 订单价格类型 PRICEMARKET:市价/PRICELIMIT:限价
  • @param direction 交易方向
  • @param offset 开平仓 TRADEOPEN:开仓/TRADECLOSE:平仓

type OrderInsertReply

type OrderInsertReply struct {
	Code    int
	Msg     string
	OrderSN string
	Volume  int64
}

type OrderRtnArgs

type OrderRtnArgs struct {
	OrderField common.OrderField
}

*

  • @Description: 报单

type OrderRtnErrArgs

type OrderRtnErrArgs struct {
	OrderErrField common.OrderErrField
}

*

  • @Description: 报单错误

type OrderRtnErrReply

type OrderRtnErrReply struct {
	Code int
	Msg  string
}

type OrderRtnReply

type OrderRtnReply struct {
	Code int
	Msg  string
}

type OrderTradeRtnArgs

type OrderTradeRtnArgs struct {
	TradeField common.TradeField
	Datetime   int64 `json:"datetime"`
}

*

  • @Description: 成交

type OrderTradeRtnReply

type OrderTradeRtnReply struct {
	Code int
	Msg  string
}

type OrdersArgs

type OrdersArgs struct {
	StaName string
}

*

  • @Description: 订单列表

type OrdersReply

type OrdersReply struct {
	Code   int
	Msg    string
	Orders []common.OrderBase
}

type PluginArgs

type PluginArgs struct {
	StaName                string `json:"staname"`
	State                  int64  `json:"state"`
	MainSymbol             string `json:"mainsymbol"`
	MainVirtualPosition    int64  `json:"mainvirtualposition"`
	MainLongOrderPosition  int64  `json:"mainlongorderposition"`
	MainShortOrderPosition int64  `json:"mainshortorderposition"`
	MainLongRealPosition   int64  `json:"mainlongrealposition"`
	MainShortRealPosition  int64  `json:"mainshortrealposition"`
	SubSymbol              string `json:"subsymbol"`
	SubVirtualPosition     int64  `json:"subvirtualposition"`
	SubLongOrderPosition   int64  `json:"sublongorderposition"`
	SubShortOrderPosition  int64  `json:"subshortorderposition"`
	SubLongRealPosition    int64  `json:"sublongrealposition"`
	SubShortRealPosition   int64  `json:"subshortrealposition"`
}

*

  • @Description: 插件状态变化

type PluginKlineArgs

type PluginKlineArgs struct {
	StaName string
	Kline   common.Kline
}

*

  • @Description: Kline行情信息

type PluginKlineReply

type PluginKlineReply struct {
	Code int
	Msg  string
}

type PluginPositionArgs

type PluginPositionArgs struct {
	StaName string
}

*

  • @Description: 插件持仓信息

type PluginPositionReply

type PluginPositionReply struct {
	Code                   int
	Msg                    string
	MainSymbol             string
	MainVirtualPosition    int64
	MainLongOrderPosition  int64
	MainShortOrderPosition int64
	SubSymbol              string
	SubVirtualPosition     int64
	SubLongOrderPosition   int64
	SubShortOrderPosition  int64
}

type PluginQuoteArgs

type PluginQuoteArgs struct {
	StaName string
	Quote   common.Quote
}

*

  • @Description: Quote行情信息

type PluginQuoteReply

type PluginQuoteReply struct {
	Code int
	Msg  string
}

type PluginReply

type PluginReply struct {
	Code int
	Msg  string
	Data interface{}
}

type PositionsArgs

type PositionsArgs struct {
}

*

  • @Description: ctp持仓信息

type PositionsReply

type PositionsReply struct {
	Code      int
	Msg       string
	Positions []goctp.PositionField
}

type ProgressArgs

type ProgressArgs struct {
	StaName string `json:"staname"`
	Current int64  `json:"current"`
	Total   int64  `json:"total"`
}

*

  • @Description: 插件进度变化

type ProgressReply

type ProgressReply struct {
	Code int
	Msg  string
	Data interface{}
}

type QuoteArgs

type QuoteArgs struct {
	Symbol  string
	StaName string
}

*

  • @Description: 订阅合约行情请求

type QuoteReply

type QuoteReply struct {
	Code   int
	Msg    string
	Symbol string
}

type ReplayArgs

type ReplayArgs struct {
	StaName   string
	StartDate string
	EndDate   string
}

*

  • @Description: 回测请求

type ReplayArgsEx

type ReplayArgsEx struct {
	StaName         string
	Period          string
	StartDate       string
	EndDate         string
	Length          int
	MainQuoteSymbol string
	SubQuoteSymbol  string
	MainKlineSymbol string
	MainKlinePeriod string
	SubKlineSymbol  string
	SubKlinePeriod  string
}

type ReplayReply

type ReplayReply struct {
	Code    int
	Msg     string
	StaName string
}

type ReplayReplyEx

type ReplayReplyEx struct {
	Code    int
	Msg     string
	StaName string
}

type Reply

type Reply struct {
	Code int
	Msg  string
	Data interface{}
}

*

  • @Description: 通用响应

type RequestIDArgs

type RequestIDArgs struct {
	StaName string
}

*

  • @Description: 请求ID

type RequestIDReply

type RequestIDReply struct {
	Code      int
	Msg       string
	RequestID int32
}

type StaInfoReply

type StaInfoReply struct {
	Code int
	Msg  string
	Data common.StrategyAggInfo
}

*

  • @Description: 策略信息响应

type TickArgs

type TickArgs struct {
	Symbol string
	Length int
}

*

  • @Description: tick历史数据请求

type TickReply

type TickReply struct {
	Code   int
	Msg    string
	Symbol string
	Tick   []common.Tick
}

Jump to

Keyboard shortcuts

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