Mariner Backtesting - TA-LIB Up/Down-gap side-by-side white lines

CDLGAPSIDESIDEWHITE

 

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

Candlestick Plot

Up/Down-gap side-by-side white lines

 

Working Example

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

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

Console

GOOG:  2016-06-17 09:30:00.000000
CDLGAPSIDESIDEWHITE: GOOG
Input Output
date open high low close integer
2016-01-26 713.85 718.28 706.48 713.04 0.00
2016-01-27 713.67 718.23 694.39 699.99 0.00
2016-01-28 722.22 733.69 712.35 730.96 0.00
2016-01-29 731.53 744.99 726.80 742.95 0.00
2016-02-01 750.46 757.86 743.27 752.00 0.00
2016-02-02 784.50 789.87 764.65 764.65 0.00
2016-02-03 770.22 774.50 720.50 726.95 0.00
2016-02-04 722.81 727.00 701.86 708.01 0.00
2016-02-05 703.87 703.99 680.15 683.57 0.00
2016-02-08 667.85 684.03 663.06 682.74 0.00
2016-02-09 672.32 699.90 668.77 678.11 0.00
2016-02-10 686.86 701.31 682.13 684.12 0.00
2016-02-11 675.00 689.35 668.87 683.11 0.00
2016-02-12 690.26 693.75 678.60 682.40 0.00
2016-02-16 692.98 698.00 685.05 691.00 0.00
2016-02-17 699.00 709.75 691.38 708.40 0.00
2016-02-18 710.00 712.35 696.03 697.35 0.00
2016-02-19 695.03 703.08 694.05 700.91 0.00
2016-02-22 707.45 713.24 702.51 706.46 0.00
2016-02-23 701.45 708.40 693.58 695.85 0.00
2016-02-24 688.92 700.00 680.78 699.56 0.00
2016-02-25 700.01 705.98 690.59 705.75 0.00
2016-02-26 708.58 713.43 700.86 705.07 0.00
2016-02-29 700.32 710.89 697.68 697.77 0.00
2016-03-01 703.62 718.81 699.77 718.81 0.00
2016-03-02 719.00 720.00 712.00 718.85 0.00
2016-03-03 718.68 719.45 706.02 712.42 0.00
2016-03-04 714.99 716.49 706.02 710.89 0.00
2016-03-07 706.90 708.09 686.90 695.16 0.00
2016-03-08 688.59 703.79 685.34 693.97 0.00
2016-03-09 698.47 705.68 694.00 705.24 0.00
2016-03-10 708.12 716.44 703.36 712.82 0.00
2016-03-11 720.00 726.92 717.12 726.82 0.00
2016-03-14 726.81 735.50 725.15 730.49 0.00
2016-03-15 726.92 732.29 724.77 728.33 0.00
2016-03-16 726.37 737.47 724.51 736.09 0.00
2016-03-17 736.45 743.07 736.00 737.78 0.00
2016-03-18 741.86 742.00 731.83 737.60 0.00
2016-03-21 736.50 742.50 733.52 742.09 0.00
2016-03-22 737.46 745.00 737.46 740.75 0.00
2016-03-23 742.36 745.72 736.15 738.06 0.00
2016-03-24 732.01 737.75 731.00 735.30 0.00
2016-03-28 736.79 738.99 732.50 733.53 0.00
2016-03-29 734.59 747.25 728.76 744.77 0.00
2016-03-30 750.10 757.88 748.74 750.53 0.00
2016-03-31 749.25 750.85 740.94 744.95 0.00
2016-04-01 738.60 750.34 737.00 749.91 0.00
2016-04-04 750.06 752.80 742.43 745.29 0.00
2016-04-05 738.00 742.80 735.37 737.80 0.00
2016-04-06 735.77 746.24 735.56 745.69 0.00
2016-04-07 745.37 747.00 736.28 740.28 0.00
2016-04-08 743.97 745.45 735.55 739.15 0.00
2016-04-11 743.02 745.00 736.05 736.10 0.00
2016-04-12 738.00 743.83 731.01 743.09 0.00
2016-04-13 749.16 754.38 744.26 751.72 0.00
2016-04-14 754.01 757.31 752.71 753.20 0.00
2016-04-15 753.98 761.00 752.69 759.00 0.00
2016-04-18 760.46 768.05 757.30 766.61 0.00
2016-04-19 769.51 769.90 749.33 753.93 0.00
2016-04-20 758.00 758.13 750.01 752.67 0.00
2016-04-21 755.38 760.45 749.55 759.14 0.00
2016-04-22 726.30 736.12 713.61 718.77 0.00
2016-04-25 716.10 723.93 715.59 723.15 0.00
2016-04-26 725.42 725.77 703.03 708.14 0.00
2016-04-27 707.29 708.98 692.37 705.84 0.00
2016-04-28 708.26 714.17 689.55 691.02 0.00
2016-04-29 690.70 697.62 689.00 693.01 0.00
2016-05-02 697.63 700.64 691.00 698.21 0.00
2016-05-03 696.87 697.84 692.00 692.36 0.00
2016-05-04 690.49 699.75 689.01 695.70 0.00
2016-05-05 697.70 702.32 695.72 701.43 0.00
2016-05-06 698.38 711.86 698.11 711.12 0.00
2016-05-09 712.00 718.71 710.00 712.90 0.00
2016-05-10 716.75 723.50 715.72 723.18 0.00
2016-05-11 723.41 724.48 712.80 715.29 0.00
2016-05-12 717.06 719.25 709.00 713.31 0.00
2016-05-13 711.93 716.66 709.26 710.83 0.00
2016-05-16 709.13 718.48 705.65 716.49 0.00
2016-05-17 715.99 721.52 704.11 706.23 0.00
2016-05-18 703.67 711.60 700.63 706.63 0.00
2016-05-19 702.36 706.00 696.80 700.32 0.00
2016-05-20 701.62 714.58 700.52 709.74 0.00
2016-05-23 706.53 711.48 704.18 704.24 0.00
2016-05-24 706.86 720.97 706.86 720.09 0.00
2016-05-25 720.76 727.51 719.70 725.27 0.00
2016-05-26 722.87 728.33 720.28 724.12 0.00
2016-05-27 724.01 733.94 724.00 732.66 0.00
2016-05-31 731.74 739.73 731.26 735.72 0.00
2016-06-01 734.53 737.21 730.66 734.15 0.00
2016-06-02 732.50 733.02 724.17 730.40 0.00
2016-06-03 729.27 729.49 720.56 722.34 0.00
2016-06-06 724.91 724.91 714.61 716.55 0.00
2016-06-07 719.84 721.98 716.55 716.65 0.00
2016-06-08 723.96 728.57 720.58 728.28 0.00
2016-06-09 722.87 729.54 722.34 728.58 0.00
2016-06-10 719.47 725.89 716.43 719.41 0.00
2016-06-13 716.51 725.44 716.51 718.36 0.00
2016-06-14 716.48 722.47 713.12 718.27 -100.00
2016-06-15 719.00 722.98 717.31 718.92 0.00
2016-06-16 714.91 716.65 703.26 710.36 0.00