1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
| package com.xcong.excoin.modules.okxNewPrice.indicator.strategy;
|
| import lombok.Getter;
|
| /**
| * 交易信号枚举
| */
| @Getter
| public enum TradeSignal {
|
| /** 无信号,保持观望 */
| NO_SIGNAL("NO_SIGNAL", "无信号"),
|
| /** 买入信号 */
| BUY("BUY", "买入"),
|
| /** 卖出信号 */
| SELL("SELL", "卖出"),
|
| /** 开多信号 */
| OPEN_LONG("OPEN_LONG", "开多"),
|
| /** 平多信号 */
| CLOSE_LONG("CLOSE_LONG", "平多"),
|
| /** 开空信号 */
| OPEN_SHORT("OPEN_SHORT", "开空"),
|
| /** 平空信号 */
| CLOSE_SHORT("CLOSE_SHORT", "平空"),
|
| /** 止损信号 */
| STOP_LOSS("STOP_LOSS", "止损"),
|
| /** 止盈信号 */
| TAKE_PROFIT("TAKE_PROFIT", "止盈");
|
| private final String value;
| private final String name;
|
| TradeSignal(String value, String name) {
| this.value = value;
| this.name = name;
| }
|
| public static TradeSignal fromValue(String value) {
| for (TradeSignal signal : values()) {
| if (signal.getValue().equals(value)) {
| return signal;
| }
| }
| return NO_SIGNAL;
| }
| }
|
|