Mariner Backtesting - TA-LIB Modified Hikkake Pattern

CDLHIKKAKEMOD

 

 integer = CDLHIKKAKEMOD(open, high, low, close)
  • 0 = No Signal
  • -100 = Bearish Signal
  • 100 = Bullish Signal Candlestick Plot
Modified Hikkake Pattern

Working Example

from cloudquant.interfaces import Strategy
from collections import OrderedDict
import ktgfunc
import talib

class WE_CDLHIKKAKEMOD(Strategy):

    def on_start(self, md, order, service, account):
        # symbol and timestamp
        print(self.symbol + ":  " + service.time_to_string(service.system_time))
        daily_bars = md.bar.daily(start=-100)
        close = daily_bars.close
        high = daily_bars.high
        low = daily_bars.low
        open = daily_bars.open
        integer = talib.CDLHIKKAKEMOD(open, high, low, close)

        # get the date values
        dates = service._context.market._storage.market_hours.keys()
        dateList = []
        for date in dates:
           dateList.append(str(date.strftime('%Y-%m-%d')))
        dates = sorted(dateList, reverse=True)[1:101]
        dates.sort()

        dict = OrderedDict()
        dict['date'] = dates
        dict['open'] = open
        dict['high'] = high
        dict['low'] = low
        dict['close'] = close
        dict['integer'] = integer
        symbol = 'CDLHIKKAKEMOD: ' + self.symbol
        print ktgfunc.talib_table(symbol, 1, dict)

Console

YHOO:  2015-11-04 09:30:00.000000
CDLHIKKAKEMOD: YHOO
Input Output
date open high low close integer
2015-06-15 40.24 40.67 40.21 40.47 0.00
2015-06-16 40.35 41.40 40.02 40.63 0.00
2015-06-17 40.80 41.52 40.78 40.96 0.00
2015-06-18 41.04 41.27 40.79 40.91 0.00
2015-06-19 40.90 40.93 40.37 40.51 0.00
2015-06-22 40.66 40.89 40.54 40.73 0.00
2015-06-23 40.74 40.80 40.51 40.65 0.00
2015-06-24 40.68 41.23 40.58 40.94 0.00
2015-06-25 41.10 41.38 40.90 41.06 0.00
2015-06-26 40.83 40.87 39.93 40.06 0.00
2015-06-29 39.49 39.78 38.85 38.91 0.00
2015-06-30 39.39 39.65 39.19 39.29 0.00
2015-07-01 39.46 39.78 39.15 39.33 0.00
2015-07-02 39.26 39.64 39.19 39.38 0.00
2015-07-06 38.76 39.12 38.46 38.61 0.00
2015-07-07 38.24 38.38 36.58 38.23 0.00
2015-07-08 37.20 37.49 36.94 37.23 0.00
2015-07-09 38.23 38.68 37.52 37.61 0.00
2015-07-10 38.35 38.42 37.78 37.92 0.00
2015-07-13 38.25 38.80 38.10 38.76 0.00
2015-07-14 38.65 39.03 38.44 38.63 0.00
2015-07-15 38.51 38.80 38.15 38.38 0.00
2015-07-16 38.70 38.96 38.60 38.91 0.00
2015-07-17 39.19 39.79 38.93 39.68 0.00
2015-07-20 39.98 39.98 39.26 39.54 0.00
2015-07-21 39.61 39.85 39.35 39.73 0.00
2015-07-22 38.57 39.63 38.26 39.24 0.00
2015-07-23 39.30 39.78 39.06 39.21 0.00
2015-07-24 39.58 39.58 38.67 38.85 0.00
2015-07-27 38.31 38.31 37.65 37.83 0.00
2015-07-28 37.64 37.92 37.27 37.72 0.00
2015-07-29 37.92 37.92 37.38 37.67 0.00
2015-07-30 37.50 37.69 37.30 37.42 0.00
2015-07-31 37.56 37.57 36.62 36.67 0.00
2015-08-03 36.67 36.98 36.37 36.69 0.00
2015-08-04 36.61 37.21 36.60 37.12 0.00
2015-08-05 37.32 37.71 37.23 37.25 0.00
2015-08-06 37.34 37.52 36.30 36.46 0.00
2015-08-07 36.52 36.76 36.15 36.67 0.00
2015-08-10 36.87 37.69 36.87 37.15 0.00
2015-08-11 36.74 36.77 35.73 36.03 0.00
2015-08-12 34.29 34.77 33.85 34.49 0.00
2015-08-13 35.08 36.61 34.82 35.93 0.00
2015-08-14 35.82 36.35 35.72 36.24 0.00
2015-08-17 36.24 36.24 35.76 36.10 0.00
2015-08-18 35.78 36.19 35.60 35.69 0.00
2015-08-19 35.67 35.67 35.03 35.19 0.00
2015-08-20 34.77 34.95 33.87 34.10 0.00
2015-08-21 33.58 34.02 32.91 32.93 0.00
2015-08-24 29.02 32.28 29.00 31.31 0.00
2015-08-25 32.98 33.03 31.53 31.74 0.00
2015-08-26 32.46 32.62 31.11 32.52 0.00
2015-08-27 33.36 33.77 32.95 33.69 0.00
2015-08-28 33.32 33.57 32.93 33.14 0.00
2015-08-31 32.91 32.99 32.23 32.24 0.00
2015-09-01 31.49 32.10 31.23 31.60 0.00
2015-09-02 32.01 32.03 31.38 31.77 0.00
2015-09-03 31.86 32.74 31.80 32.54 0.00
2015-09-04 32.00 32.29 31.44 31.58 0.00
2015-09-08 32.20 32.83 30.86 30.90 0.00
2015-09-09 30.40 31.80 30.35 31.52 0.00
2015-09-10 31.35 31.59 31.03 31.15 0.00
2015-09-11 31.09 31.43 30.63 31.43 0.00
2015-09-14 30.68 30.92 30.00 30.32 0.00
2015-09-15 29.72 31.23 29.41 31.04 0.00
2015-09-16 31.14 31.77 30.99 31.40 0.00
2015-09-17 31.31 31.33 30.81 30.93 0.00
2015-09-18 30.51 30.80 30.41 30.74 0.00
2015-09-21 31.20 31.74 30.88 31.17 0.00
2015-09-22 30.78 30.92 30.17 30.40 0.00
2015-09-23 30.56 30.57 29.63 29.74 0.00
2015-09-24 29.47 29.57 28.85 29.34 0.00
2015-09-25 29.66 29.71 28.91 29.13 0.00
2015-09-28 29.03 29.22 27.20 27.60 0.00
2015-09-29 28.58 29.23 27.85 28.26 0.00
2015-09-30 28.65 29.11 28.49 28.91 0.00
2015-10-01 28.95 29.00 28.44 28.91 0.00
2015-10-02 28.62 30.71 28.43 30.71 0.00
2015-10-05 30.80 31.20 30.35 30.85 0.00
2015-10-06 30.79 31.18 30.66 30.95 0.00
2015-10-07 31.31 31.99 31.21 31.87 0.00
2015-10-08 31.79 32.50 31.73 32.37 0.00
2015-10-09 32.35 32.69 31.99 32.52 0.00
2015-10-12 32.71 33.02 32.55 32.86 0.00
2015-10-13 32.56 32.83 32.32 32.34 0.00
2015-10-14 32.28 32.49 31.77 32.09 0.00
2015-10-15 32.42 33.49 32.40 33.48 0.00
2015-10-16 33.64 33.86 33.16 33.37 0.00
2015-10-19 33.26 33.63 33.18 33.50 0.00
2015-10-20 33.49 33.59 32.77 32.83 0.00
2015-10-21 32.06 32.43 31.01 31.12 0.00
2015-10-22 31.26 31.90 31.21 31.67 0.00
2015-10-23 32.65 33.36 32.24 33.17 0.00
2015-10-26 33.13 33.49 33.00 33.40 0.00
2015-10-27 34.97 35.47 33.88 34.30 0.00
2015-10-28 34.30 35.27 34.30 35.19 0.00
2015-10-29 34.87 35.15 34.70 35.05 0.00
2015-10-30 35.14 35.70 35.05 35.62 -100.00
2015-11-02 35.46 35.48 35.07 35.27 0.00
2015-11-03 35.15 35.34 34.65 34.72 0.00