Mariner Backtesting - TA-LIB Three Black Crows

CDL3BLACKCROWS

 

 integer = CDL3BLACKCROWS(open, high, low, close)
Return Codes
  • 0 = No Signal
  • -100 = Bearish Signal
  • 100 = Bullish Signal

Candlestick Plot

Three Black Crows

Working Example

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

class WE_CDL3BLACKCROWS(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.CDL3BLACKCROWS(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 = 'CDL3BLACKCROWS: ' + self.symbol
        print ktgfunc.talib_table(symbol, 1, dict)

Console

NTES:  2017-04-04 09:30:00.000000
CDL3BLACKCROWS: NTES
Input Output
date open high low close integer
2016-11-08 249.34 250.23 245.37 247.31 0.00
2016-11-09 239.85 254.01 239.07 250.19 0.00
2016-11-10 238.17 250.43 223.22 227.11 0.00
2016-11-11 227.50 234.32 216.56 233.02 0.00
2016-11-14 232.72 234.05 214.96 216.47 0.00
2016-11-15 226.10 231.36 224.07 226.59 0.00
2016-11-16 224.81 230.45 222.35 228.61 0.00
2016-11-17 228.61 235.57 228.09 235.26 0.00
2016-11-18 235.47 238.04 228.34 229.28 0.00
2016-11-21 229.58 235.67 229.54 232.61 0.00
2016-11-22 234.33 236.13 230.26 231.05 0.00
2016-11-23 230.51 232.93 228.38 230.82 0.00
2016-11-25 232.31 233.11 222.45 226.34 0.00
2016-11-28 229.73 235.20 227.87 231.01 0.00
2016-11-29 230.40 232.59 226.42 229.28 0.00
2016-11-30 229.94 233.92 223.12 223.36 0.00
2016-12-01 224.37 225.09 214.30 217.10 0.00
2016-12-02 216.85 220.85 214.96 219.86 0.00
2016-12-05 216.28 226.13 216.23 225.42 0.00
2016-12-06 225.85 225.85 218.34 221.91 0.00
2016-12-07 222.03 224.14 217.90 222.42 0.00
2016-12-08 221.96 226.64 219.60 224.47 0.00
2016-12-09 225.15 226.67 221.03 222.81 0.00
2016-12-12 218.28 218.95 210.74 217.86 0.00
2016-12-13 217.86 225.35 215.88 219.73 0.00
2016-12-14 218.64 222.28 216.11 216.77 0.00
2016-12-15 214.30 217.63 211.70 212.63 0.00
2016-12-16 213.28 217.78 211.93 212.35 0.00
2016-12-19 212.51 217.31 210.41 216.05 0.00
2016-12-20 216.28 218.25 214.76 216.18 0.00
2016-12-21 216.75 225.49 216.05 222.38 0.00
2016-12-22 220.78 221.17 215.44 216.38 0.00
2016-12-23 215.29 224.19 215.29 222.93 0.00
2016-12-27 223.76 228.04 222.77 223.25 0.00
2016-12-28 225.82 227.73 222.39 223.18 0.00
2016-12-29 223.58 224.19 220.95 222.26 0.00
2016-12-30 221.82 222.26 214.04 214.63 0.00
2017-01-03 218.66 219.57 214.92 217.44 0.00
2017-01-04 219.27 220.46 216.18 217.98 0.00
2017-01-05 219.12 229.95 219.07 228.45 0.00
2017-01-06 228.66 229.49 224.53 226.21 0.00
2017-01-09 227.06 235.71 226.71 234.12 0.00
2017-01-10 237.16 243.16 235.83 239.19 0.00
2017-01-11 236.67 240.95 234.85 238.48 0.00
2017-01-12 238.11 238.36 231.37 234.65 0.00
2017-01-13 236.01 238.70 232.85 236.90 0.00
2017-01-17 238.68 243.15 234.93 242.28 0.00
2017-01-18 240.83 243.14 232.73 235.00 0.00
2017-01-19 235.53 239.60 235.30 238.19 0.00
2017-01-20 238.42 243.59 238.42 241.54 0.00
2017-01-23 241.29 249.28 241.21 247.77 0.00
2017-01-24 252.15 256.83 247.88 253.61 0.00
2017-01-25 255.14 255.14 249.88 250.76 0.00
2017-01-26 251.17 251.63 245.02 251.11 0.00
2017-01-27 250.47 252.33 248.46 252.05 0.00
2017-01-30 249.53 251.03 247.47 249.66 0.00
2017-01-31 248.78 253.25 247.50 253.06 0.00
2017-02-01 255.54 255.91 250.02 252.98 0.00
2017-02-02 251.57 255.46 249.31 255.14 0.00
2017-02-03 256.01 256.15 252.83 254.16 0.00
2017-02-06 253.41 262.46 252.17 257.82 0.00
2017-02-07 259.18 259.96 254.67 257.18 0.00
2017-02-08 258.41 265.27 257.38 264.64 0.00
2017-02-09 264.96 264.96 255.83 256.71 0.00
2017-02-10 260.37 260.57 255.34 256.57 0.00
2017-02-13 257.93 260.80 251.71 259.92 0.00
2017-02-14 259.69 260.43 253.16 255.27 0.00
2017-02-15 258.13 262.18 255.36 260.99 0.00
2017-02-16 282.45 298.69 277.88 297.74 0.00
2017-02-17 294.76 296.95 288.42 296.27 0.00
2017-02-21 295.32 296.52 289.06 292.47 0.00
2017-02-22 292.57 306.77 291.20 303.07 0.00
2017-02-23 303.99 304.41 286.56 298.00 0.00
2017-02-24 296.02 305.61 294.63 298.94 0.00
2017-02-27 296.58 305.77 296.58 300.76 0.00
2017-02-28 301.92 307.48 301.01 304.05 0.00
2017-03-01 307.52 308.66 296.21 302.58 0.00
2017-03-02 298.50 300.00 284.50 289.38 0.00
2017-03-03 288.50 294.74 287.20 293.47 0.00
2017-03-06 294.00 294.05 287.26 292.28 0.00
2017-03-07 290.71 294.50 289.06 292.08 0.00
2017-03-08 294.60 296.50 290.79 291.44 0.00
2017-03-09 290.00 292.41 288.58 291.27 0.00
2017-03-10 291.30 291.62 288.00 289.40 0.00
2017-03-13 290.95 290.99 285.88 289.85 0.00
2017-03-14 286.60 289.95 286.13 289.44 0.00
2017-03-15 288.96 289.43 284.41 286.86 0.00
2017-03-16 288.40 288.44 282.92 283.27 0.00
2017-03-17 286.17 292.00 285.01 291.50 0.00
2017-03-20 291.50 296.75 291.05 294.12 0.00
2017-03-21 295.95 298.39 281.64 282.67 0.00
2017-03-22 283.65 287.84 280.31 286.19 0.00
2017-03-23 286.57 290.20 284.36 286.27 0.00
2017-03-24 287.08 290.88 285.97 288.98 0.00
2017-03-27 285.56 292.63 285.04 289.25 0.00
2017-03-28 291.75 292.81 288.87 289.35 0.00
2017-03-29 289.83 290.17 282.76 283.32 0.00
2017-03-30 284.31 286.50 282.13 282.35 -100.00
2017-03-31 281.75 285.69 280.35 284.00 0.00
2017-04-03 283.34 286.88 283.30 285.22 0.00