| | |
| | | package com.xcong.excoin.modules.contract.parameter.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.xcong.excoin.utils.CommonUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty("仓位类型 1-逐仓 2-全仓") |
| | | private int positionType; |
| | | |
| | | @ApiModelProperty("交易类型 1-市价2-限价") |
| | | private int tradeType; |
| | | |
| | | @ApiModelProperty("可平张数(仅全仓模式)") |
| | | private int symbolCntSale; |
| | | |
| | | @ApiModelProperty("币种") |
| | | private String symbol; |
| | |
| | | @ApiModelProperty("开仓手续费") |
| | | private BigDecimal openingFeeAmount; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty("开仓时间") |
| | | private Date openingTime; |
| | | |
| | | @ApiModelProperty("保证金") |
| | | private BigDecimal bondAmount; |
| | | |
| | |
| | | |
| | | @ApiModelProperty("止盈价") |
| | | private BigDecimal stopProfitPrice; |
| | | |
| | | @ApiModelProperty("倍率杠杆") |
| | | private int leverRatio; |
| | | |
| | | public String getOpeningPrice() { |
| | | return CommonUtils.amountDotFormat(this.symbol, openingPrice); |
| | | } |
| | | |
| | | public String getOpeningFeeAmount() { |
| | | return openingFeeAmount == null ? "" : openingFeeAmount.setScale(2, BigDecimal.ROUND_DOWN).toPlainString(); |
| | | } |
| | | |
| | | public String getBondAmount() { |
| | | return bondAmount == null ? "" : bondAmount.setScale(2, BigDecimal.ROUND_DOWN).toPlainString(); |
| | | } |
| | | |
| | | public String getHoldAmount() { |
| | | return holdAmount == null ? "" : holdAmount.setScale(2, BigDecimal.ROUND_DOWN).toPlainString(); |
| | | } |
| | | |
| | | public String getForceClosingPrice() { |
| | | return CommonUtils.amountDotFormat(this.symbol, forceClosingPrice); |
| | | } |
| | | |
| | | public String getStopLossPrice() { |
| | | return CommonUtils.amountDotFormat(this.symbol, stopLossPrice); |
| | | } |
| | | |
| | | public String getStopProfitPrice() { |
| | | return CommonUtils.amountDotFormat(this.symbol, stopProfitPrice); |
| | | } |
| | | |
| | | public void setOpeningFeeAmount(BigDecimal openingFeeAmount, BigDecimal feeSpread) { |
| | | this.openingFeeAmount = openingFeeAmount == null ? openingFeeAmount : openingFeeAmount.multiply(feeSpread).setScale(8, BigDecimal.ROUND_DOWN); |
| | | } |
| | | } |