Ejemplo n.º 1
0
def white_soldiers(book, ccc):
    if (green(ccc.candle1)):
        if (green(ccc.candle2)):
            if (green(ccc.candle3)):
                if ccc.candle1.o > ccc.candle2.o:
                    if ccc.candle2.o > ccc.candle3.o:
                        if ccc.candle1.c > ccc.candle2.c:
                            if ccc.candle2.c > ccc.candle3.c:
                                print_pattern("[BULL] White Soldiers",
                                              ccc.candle1)
                                return bear_to_bull(ccc.candle1, book)
                            else:
                                return book
                        else:
                            return book
                    else:
                        return book
                else:
                    return book
            else:
                return book
        else:
            return book
    else:
        return book
Ejemplo n.º 2
0
def black_crows(book, compound):
    if red(compound.candle1):
        if red(compound.candle2):
            if red(compound.candle3):
                if compound.candle1.o < compound.candle2.o:
                    if compound.candle2.o < compound.candle3.o:
                        if compound.candle1.c < compound.candle2.c:
                            if compound.candle2.c < compound.candle3.c:
                                print_pattern("[BEAR] Black Crows",
                                              compound.candle1)
                                return bull_to_bear(compound.candle1, book)
                            else:
                                return book
                        else:
                            return book
                    else:
                        return book
                else:
                    return book
            else:
                return book
        else:
            return book
    else:
        return book
Ejemplo n.º 3
0
def inverted_hammer(book, candle):
    if green(candle):
        if upper_wick(True, candle) >= (body_size(True, candle) * 2):
            if lower_wick(True, candle) <= (body_size(True, candle) * .5):
                print_pattern("[BULL] Inverted Hammer", candle)
                return bear_to_bull(candle, book)
            else:
                return book
        else:
            return book
    else:
        return book
Ejemplo n.º 4
0
def hanging_man(book, candle):
    if red(candle):  # Red
        if lower_wick(False, candle) >= (body_size(False, candle) *
                                         2):  # big lower wick
            if upper_wick(False, candle) <= (body_size(False, candle) *
                                             .5):  # small upper wick
                print_pattern("[BEAR] Hanging Man", candle)
                return bull_to_bear(candle, book)
            else:
                return book
        else:
            return book
    else:
        return book
Ejemplo n.º 5
0
def shooting_star(book, candle):
    if red(candle):
        if upper_wick(False, candle) >= (body_size(False, candle) *
                                         2):  # big upper wick
            if lower_wick(False, candle) <= (body_size(False, candle) *
                                             .5):  # small lower wick
                print_pattern("[BEAR] Shooting Star", candle)
                return bull_to_bear(candle, book)
            else:
                return book
        else:
            return book
    else:
        return book
Ejemplo n.º 6
0
def bullish_harami(book, ccc):
    if (green(ccc.candle1)):
        if (red(ccc.candle2)):
            if (ccc.candle1.o > ccc.candle2.c):
                if (ccc.candle1.c < ccc.candle2.o):
                    print_pattern("[BULL] Bullish Harami", ccc.candle1)
                    return bear_to_bull(ccc.candle1, book)
                else:
                    return book
            else:
                return book
        else:
            return book
    else:
        return book
Ejemplo n.º 7
0
def bearish_harami(book, compound):
    if red(compound.candle1):
        if green(compound.candle2):
            if compound.candle1.o < compound.candle2.c:
                if compound.candle1.c > compound.candle2.o:
                    print_pattern("[BEAR] Bearish Harami", compound.candle1)
                    return bull_to_bear(compound.candle1, book)
                else:
                    return book
            else:
                return book
        else:
            return book
    else:
        return book