| | |
| | | config.getPassphrase(), |
| | | !config.isProduction()); |
| | | |
| | | log.info("[管理器] 清理原有持仓和委托..."); |
| | | restClient.cancelAllOrders(config.getContract()); |
| | | restClient.closeAllPositions(config.getContract(), config.getMarginMode()); |
| | | |
| | | boolean posModeOk = restClient.setPositionMode(config.getPosMode()); |
| | | if (!posModeOk) { |
| | | log.error("[管理器] 设置持仓方式失败,策略可能无法正常运作"); |
| | |
| | | log.error("[管理器] 设置杠杆倍数失败,策略可能无法正常运作"); |
| | | } |
| | | |
| | | String instIdCode = restClient.fetchInstIdCode("SWAP", config.getContract()); |
| | | Long instIdCode = restClient.fetchInstIdCode("SWAP", config.getContract()); |
| | | if (instIdCode != null) { |
| | | config.setInstIdCode(instIdCode); |
| | | } else { |