trdplaceorder

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Default_Response_RetType = int32(-400)
)

Default values for Response fields.

Variables

View Source
var File_Trd_PlaceOrder_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type C2S

type C2S struct {
	PacketID  *common.PacketID     `protobuf:"bytes,1,req,name=packetID" json:"packetID,omitempty"`    //交易写操作防重放攻击
	Header    *trdcommon.TrdHeader `protobuf:"bytes,2,req,name=header" json:"header,omitempty"`        //交易公共参数头
	TrdSide   *int32               `protobuf:"varint,3,req,name=trdSide" json:"trdSide,omitempty"`     //交易方向, 参见Trd_Common.TrdSide的枚举定义
	OrderType *int32               `protobuf:"varint,4,req,name=orderType" json:"orderType,omitempty"` //订单类型, 参见Trd_Common.OrderType的枚举定义
	Code      *string              `protobuf:"bytes,5,req,name=code" json:"code,omitempty"`            //代码,港股必须是5位数字,A股必须是6位数字,美股没限制
	Qty       *float64             `protobuf:"fixed64,6,req,name=qty" json:"qty,omitempty"`            //数量,期权单位是"张"(精确到小数点后 0 位,超出部分会被舍弃。期权期货单位是"张")
	Price     *float64             `protobuf:"fixed64,7,opt,name=price" json:"price,omitempty"`        //价格,(证券账户精确到小数点后 3 位,期货账户精确到小数点后 9 位,超出部分会被舍弃)
	//以下2个为调整价格使用,都传才有效,对港、A股有意义,因为港股有价位,A股2位精度,美股可不传
	AdjustPrice        *bool    `protobuf:"varint,8,opt,name=adjustPrice" json:"adjustPrice,omitempty"`                //是否调整价格,如果价格不合法,是否调整到合法价位,true调整,false不调整
	AdjustSideAndLimit *float64 `protobuf:"fixed64,9,opt,name=adjustSideAndLimit" json:"adjustSideAndLimit,omitempty"` //调整方向和调整幅度百分比限制,正数代表向上调整,负数代表向下调整,具体值代表调整幅度限制,如:0.015代表向上调整且幅度不超过1.5%;-0.01代表向下调整且幅度不超过1%
	SecMarket          *int32   `protobuf:"varint,10,opt,name=secMarket" json:"secMarket,omitempty"`                   //证券所属市场,参见TrdSecMarket的枚举定义
	Remark             *string  `protobuf:"bytes,11,opt,name=remark" json:"remark,omitempty"`                          //用户备注字符串,最多只能传64字节。可用于标识订单唯一信息等,下单填上,订单结构就会带上。
	TimeInForce        *int32   `protobuf:"varint,12,opt,name=timeInForce" json:"timeInForce,omitempty"`               //订单有效期限,参见TrdCommon_TimeInForce的枚举定义
	FillOutsideRTH     *bool    `protobuf:"varint,13,opt,name=fillOutsideRTH" json:"fillOutsideRTH,omitempty"`         //是否允许盘前盘后成交。仅适用于美股限价单。默认false
	// contains filtered or unexported fields
}

func (*C2S) Descriptor deprecated

func (*C2S) Descriptor() ([]byte, []int)

Deprecated: Use C2S.ProtoReflect.Descriptor instead.

func (*C2S) GetAdjustPrice

func (x *C2S) GetAdjustPrice() bool

func (*C2S) GetAdjustSideAndLimit

func (x *C2S) GetAdjustSideAndLimit() float64

func (*C2S) GetCode

func (x *C2S) GetCode() string

func (*C2S) GetFillOutsideRTH

func (x *C2S) GetFillOutsideRTH() bool

func (*C2S) GetHeader

func (x *C2S) GetHeader() *trdcommon.TrdHeader

func (*C2S) GetOrderType

func (x *C2S) GetOrderType() int32

func (*C2S) GetPacketID

func (x *C2S) GetPacketID() *common.PacketID

func (*C2S) GetPrice

func (x *C2S) GetPrice() float64

func (*C2S) GetQty

func (x *C2S) GetQty() float64

func (*C2S) GetRemark

func (x *C2S) GetRemark() string

func (*C2S) GetSecMarket

func (x *C2S) GetSecMarket() int32

func (*C2S) GetTimeInForce

func (x *C2S) GetTimeInForce() int32

func (*C2S) GetTrdSide

func (x *C2S) GetTrdSide() int32

func (*C2S) ProtoMessage

func (*C2S) ProtoMessage()

func (*C2S) ProtoReflect

func (x *C2S) ProtoReflect() protoreflect.Message

func (*C2S) Reset

func (x *C2S) Reset()

func (*C2S) String

func (x *C2S) String() string

type Request

type Request struct {
	C2S *C2S `protobuf:"bytes,1,req,name=c2s" json:"c2s,omitempty"`
	// contains filtered or unexported fields
}

func (*Request) Descriptor deprecated

func (*Request) Descriptor() ([]byte, []int)

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetC2S

func (x *Request) GetC2S() *C2S

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

func (x *Request) ProtoReflect() protoreflect.Message

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

type Response

type Response struct {

	//以下3个字段每条协议都有,注释说明在InitConnect.proto中
	RetType *int32  `protobuf:"varint,1,req,name=retType,def=-400" json:"retType,omitempty"`
	RetMsg  *string `protobuf:"bytes,2,opt,name=retMsg" json:"retMsg,omitempty"`
	ErrCode *int32  `protobuf:"varint,3,opt,name=errCode" json:"errCode,omitempty"`
	S2C     *S2C    `protobuf:"bytes,4,opt,name=s2c" json:"s2c,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

func (*Response) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetErrCode

func (x *Response) GetErrCode() int32

func (*Response) GetRetMsg

func (x *Response) GetRetMsg() string

func (*Response) GetRetType

func (x *Response) GetRetType() int32

func (*Response) GetS2C

func (x *Response) GetS2C() *S2C

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

func (x *Response) ProtoReflect() protoreflect.Message

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type ResponseChan

type ResponseChan chan *Response

func (ResponseChan) Close

func (ch ResponseChan) Close()

func (ResponseChan) Send

func (ch ResponseChan) Send(b []byte) error

type S2C

type S2C struct {
	Header  *trdcommon.TrdHeader `protobuf:"bytes,1,req,name=header" json:"header,omitempty"`    //交易公共参数头
	OrderID *uint64              `protobuf:"varint,2,opt,name=orderID" json:"orderID,omitempty"` //订单号
	// contains filtered or unexported fields
}

func (*S2C) Descriptor deprecated

func (*S2C) Descriptor() ([]byte, []int)

Deprecated: Use S2C.ProtoReflect.Descriptor instead.

func (*S2C) GetHeader

func (x *S2C) GetHeader() *trdcommon.TrdHeader

func (*S2C) GetOrderID

func (x *S2C) GetOrderID() uint64

func (*S2C) ProtoMessage

func (*S2C) ProtoMessage()

func (*S2C) ProtoReflect

func (x *S2C) ProtoReflect() protoreflect.Message

func (*S2C) Reset

func (x *S2C) Reset()

func (*S2C) String

func (x *S2C) String() string

Jump to

Keyboard shortcuts

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