package com.goldenchart.trading;

/**
 * 자동매매 실행 대상: 모의 / 실거래 / 병행.
 */
public enum TradingMode {
    PAPER,
    LIVE,
    BOTH;

    public static TradingMode fromString(String raw) {
        if (raw == null || raw.isBlank()) return PAPER;
        try {
            return valueOf(raw.trim().toUpperCase());
        } catch (IllegalArgumentException e) {
            return PAPER;
        }
    }

    public boolean usePaper() {
        return this == PAPER || this == BOTH;
    }

    public boolean useLive() {
        return this == LIVE || this == BOTH;
    }
}
