34 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			34 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| 
								 | 
							
								package positiondto
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import "github.com/shopspring/decimal"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								//持仓信息
							 | 
						||
| 
								 | 
							
								type PositionDto struct {
							 | 
						||
| 
								 | 
							
									SymbolType   int             `json:"symbolType"`   //交易对类型 1-现货 2-合约
							 | 
						||
| 
								 | 
							
									Side         string          `json:"side"`         //买卖方向 BUY SELL
							 | 
						||
| 
								 | 
							
									PositionSide string          `json:"positionSide"` //持仓方向 LONG SHORT
							 | 
						||
| 
								 | 
							
									Quantity     decimal.Decimal `json:"quantity"`     //总数量
							 | 
						||
| 
								 | 
							
									TotalLoss    decimal.Decimal `json:"totalLoss"`    //总亏损
							 | 
						||
| 
								 | 
							
									Symbol       string          `json:"symbol"`       //交易对
							 | 
						||
| 
								 | 
							
									ApiId        int             `json:"apiId"`        //apiid
							 | 
						||
| 
								 | 
							
									LastPrice    decimal.Decimal `json:"lastPrice"`    //上一次成交价
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								type PositionAddReq struct {
							 | 
						||
| 
								 | 
							
									SymbolType   int             `json:"symbolType"`   //交易对类型 1-现货 2-合约
							 | 
						||
| 
								 | 
							
									Side         string          `json:"side"`         //方向
							 | 
						||
| 
								 | 
							
									Quantity     decimal.Decimal `json:"quantity"`     //总数量
							 | 
						||
| 
								 | 
							
									Symbol       string          `json:"symbol"`       //交易对
							 | 
						||
| 
								 | 
							
									ApiId        int             `json:"apiId"`        //apiid
							 | 
						||
| 
								 | 
							
									Price        decimal.Decimal `json:"price"`        //本次成交价
							 | 
						||
| 
								 | 
							
									PositionSide string          `json:"positionSide"` //持仓方向
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								type LinePreOrderPositioinDelReq struct {
							 | 
						||
| 
								 | 
							
									SymbolType   int    `json:"symbolType"`   //交易对类型 1-现货 2-合约
							 | 
						||
| 
								 | 
							
									Side         string `json:"side"`         //方向
							 | 
						||
| 
								 | 
							
									Symbol       string `json:"symbol"`       //交易对
							 | 
						||
| 
								 | 
							
									ApiId        int    `json:"apiId"`        //apiid
							 | 
						||
| 
								 | 
							
									ExchangeType string `json:"exchangeType"` //交易所类型
							 | 
						||
| 
								 | 
							
								}
							 |