Exemple #1
0
 def get_signals(c: CZSC) -> OrderedDict:
     s = OrderedDict({"symbol": c.symbol, "dt": c.bars_raw[-1].dt, "close": c.bars_raw[-1].close})
     s.update(signals.get_s_like_bs(c, di=1))
     s.update(signals.get_s_bar_end(c))
     s.update(signals.get_s_d0_bi(c))
     if c.freq == Freq.F60:
         s.update(signals.get_s_macd(c, di=1))
     return s
Exemple #2
0
 def get_test_signals(c: CZSC) -> OrderedDict:
     s = OrderedDict({
         "symbol": c.symbol,
         "dt": c.bars_raw[-1].dt,
         "close": c.bars_raw[-1].close
     })
     s.update(signals.get_s_d0_bi(c))
     return s
Exemple #3
0
    def get_signals(c: CZSC) -> OrderedDict:
        """通用信号获取"""
        s = OrderedDict({"symbol": c.symbol, "dt": c.bars_raw[-1].dt, "close": c.bars_raw[-1].close})
        s.update(signals.get_s_bar_end(c))
        s.update(signals.get_s_k(c))
        s.update(signals.get_s_three_bi(c, di=1))
        s.update(signals.get_s_base_xt(c, di=1))
        s.update(signals.get_s_like_bs(c, di=1))
        s.update(signals.get_s_d0_bi(c))

        s.update(signals.get_s_macd(c, di=1))
        s.update(signals.get_s_sma(c, di=1, t_seq=(5, 10, 20, 60)))
        return s
Exemple #4
0
def get_user_signals(c: CZSC) -> OrderedDict:
    """自定义在 CZSC 对象上计算哪些信号

    :param c: CZSC 对象
    :return: 信号字典
    """
    s = OrderedDict({
        "symbol": c.symbol,
        "dt": c.bars_raw[-1].dt,
        "close": c.bars_raw[-1].close
    })

    s.update(signals.get_s_d0_bi(c))
    s.update(signals.get_s_three_k(c, 1))
    s.update(signals.get_s_di_bi(c, 1))
    s.update(signals.get_s_macd(c, 1))
    s.update(signals.get_s_k(c, 1))
    s.update(signals.get_s_bi_status(c))
    s.update(signals.get_s_three_bi(c, di=1))
    s.update(signals.get_s_base_xt(c, di=1))
    s.update(signals.get_s_like_bs(c, di=1))
    return s