| | |
| | | // } |
| | | // ); |
| | | |
| | | // 空仓止盈:每1张持仓对应1个止盈位,从entry网格向下逐个挂 |
| | | // 空仓止盈:超额部分挂止盈,从entry网格向下逐个挂 |
| | | int shortBaseQty = Integer.parseInt(config.getBaseQuantity()); |
| | | int shortGridQty = Integer.parseInt(config.getQuantity()); |
| | | int shortTpCount = posSize / shortGridQty; |
| | | int shortTpCount = posSize > shortBaseQty ? (posSize - shortBaseQty) / shortGridQty : 0; |
| | | |
| | | for (int i = 0; i < shortTpCount; i++) { |
| | | int tpGridId = shortGridElement.getId() - 2 * (i + 1); |
| | |
| | | // } |
| | | // ); |
| | | |
| | | // 多仓止盈:每1张持仓对应1个止盈位,从entry网格向上逐个挂 |
| | | // 多仓止盈:超额部分挂止盈,从entry网格向上逐个挂 |
| | | int longBaseQty = Integer.parseInt(config.getBaseQuantity()); |
| | | int longGridQty = Integer.parseInt(config.getQuantity()); |
| | | int longTpCount = posSize / longGridQty; |
| | | int longTpCount = posSize > longBaseQty ? (posSize - longBaseQty) / longGridQty : 0; |
| | | |
| | | for (int i = 0; i < longTpCount; i++) { |
| | | int tpGridId = longGridElement.getId() + 2 * (i + 1); |