xiaoyong931011
2020-07-09 43dcf668f510da7aea8ccbe43e44039fdbe52a4a
src/main/java/com/xcong/excoin/utils/CalculateUtil.java
@@ -3,12 +3,14 @@
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 {
    /**
@@ -30,13 +32,13 @@
        //卖空
        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()));
            }