A  Abandoned_baby_bearish
  A  Abandoned_baby_bullish
  A  Advande_block_pattern
  A  Belt_hold_bearish
  A  Belt_hold_bullish
  A  Black_spinning_top
  A  Concealing_baby_swallow
  A  Cross_EMA8_from_above10
  A  Cross_EMA8_from_above5
  A  Cross_EMA8_from_below10
  A  Cross_EMA8_from_below5
  A  Dark_сloud_сover
  A  Delibration
  A  Doji
  A  Dragonfly_doji
  A  Dragonfly_doji_bullish
  A  Engulfing_bearish_10
  A  Engulfing_bearish_15
  A  Engulfing_bearish_21
  A  Engulfing_bullish_10
  A  Engulfing_bullish_100
  A  Engulfing_bullish_15
  A  Engulfing_bullish_21
  A  Engulfing_bullish_5
  A  Engulfing_bullish_50
  A  Engulfing_pattern_bearish
  A  Engulfing_pattern_bullish
  A  Evening_star
  A  Gap_three_methods_bearish
  A  Gap_three_methods_bullish
  A  Gravestone_doji_bearish
  A  Gravestone_doji_bulish
  A  Hammer
  A  Hanging_man
  A  Harami_bearish
  A  Harami_bullish
  A  Harami_cross_bearish
  A  Harami_cross_bullish
  A  Homing_pigeon
  A  Identical_three_crows
  A  initial
  A  Inverted_hammer
  A  In_neck_delayed_bearish
  A  Kicking_bullish
  A  Ladder_bottom
  A  Long_trend_up
  A  Marubozu
  A  Meeting_lines_bearish
  A  Morning_star
  A  On_neck_bearish
  A  Piercing_line
  A  Separating_lines_bearish
  A  Shooting_star
  A  Side_by_side_white_lines_bearish
  A  Side_by_side_white_lines_bullish
  A  Spinning_top
  A  Stick_sandwich
  A  Tasuki_gap_bearish
  A  Tasuki_gap_bullish
  A  Three_black_crows
  A  Three_inside_down
  A  Three_inside_up
  A  Three_line_strike_bearish
  A  Three_methods_bullish
  A  Three_outside_down
  A  Three_outside_up
  A  Three_white_soldiers
  A  Thrusting
  A  Tri_star_bearish
  A  Tri_star_bullish
  A  Tweezer_bottoms
  A  Tweezer_tops
  A  Two_crows
  A  Unique_three_river_bottom
  A  Upside_gap_two_crows
  A  White_spinning_top
  P  black
  P  Dragonfly_doji_bearish
  P  Engulfing_bearish15
  P  Engulfing_bearish_H10
  P  Engulfing_bearish_H15
  P  Engulfing_bullish10
  P  Engulfing_bullish15
  P  Engulfing_bullish21
  P  Engulfing_pattern_bearish_H10
  P  extremum
  P  Four_Bar_Play_bearish
  P  Four_Bar_Play_bullish
  P  Gapping_bearish
  P  Gapping_bullish
  P  Pump_time
  P  Scalping1_entry_long
  P  Scalping_entry
  P  Separating_lines_bullish
  P  Three_Bar_Play_bearish
  P  Three_Bar_Play_bullish
  P  Three_methods_bearish
  P  white

Target variable to show PAIR: Images per page Range: Window:
Save Delete Run Activate Passivate

Found: Just loaded of Three_white_soldiers

Precalculated variables

        df['O'], df['H'], df['L'], df['C'] = df[open_column], df[high_column], df[low_column], df[close_column]
    # past candles
    df['O1'], df['H1'], df['L1'], df['C1'] = df['O'].shift(-1), df['H'].shift(-1), df['L'].shift(-1), df['C'].shift(-1)
    df['O2'], df['H2'], df['L2'], df['C2'] = df['O'].shift(-2), df['H'].shift(-2), df['L'].shift(-2), df['C'].shift(-2)
    df['O3'], df['H3'], df['L3'], df['C3'] = df['O'].shift(-3), df['H'].shift(-3), df['L'].shift(-3), df['C'].shift(-3)
    df['O4'], df['H4'], df['L4'], df['C4'] = df['O'].shift(-4), df['H'].shift(-4), df['L'].shift(-4), df['C'].shift(-4)
    df['O5'], df['H5'], df['L5'], df['C5'] = df['O'].shift(-5), df['H'].shift(-5), df['L'].shift(-5), df['C'].shift(-5)
    # future candles
    df['O_1'], df['H_1'], df['L_1'], df['C_1'] = df['O'].shift(1), df['H'].shift(1), df['L'].shift(1), df['C'].shift(1)
    df['O_2'], df['H_2'], df['L_2'], df['C_2'] = df['O'].shift(2), df['H'].shift(2), df['L'].shift(-2), df['C'].shift(2)
    df['O_3'], df['H_3'], df['L_3'], df['C_3'] = df['O'].shift(3), df['H'].shift(3), df['L'].shift(3), df['C'].shift(3)
    df['O_4'], df['H_4'], df['L_4'], df['C_4'] = df['O'].shift(4), df['H'].shift(4), df['L'].shift(4), df['C'].shift(4)
    df['O_5'], df['H_5'], df['L_5'], df['C_5'] = df['O'].shift(5), df['H'].shift(5), df['L'].shift(5), df['C'].shift(5)

    df = df.eval('o_c = O - C')
    df['o_c'] = df['o_c'].abs()
    df['SMA_15_o_c'] = df['o_c'].rolling(window=15).mean()
    df['AVG_15_o_c'] = df['SMA_15_o_c']
    df['AVGC15'] = df['C'].rolling(window=15).mean()
    df['AVGO15'] = df['O'].rolling(window=15).mean()
    df['AVGC3'] = df['C'].rolling(window=3).mean()
    df['AVGO3'] = df['O'].rolling(window=3).mean()
    df['AVGH10'] = df['H'].rolling(window=10).mean()
    df['AVGL10'] = df['L'].rolling(window=10).mean()
    df['MINL10'] = df['L'].rolling(window=10).min()
    df['MAXH10'] = df['H'].rolling(window=10).max()
    df['MINO10'] = df['O'].rolling(window=10).min()
    df['MAXO10'] = df['O'].rolling(window=10).max()
    df['AVGC13'] = df['C'].rolling(window=13).mean()
    df['AVGH20'] = df['H'].rolling(window=20).mean()
    df['AVGL20'] = df['L'].rolling(window=20).mean()
    df['AVGH21'] = df['H'].rolling(window=21).mean()
    df['AVGL21'] = df['L'].rolling(window=21).mean()
    df['MINL3'] = df['L'].rolling(window=3).min()
    df['MINL5'] = df['L'].rolling(window=5).min()
    df['MAXH3'] = df['H'].rolling(window=3).max()
    df['MAXH5'] = df['H'].rolling(window=5).max()

    # df = pd.eval('bodysize = abs(df.O - df.C) ', target=df)  #
    df = eval(df, 'bodysize = abs(O - C) ')  #
    df = eval(df, 'Long = bodysize > AVG_15_o_c * 1.3')
    df = eval(df, 'Short = bodysize < AVG_15_o_c * 0.5')
    df = eval(df, 'Small = Short')
    df = eval(df, 'bull = O < C ')  #
    df = eval(df, 'bear = O > C ')  #
    df = eval(df, 'black = bear')  #
    df = eval(df, 'white = bull')  #
    df = eval(df, 'Long_black = black and Long')  #
    df = eval(df, 'Long_white = white and Long')  #
    df = eval(df, 'Trend_up_H5 = (MAXH5 == H) ')  #
    df = eval(df, 'Trend_down_L5 = (MINL5 == L)')  #
    df = eval(df, 'Trend_up_H3 = (MAXH3 == H) ')  #
    df = eval(df, 'Trend_down_L3 = (MINL3 == L)')  #

    df.loc[df.bear == True, 'shade_low'] = df.C - df.L
    df.loc[df.bull == True, 'shade_low'] = df.O - df.L
    df.loc[df.bear == True, 'shade_high'] = df.H - df.O
    df.loc[df.bull == True, 'shade_high'] = df.H - df.C

    HL = H - L
    Marubozu_white = (C > O) and (H == C) and (O == L)
    Marubozu_black = ((O > C) and (H == O) and (C == L))
    Marubozu = Marubozu_white or Marubozu_black
    Marubozu_long = Marubozu and Long
    Marubozu_small = Marubozu and Small
    Marubozu_short = Marubozu_small
    Hammer = (shade_low > bodysize * 2 and shade_high < bodysize * 0.1)
    Inverted_hammer = (shade_low < bodysize*0.1 and shade_high > bodysize*2)

    Trend_up = AVGC15 < C
    Trend_down = (AVGC15 > C)
    Trend_lateral = (AVGC15 == C)

    Trend15_up = AVGC15 < C
    Trend15_down = (AVGC15 > C)
    Trend15_lateral = (AVGC15 == C)

    Trend3_up = AVGC3 < C
    Trend3_down = (AVGC3 > C)
    Trend3_lateral = (AVGC3 == C)
    Long_black = (O > C) and ((O - C) / (0.001 + H - L) > 0.6)
    Long_white = (C > O) and ((C - O) / (0.001 + H - L) > 0.6)
    Long = Long_black or Long_white
    Small_black = (O > C) and ((H - L) > (3 * (O - C)))
    Small_white = (C > O) and ((H - L) > (3 * (C - O)))
    Small = Small_black or Small_white
    Black = C < O
    Doji =  (abs(O-C) < abs(H-L) * 0.03)
    Dragonfly_doji_bullish = Trend_up_H5 and Doji and ((H-L) > 3 * abs(O-C)) \
        and ((C-L) > 0.8 * (H-L)) and ((O - L) > 0.8 * (H-L))
    Dragonfly_doji_bearish = Trend_down_L5 and Doji and  (((C <= O)*O) + ((C > O) *C)) > (H * 0.95) \
        and ((((C <= O) * C) + ((C >O) * O)) - L) > (H -L) * 0.75
    Dragonfly_doji = Doji and ( Dragonfly_doji_bullish or Dragonfly_doji_bearish)

    Spin_top_black = bear and  ((Small and (C - L)> bodysize) \
     and (H - O) > bodysize) and (~ Doji)
    Spin_top_white = bull and  ((Small and  (O - L)> bodysize) and (H - C) > bodysize)  and (~ Doji)
    Spin_top = (Spin_top_black or Spin_top_white) and (~ Hammer) and (~ Inverted_hammer) and (~ Doji)

    Gravestone_doji_bullish = (abs(O-C) <= 0.01*(H-L)) \
           and ((H-C) >= 0.95*(H-L)) and (H > L) and (L <= L1+0.3*(H1-L1)) and ((H-L) >= (AVGH10-AVGL10))

    Gravestone_doji_bearish = (abs(O-C) <= 0.01*(H-L)) and ((H-C) >= 0.95*(H-L)) \
           and (H > L) and (H == MAXH10) and ((H-L) >= (AVGH10-AVGL10))
    Gravestone_doji = Gravestone_doji_bearish  or Gravestone_doji_bullish