| | |
| | |
|
| | | import com.xcong.excoin.modules.member.entity.MemberEntity;
|
| | | import com.xcong.excoin.modules.platform.entity.PlatformTradeSettingEntity;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | /**
|
| | | * @author helius
|
| | | */
|
| | | @Slf4j
|
| | | public class CalculateUtil {
|
| | |
|
| | | /**
|
| | |
| | | //卖空
|
| | | if (type == 2) {
|
| | | forcePrice = money.add(openPrice);
|
| | | if (member.getIsProfit() == 1) {
|
| | | if (member.getIsForce() == 1) {
|
| | | //预估强平价 = 预估强平价-预估强平价*系数
|
| | | forcePrice = forcePrice.subtract(forcePrice.multiply(tradeSetting.getForceParam()));
|
| | | }
|
| | | } else {//开多
|
| | | forcePrice = openPrice.subtract(money);
|
| | | if (member.getIsProfit() == 1) {
|
| | | if (member.getIsForce() == 1) {
|
| | | //预估强平价 = 预估强平价-预估强平价*系数
|
| | | forcePrice = forcePrice.add(forcePrice.multiply(tradeSetting.getForceParam()));
|
| | | }
|