| | |
| | | cmdProducer.sendCommand(apiKeyMd5, "UPDATE_CONFIG", JSON.toJSONString(params)); |
| | | } |
| | | |
| | | // ==================== 手动控制指令 ==================== |
| | | |
| | | @Override |
| | | public void cancelLongTpSl(String apiKeyMd5) { |
| | | cmdProducer.sendCommand(apiKeyMd5, "CANCEL_LONG_TP_SL"); |
| | | } |
| | | |
| | | @Override |
| | | public void cancelShortTpSl(String apiKeyMd5) { |
| | | cmdProducer.sendCommand(apiKeyMd5, "CANCEL_SHORT_TP_SL"); |
| | | } |
| | | |
| | | @Override |
| | | public void rebuildLongTpSl(String apiKeyMd5) { |
| | | cmdProducer.sendCommand(apiKeyMd5, "REBUILD_LONG_TP_SL"); |
| | | } |
| | | |
| | | @Override |
| | | public void rebuildShortTpSl(String apiKeyMd5) { |
| | | cmdProducer.sendCommand(apiKeyMd5, "REBUILD_SHORT_TP_SL"); |
| | | } |
| | | |
| | | @Override |
| | | public void closeLong(String apiKeyMd5) { |
| | | cmdProducer.sendCommand(apiKeyMd5, "CLOSE_LONG"); |
| | | } |
| | | |
| | | @Override |
| | | public void closeShort(String apiKeyMd5) { |
| | | cmdProducer.sendCommand(apiKeyMd5, "CLOSE_SHORT"); |
| | | } |
| | | |
| | | // ==================== 别名 ==================== |
| | | |
| | | @Override |
| | |
| | | if (params.containsKey("addPositionQuantity")) status.setAddPositionQuantity(intVal(params.get("addPositionQuantity"))); |
| | | if (params.containsKey("maxPositionPerSide")) status.setMaxPositionPerSide(intVal(params.get("maxPositionPerSide"))); |
| | | if (params.containsKey("addPositionStartThreshold")) status.setAddPositionStartThreshold(intVal(params.get("addPositionStartThreshold"))); |
| | | if (params.containsKey("placeExcessTakeProfit")) status.setPlaceExcessTakeProfit(boolVal(params.get("placeExcessTakeProfit"))); |
| | | if (params.containsKey("placeExcessTakeProfit")) status.setPlaceExcessTakeProfit(str(params.get("placeExcessTakeProfit"))); |
| | | if (params.containsKey("priceDriveEnabled")) status.setPriceDriveEnabled(boolVal(params.get("priceDriveEnabled"))); |
| | | if (params.containsKey("dualStopLossEnabled")) status.setDualStopLossEnabled(boolVal(params.get("dualStopLossEnabled"))); |
| | | if (params.containsKey("longStopLossPrice")) status.setLongStopLossPrice(str(params.get("longStopLossPrice"))); |
| | | if (params.containsKey("shortStopLossPrice")) status.setShortStopLossPrice(str(params.get("shortStopLossPrice"))); |
| | | if (params.containsKey("tpTriggerOppositeAddEnabled")) status.setTpTriggerOppositeAddEnabled(boolVal(params.get("tpTriggerOppositeAddEnabled"))); |
| | | if (params.containsKey("tpTriggerOppositeAddQuantity")) status.setTpTriggerOppositeAddQuantity(intVal(params.get("tpTriggerOppositeAddQuantity"))); |
| | | if (params.containsKey("rounds")) status.setTotalRounds(intVal(params.get("rounds"))); |
| | | if (params.containsKey("principal")) status.setPrincipal(str(params.get("principal"))); |
| | | } |