Mariner Backtesting - TA-LIB Homing Pigeon

CDLHOMINGPIGEON

 

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

Candlestick Plot

Homing Pigeon

 

Working Example

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

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

Console

GOOG:  2014-03-28 09:30:00.000000
CDLHOMINGPIGEON: GOOG
Input Output
date open high low close integer
2013-11-01 1031.79 1036.00 1025.10 1027.04 0.00
2013-11-04 1031.50 1032.37 1022.03 1026.00 0.00
2013-11-05 1020.35 1031.65 1017.42 1021.52 0.00
2013-11-06 1025.60 1027.00 1015.37 1022.75 0.00
2013-11-07 1022.61 1023.93 1007.64 1007.95 0.00
2013-11-08 1008.75 1018.50 1008.50 1016.03 0.00
2013-11-11 1009.51 1015.93 1008.00 1010.59 0.00
2013-11-12 1007.70 1017.56 1005.00 1011.78 0.00
2013-11-13 1006.75 1032.85 1006.50 1032.47 0.00
2013-11-14 1033.92 1039.75 1030.35 1035.23 0.00
2013-11-15 1034.87 1038.00 1030.31 1033.56 0.00
2013-11-18 1035.75 1048.74 1029.24 1031.55 0.00
2013-11-19 1031.72 1034.75 1023.05 1025.13 0.00
2013-11-20 1029.95 1033.36 1020.36 1022.31 0.00
2013-11-21 1027.00 1038.31 1026.00 1034.07 0.00
2013-11-22 1033.42 1036.17 1029.22 1031.89 0.00
2013-11-25 1037.16 1053.19 1035.02 1045.93 0.00
2013-11-26 1048.60 1061.50 1042.94 1058.41 0.00
2013-11-27 1062.03 1068.00 1060.00 1063.11 0.00
2013-11-29 1062.16 1066.62 1059.45 1059.59 0.00
2013-12-02 1063.51 1066.35 1050.76 1054.48 0.00
2013-12-03 1050.95 1063.44 1049.02 1053.26 0.00
2013-12-04 1051.37 1063.98 1050.00 1058.18 0.00
2013-12-05 1057.20 1059.66 1051.09 1057.34 0.00
2013-12-06 1069.79 1070.00 1060.08 1069.87 0.00
2013-12-09 1070.99 1082.31 1068.02 1078.14 0.00
2013-12-10 1076.15 1092.31 1075.65 1084.66 0.00
2013-12-11 1087.40 1091.32 1075.17 1077.29 0.00
2013-12-12 1079.57 1082.94 1069.00 1069.96 0.00
2013-12-13 1075.40 1076.29 1057.89 1060.79 0.00
2013-12-16 1064.00 1074.69 1062.01 1072.98 0.00
2013-12-17 1072.82 1080.76 1068.38 1069.86 0.00
2013-12-18 1071.85 1084.95 1059.04 1084.75 0.00
2013-12-19 1080.77 1091.99 1079.08 1086.22 0.00
2013-12-20 1088.30 1101.17 1088.00 1100.64 0.00
2013-12-23 1107.84 1115.80 1105.12 1115.10 0.00
2013-12-24 1114.97 1115.24 1108.10 1111.84 0.00
2013-12-26 1114.01 1119.00 1108.69 1117.46 0.00
2013-12-27 1120.00 1120.28 1112.94 1118.40 0.00
2013-12-30 1120.34 1120.50 1109.02 1109.46 0.00
2013-12-31 1112.24 1121.00 1106.26 1120.71 0.00
2014-01-02 1115.46 1117.75 1108.26 1113.12 0.00
2014-01-03 1115.00 1116.93 1104.93 1105.00 0.00
2014-01-06 1113.01 1118.86 1106.44 1117.32 0.00
2014-01-07 1125.00 1139.69 1121.16 1138.56 0.00
2014-01-08 1146.00 1147.32 1133.29 1141.23 0.00
2014-01-09 1143.44 1144.22 1125.56 1130.24 0.00
2014-01-10 1139.08 1139.08 1122.25 1130.18 0.00
2014-01-13 1126.47 1146.91 1117.17 1122.98 0.00
2014-01-14 1137.95 1151.00 1128.09 1149.40 0.00
2014-01-15 1152.99 1155.00 1143.79 1148.62 0.00
2014-01-16 1149.10 1157.93 1148.00 1156.22 0.00
2014-01-17 1156.85 1160.63 1144.20 1150.53 0.00
2014-01-21 1160.93 1164.00 1151.30 1163.70 0.00
2014-01-22 1166.61 1167.89 1158.86 1165.02 0.00
2014-01-23 1160.00 1162.49 1154.37 1160.10 0.00
2014-01-24 1151.01 1153.55 1123.00 1123.21 0.00
2014-01-27 1126.10 1126.50 1082.27 1101.23 0.00
2014-01-28 1110.32 1125.75 1109.94 1123.01 0.00
2014-01-29 1119.12 1121.75 1099.42 1106.92 0.00
2014-01-30 1145.00 1152.49 1127.25 1133.51 0.00
2014-01-31 1171.35 1186.54 1151.13 1180.97 0.00
2014-02-03 1179.20 1181.72 1132.01 1133.43 0.00
2014-02-04 1137.99 1155.00 1137.01 1138.16 0.00
2014-02-05 1143.38 1150.77 1128.02 1143.20 0.00
2014-02-06 1151.13 1160.16 1147.55 1159.96 0.00
2014-02-07 1167.63 1177.90 1160.56 1177.44 0.00
2014-02-10 1171.80 1182.40 1169.02 1172.93 0.00
2014-02-11 1180.17 1191.87 1172.21 1190.18 0.00
2014-02-12 1189.00 1190.00 1181.38 1186.69 0.00
2014-02-13 1180.75 1199.90 1179.66 1199.90 0.00
2014-02-14 1195.61 1204.39 1192.80 1202.80 0.00
2014-02-18 1201.41 1212.87 1200.00 1210.88 0.00
2014-02-19 1205.30 1209.22 1197.50 1202.83 0.00
2014-02-20 1203.14 1206.89 1200.22 1204.11 0.00
2014-02-21 1207.81 1209.87 1202.83 1203.79 0.00
2014-02-24 1205.36 1220.16 1205.10 1212.51 0.00
2014-02-25 1215.94 1224.50 1210.42 1220.00 0.00
2014-02-26 1224.00 1228.88 1213.76 1220.17 0.00
2014-02-27 1218.39 1224.23 1217.01 1219.21 0.00
2014-02-28 1220.34 1224.19 1206.22 1215.65 0.00
2014-03-03 1206.75 1207.84 1192.14 1202.69 0.00
2014-03-04 1215.00 1216.00 1209.50 1214.91 0.00
2014-03-05 1215.05 1223.08 1211.41 1218.26 0.00
2014-03-06 1222.28 1226.15 1218.60 1219.61 0.00
2014-03-07 1226.80 1226.99 1211.44 1214.79 0.00
2014-03-10 1215.69 1217.64 1204.09 1211.57 0.00
2014-03-11 1213.77 1214.32 1196.64 1199.99 0.00
2014-03-12 1196.40 1207.85 1184.19 1207.30 0.00
2014-03-13 1207.95 1210.50 1184.76 1189.06 0.00
2014-03-14 1181.99 1190.87 1172.53 1172.80 0.00
2014-03-17 1179.25 1197.07 1178.11 1192.10 0.00
2014-03-18 1194.67 1211.53 1193.06 1211.46 0.00
2014-03-19 1211.80 1211.99 1194.66 1199.25 0.00
2014-03-20 1199.95 1209.61 1195.36 1197.16 0.00
2014-03-21 1206.31 1209.63 1182.45 1183.04 0.00
2014-03-24 1184.19 1184.89 1145.95 1157.93 0.00
2014-03-25 1166.00 1169.84 1147.00 1158.72 100.00
2014-03-26 1162.01 1171.57 1131.50 1131.97 0.00
2014-03-27 1130.85 1131.94 1102.10 1114.28 0.00