| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | |
| | | double quantity = positionValue / currentPrice; |
| | | |
| | | // 得到强平价格 |
| | | double liquidationPrice = currentPrice + (110 / quantity); |
| | | DecimalFormat df = new DecimalFormat("#.#####"); |
| | | String formattedPrice = df.format(liquidationPrice); |
| | | map.put("qiangPing",formattedPrice); |
| | | if(null != map.get("direction")){ |
| | | double liquidationPrice; |
| | | if(map.get("direction").equals("sell")){ |
| | | liquidationPrice = currentPrice + (100 / quantity); |
| | | }else{ |
| | | liquidationPrice = currentPrice - (100 / quantity); |
| | | } |
| | | DecimalFormat df = new DecimalFormat("#.#####"); |
| | | String formattedPrice = df.format(liquidationPrice); |
| | | map.put("qiangPing",formattedPrice); |
| | | } |
| | | } |
| | | |
| | | List<Item> items = this.itemService.cacheGetAll(); |
| | |
| | | double quantity = positionValue / currentPrice; |
| | | |
| | | // 得到强平价格 |
| | | double liquidationPrice = currentPrice + (110 / quantity); |
| | | DecimalFormat df = new DecimalFormat("#.#####"); |
| | | String formattedPrice = df.format(liquidationPrice); |
| | | map.put("qiangPing",formattedPrice); |
| | | if(null != map.get("direction")){ |
| | | double liquidationPrice; |
| | | if(map.get("direction").equals("sell")){ |
| | | liquidationPrice = currentPrice + (100 / quantity); |
| | | }else{ |
| | | liquidationPrice = currentPrice - (100 / quantity); |
| | | } |
| | | DecimalFormat df = new DecimalFormat("#.#####"); |
| | | String formattedPrice = df.format(liquidationPrice); |
| | | map.put("qiangPing",formattedPrice); |
| | | } |
| | | } |
| | | |
| | | } catch (BusinessException e) { |