package com.ruoyi.web.modules.trading.support;

import java.math.BigDecimal;

/**
 * 根据涨跌概率推导走势预测文案。
 */
public final class YakMarketTrendPredictor
{
    private YakMarketTrendPredictor()
    {
    }

    public static String resolve(BigDecimal probRise, BigDecimal probFlat, BigDecimal probFall)
    {
        BigDecimal rise = probRise != null ? probRise : BigDecimal.ZERO;
        BigDecimal flat = probFlat != null ? probFlat : BigDecimal.ZERO;
        BigDecimal fall = probFall != null ? probFall : BigDecimal.ZERO;
        if (rise.compareTo(flat) >= 0 && rise.compareTo(fall) >= 0)
        {
            return "看涨";
        }
        if (flat.compareTo(rise) > 0 && flat.compareTo(fall) >= 0)
        {
            return "看平";
        }
        return "看跌";
    }
}
