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; } }