# coding: utf-8

from enum import Enum

class Mark(Enum):
    D = "底分型"
    G = "顶分型"

class Direction(Enum):
    Up = "向上"
    Down = "向下"

class Freq(Enum):
    F1 = "1分钟"
    F5 = "5分钟"
    F15 = "15分钟"
    F30 = "30分钟"
    F60 = "60分钟"
    D = "日线"
    W = "周线"
    M = "月线"

class FdThree(Enum):
    """三段形态分类"""
    # 多头形态
    L1 = "向下不重合"
    L2 = "向下奔走型中枢"
    L3 = "向下三角收敛中枢"
    L4 = "向下三角扩张中枢"
    L5 = "向下盘背中枢"
    L6 = "向下无背中枢"

    # 空头形态
    S1 = "向上不重合"
    S2 = "向上奔走型中枢"
    S3 = "向上三角收敛中枢"
    S4 = "向上三角扩张中枢"
    S5 = "向上盘背中枢"
    S6 = "向上无背中枢"

    Other = "其他"

class FdFive(Enum):
    """五段形态分类"""
    L1A1 = "向下三角收敛中枢"
    L1B1 = "向下三角扩张中枢"

    L2A1 = "aAb式底背驰A"
    L2B1 = "aAb式底背驰B"
    L2C1 = "aAb式底背驰C"

    L3A1 = "类趋势底背驰"

    L4A1 = "三买A1"
    L4A2 = "三买A2"
    L4B1 = "三买B1"
    L4B2 = "三买B2"
    L4C1 = "三买C1"
    L4C2 = "三买C2"
    L4D1 = "三买D1"
    L4D2 = "三买D2"

    L5A1 = "cA底部A"
    L5B1 = "cA底部B"

    S1A1 = "向上三角收敛中枢"
    S1B1 = "向上三角扩张中枢"

    S2A1 = "aAb式顶背驰A"
    S2B1 = "aAb式顶背驰B"
    S2C1 = "aAb式顶背驰C"

    S3A1 = "类趋势顶背驰"

    S4A1 = "三卖A1"
    S4A2 = "三卖A2"
    S4B1 = "三卖B1"
    S4B2 = "三卖B2"
    S4C1 = "三卖C1"
    S4C2 = "三卖C2"
    S4D1 = "三卖D1"
    S4D2 = "三卖D2"

    S5A1 = "cA顶部A"
    S5B1 = "cA顶部B"

    Other = "其他"

class FdSeven(Enum):
    """七段形态分类"""
    L1A1 = "aAb式底背驰"
    L2A1 = "aAbcd式底背驰"
    L3A1 = "BaA式右侧底A"
    L3B1 = "BaA式右侧底B"
    L4A1 = "类趋势底背驰"

    S1A1 = "aAb式顶背驰"
    S2A1 = "aAbcd式顶背驰"
    S3A1 = "BaA式右侧顶A"
    S3B1 = "BaA式右侧顶B"
    S4A1 = "类趋势顶背驰"

    Other = "其他"

class FdNine(Enum):
    """九段形态分类"""
    L1A1 = "类趋势底背驰"

    L2A1 = "含有一个上下上方向中枢A"
    L2B1 = "含有一个上下上方向中枢B"
    L2C1 = "含有一个上下上方向中枢C"

    L3A1 = "标准aAbBc向下趋势底背弛"

    L4A1 = "上中枢七段下跌"
    L4B1 = "下中枢七段下跌"

    # =================================

    S1A1 = "类趋势顶背驰"

    S2A1 = "含有一个下上下方向中枢A"
    S2B1 = "含有一个下上下方向中枢B"
    S2C1 = "含有一个下上下方向中枢C"

    S3A1 = "标准aAbBc向上趋势顶背驰"

    S4A1 = "上中枢七段上涨"
    S4B1 = "下中枢七段上涨"

    Other = "其他"

class Signals(Enum):
    Other = "其他"
    # 信号名编号规则：
    # 笔数：X5 - 五笔信号；X7 - 七笔信号；X9 - 九笔信号；
    # 组别：GA；GB ...
    # 数字：1,2,3,4；表示倒数第N笔
    # 组合规则：笔数_组别_数字；如 X5GA1 表示五笔GA组的倒数第1笔信号名
    # ============================================================================================
    # 倒1的五笔形态、倒1的七笔形态、倒1的九笔形态
    X5GA1 = "倒1的五笔形态之aAb式背驰"    # ‘倒1’ 是 ‘倒数第1笔’ 的缩写
    X5GA2 = "倒2的五笔形态之aAb式背驰"
    X5GA3 = "倒3的五笔形态之aAb式背驰"
    X5GA4 = "倒4的五笔形态之aAb式背驰"

    # 信号值编号规则：
    # 笔数：X5 - 五笔信号；X7 - 七笔信号；X9 - 九笔信号；
    # 多空：L - 多头信号；S - 空头信号；
    # 顺序：L/S 后面跟的 A-F 表示信号顺序
    # 数字：0-10表示信号变种，0是基础型
    # 组合规则：笔数_多空_顺序_数字；如 X5LA0 表示五笔多头信号A0
    # ============================================================================================

    # 五笔多头信号
    X5LA0 = "aAb式底背弛0"
    X5LB0 = "三买0"
    X5LC0 = "类趋势底背驰0"
    X5LD0 = "向下三角扩张中枢0"
    X5LE0 = "向下三角收敛中枢0"
    X5LF0 = "大级别底分0"

    # 五笔空头信号
    X5SA0 = "aAb式顶背驰0"
    X5SB0 = "三卖0"
    X5SC0 = "类趋势顶背驰0"
    X5SD0 = "向上三角扩张中枢0"
    X5SE0 = "向上三角收敛中枢0"
    X5SF0 = "大级别顶分0"

    # 七笔多头信号
    X7L1A = ""

    # 七笔空头信号
    X7S1A = ""

    # 九笔多头信号
    X9L1A = ""

    # 九笔空头信号
    X9S1A = ""


class Factors(Enum):
    # 编号规则：
    # D - 日线；F30 - 30分钟; F5 - 5分钟;
    # L - 多头信号标记；S - 空头信号标记；
    # A - 右侧信号标记；B - 左侧信号标记；
    # 最后的数字为因子的编写顺序，仅用于区分不同因子
    # 组合规则为 级别_多空_左右_数字
    # ============================================================================================

    # 日线右侧多头因子
    DLA1 = "30分钟近七笔为BaA式右侧底B"
    DLA2 = "日线第N笔超强底分&5分钟近七笔为BaA式右侧底A"
    DLA3 = "内部30分钟为七笔底背驰"
    DLA4 = "内部30分钟为五笔底背驰"
    DLA5 = "30分钟近五笔为三买&日线向上延伸长度小于7"

    # 日线左侧多头因子
    DLB1 = "30分钟近七笔为底背驰"
    DLB2 = "30分钟近九笔为标准aAbBc向下趋势底背弛"

    # 30分钟右侧多头因子
    F30LA1 = "5分钟近五笔为三买&1分钟近七笔为BaA式右侧底B"

    # 30分钟左侧多头因子
    F30LB1 = ""

    # 5分钟右侧多头因子
    F5LA1 = "5分钟第N笔向下&1分钟近七笔为BaA式右侧底B"

    # 5分钟左侧多头因子
    F5LB1 = "5分钟第N笔向上&1分钟近七笔为底背驰"
    F5LB2 = "5分钟第N笔向上&1分钟近五笔为底背驰"

    # ============================================================================================

    # 日线右侧空头因子
    DSA1 = "日线右侧空头1"

    # 日线左侧空头因子
    DSB1 = "30分钟第N笔的五笔形态为顶背驰"
    DSB2 = "30分钟第N笔的七笔形态为顶背驰"

    # 30分钟右侧空头因子
    F30SA1 = ""

    # 30分钟左侧空头因子
    F30SB1 = ""

    # 5分钟右侧空头因子
    F5SA1 = "5分钟第N笔向上&1分钟近七笔为BaA式右侧顶B"

    # 5分钟左侧空头因子
    F5SB1 = "1分钟近七笔为顶背驰"
    F5SB2 = "1分钟近五笔为顶背驰"

    Other = "其他"

