Mariner Backtesting - TA-LIB Rising/Falling Three Methods

CDLRISEFALL3METHODS

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

Candlestick Plot

Rising/Falling Three Methods

Working Example

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

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

Console

NTES:  2016-08-31 09:30:00.000000
CDLRISEFALL3METHODS: NTES
Input Output
date open high low close integer
2016-04-11 143.61 144.27 137.58 137.81 0.00
2016-04-12 138.24 139.22 135.16 136.10 0.00
2016-04-13 138.89 142.15 138.02 141.61 0.00
2016-04-14 142.35 143.55 139.42 140.32 0.00
2016-04-15 140.64 140.71 136.64 137.19 0.00
2016-04-18 135.79 138.84 135.79 137.92 0.00
2016-04-19 138.98 138.98 134.31 136.69 0.00
2016-04-20 135.93 136.89 134.77 134.86 0.00
2016-04-21 136.54 136.85 132.16 135.06 0.00
2016-04-22 133.94 135.13 131.28 132.02 0.00
2016-04-25 131.95 132.13 129.78 132.03 0.00
2016-04-26 132.03 133.74 130.95 132.54 0.00
2016-04-27 131.86 133.71 131.04 132.09 0.00
2016-04-28 132.45 136.82 132.45 133.81 0.00
2016-04-29 133.60 139.62 133.60 139.59 0.00
2016-05-02 138.29 139.59 137.01 138.28 0.00
2016-05-03 136.92 137.81 135.37 136.61 0.00
2016-05-04 135.77 139.50 135.77 138.39 0.00
2016-05-05 138.93 141.37 138.48 139.37 0.00
2016-05-06 138.85 140.66 136.41 139.20 0.00
2016-05-09 138.40 139.72 137.00 137.86 0.00
2016-05-10 137.90 142.98 137.14 142.26 0.00
2016-05-11 142.42 147.03 140.70 144.02 0.00
2016-05-12 147.98 148.81 138.46 144.65 0.00
2016-05-13 145.57 153.10 145.40 152.19 0.00
2016-05-16 154.29 161.85 153.92 160.34 0.00
2016-05-17 160.18 165.36 159.14 162.20 0.00
2016-05-18 162.47 163.17 158.89 162.27 0.00
2016-05-19 161.52 163.17 157.67 159.95 0.00
2016-05-20 161.20 167.53 161.20 165.49 0.00
2016-05-23 165.42 167.06 163.37 163.61 0.00
2016-05-24 165.48 173.51 164.43 173.38 0.00
2016-05-25 175.43 175.43 170.40 172.38 0.00
2016-05-26 172.39 176.40 171.39 176.20 0.00
2016-05-27 176.86 177.23 172.68 175.16 0.00
2016-05-31 176.30 178.46 174.71 177.20 0.00
2016-06-01 175.38 176.68 171.99 175.53 0.00
2016-06-02 175.10 176.31 172.11 172.98 0.00
2016-06-03 173.29 176.90 172.98 174.93 0.00
2016-06-06 175.17 175.35 172.39 173.90 0.00
2016-06-07 173.15 176.66 171.87 174.19 0.00
2016-06-08 174.06 175.29 172.65 174.20 0.00
2016-06-09 172.89 174.00 168.86 170.87 0.00
2016-06-10 168.46 168.86 160.87 161.40 0.00
2016-06-13 160.43 165.56 160.43 162.63 0.00
2016-06-14 162.18 164.86 161.51 163.87 0.00
2016-06-15 164.19 164.75 162.36 163.71 0.00
2016-06-16 162.92 165.26 161.92 164.69 0.00
2016-06-17 163.62 165.16 160.74 162.53 0.00
2016-06-20 165.75 166.79 163.05 164.35 0.00
2016-06-21 164.82 166.64 164.14 165.18 0.00
2016-06-22 166.01 168.67 164.43 166.93 0.00
2016-06-23 168.99 172.37 167.22 172.29 0.00
2016-06-24 164.85 172.98 164.56 171.48 0.00
2016-06-27 169.88 170.39 164.86 166.06 0.00
2016-06-28 168.12 172.62 168.12 172.38 0.00
2016-06-29 174.38 183.23 171.83 180.83 0.00
2016-06-30 184.16 192.58 183.65 192.53 0.00
2016-07-01 192.56 192.75 183.14 183.91 0.00
2016-07-05 183.34 189.32 182.82 186.17 0.00
2016-07-06 185.12 187.81 184.67 185.46 0.00
2016-07-07 184.34 188.74 184.34 187.77 0.00
2016-07-08 188.48 188.95 182.21 184.47 0.00
2016-07-11 188.48 197.49 187.36 195.92 0.00
2016-07-12 198.91 201.98 194.66 196.63 0.00
2016-07-13 196.95 197.17 192.31 192.94 0.00
2016-07-14 194.46 196.58 192.82 194.80 0.00
2016-07-15 195.21 199.07 193.56 194.51 0.00
2016-07-18 196.00 201.21 194.50 198.72 0.00
2016-07-19 197.53 199.53 195.61 198.07 0.00
2016-07-20 199.29 199.29 196.32 198.34 0.00
2016-07-21 197.49 199.28 195.80 196.67 0.00
2016-07-22 197.29 197.77 193.71 195.32 0.00
2016-07-25 195.40 200.85 192.58 200.40 0.00
2016-07-26 200.70 205.32 200.24 203.76 0.00
2016-07-27 204.86 207.20 203.77 206.43 0.00
2016-07-28 207.05 209.52 203.65 205.29 0.00
2016-07-29 204.90 205.26 202.49 203.54 0.00
2016-08-01 203.52 203.52 197.87 201.99 0.00
2016-08-02 201.57 201.84 198.48 199.62 0.00
2016-08-03 198.96 201.96 196.30 197.89 0.00
2016-08-04 198.47 200.43 196.47 197.71 0.00
2016-08-05 199.79 201.28 198.86 200.87 0.00
2016-08-08 200.87 202.61 198.93 199.64 0.00
2016-08-09 198.86 199.72 196.94 198.28 0.00
2016-08-10 199.29 200.67 197.25 198.70 0.00
2016-08-11 200.63 201.77 198.99 199.57 0.00
2016-08-12 199.25 205.75 198.30 205.13 0.00
2016-08-15 208.28 215.20 204.77 210.72 0.00
2016-08-16 212.59 216.59 211.71 212.44 0.00
2016-08-17 213.50 214.72 211.52 212.57 0.00
2016-08-18 216.23 216.24 198.42 206.88 0.00
2016-08-19 205.66 209.98 203.47 208.99 0.00
2016-08-22 208.25 213.71 207.69 211.81 0.00
2016-08-23 212.80 214.21 210.99 212.41 0.00
2016-08-24 212.08 213.61 209.73 210.36 0.00
2016-08-25 209.25 209.55 205.76 207.75 0.00
2016-08-26 208.75 217.99 207.78 216.93 100.00
2016-08-29 217.00 217.46 213.05 213.57 0.00
2016-08-30 215.67 215.67 209.21 211.00 0.00