| | |
| | |
|
| | |
|
| | | import cn.hutool.core.collection.CollUtil;
|
| | | import cn.hutool.core.util.StrUtil;
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.xcong.excoin.common.enumerates.CoinTypeEnum;
|
| | | import com.xcong.excoin.common.enumerates.RabbitPriceTypeEnum;
|
| | |
| | | * 全仓模式 -- 预估强平价
|
| | | * 开仓价 - (权益 - 其他币种成本)/当前币种成本 * (开仓价 * 杠杆)
|
| | | */
|
| | | public static BigDecimal getForceSetPriceForWhole(@NotNull String currentSymbol, @NotNull MemberEntity memberEntity) {
|
| | | public static BigDecimal getForceSetPriceForWhole(String currentSymbol, @NotNull MemberEntity memberEntity) {
|
| | | ContractHoldOrderDao holdOrderDao = SpringContextHolder.getBean(ContractHoldOrderDao.class);
|
| | | MemberWalletContractDao walletContractDao = SpringContextHolder.getBean(MemberWalletContractDao.class);
|
| | |
|
| | |
| | |
|
| | | BigDecimal forcePrice = openPrice.subtract(divide.multiply(divide2));
|
| | | log.info("forcePrice -- {}", forcePrice);
|
| | | if (StrUtil.isBlank(currentSymbol)) {
|
| | | holdOrderDao.updateForcePriceBySymbolAndMemberId(forcePrice, memberId, symbol);
|
| | | }
|
| | |
|
| | | if (currentSymbol.equalsIgnoreCase(symbol)) {
|
| | | result = forcePrice;
|