| | |
| | | package com.xcong.excoin.modules.contract.parameter.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.xcong.excoin.utils.CommonUtils; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | |
| | | @ApiModelProperty("交易类型 1-市价2-限价") |
| | | private int tradeType; |
| | | |
| | | @ApiModelProperty("仓位类型 1-逐仓 2-全仓") |
| | | private int positionType; |
| | | |
| | | @ApiModelProperty("订单类型 -1撤单,1开多,2开空,3平多,4平空") |
| | | private int orderType; |
| | |
| | | private int closingType; |
| | | |
| | | @ApiModelProperty("止损价") |
| | | private BigDecimal stopLosePrice; |
| | | private BigDecimal stopLossPrice; |
| | | |
| | | @ApiModelProperty("止盈价") |
| | | private BigDecimal stopProfitPrice; |
| | |
| | | @ApiModelProperty("持仓费") |
| | | private BigDecimal holdAmount; |
| | | |
| | | @ApiModelProperty("杠杆") |
| | | private int leverRatio; |
| | | |
| | | public String getClosingPrice() { |
| | | return CommonUtils.amountDotFormat(this.symbol, closingPrice); |
| | | } |
| | | |
| | | public String getClosingFeeAmount() { |
| | | return closingFeeAmount == null ? "" : closingFeeAmount.setScale(2, BigDecimal.ROUND_DOWN).toPlainString(); |
| | | } |
| | | |
| | | public String getRewardAmount() { |
| | | return rewardAmount == null ? "" : rewardAmount.setScale(2, BigDecimal.ROUND_DOWN).toPlainString(); |
| | | } |
| | | |
| | | 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 getStopLossPrice() { |
| | | return CommonUtils.amountDotFormat(this.symbol, stopLossPrice); |
| | | } |
| | | |
| | | public String getStopProfitPrice() { |
| | | return CommonUtils.amountDotFormat(this.symbol, stopProfitPrice); |
| | | } |
| | | |
| | | public String getEntrustOpeningPrice() { |
| | | return CommonUtils.amountDotFormat(this.symbol, entrustOpeningPrice); |
| | | } |
| | | |
| | | public void setClosingFeeAmount(BigDecimal closingFeeAmount, BigDecimal feeSpread) { |
| | | this.closingFeeAmount = closingFeeAmount == null ? closingFeeAmount : closingFeeAmount.multiply(feeSpread).setScale(8, BigDecimal.ROUND_DOWN); |
| | | } |
| | | |
| | | public void setOpeningFeeAmount(BigDecimal openingFeeAmount, BigDecimal feeSpread) { |
| | | this.openingFeeAmount = openingFeeAmount == null ? openingFeeAmount : openingFeeAmount.multiply(feeSpread).setScale(8, BigDecimal.ROUND_DOWN); |
| | | } |
| | | } |