Example #1
0
"""

import unittest
from coverage.stream import testindicator, tBar
from market.pattern.generics import *
    

#----------------------------------------------------------------------
gap_up_test = testindicator(__name__, "gap_up_test",
#----------------------------------------------------------------------
Recognizer, (
    ((tBar(96.00, 97.45, 94.00, 96.19, 715897),),     (False,)),
    ((tBar(97.21, 101.22, 97.20, 101.00, 129762),),   (False,)),
    ((tBar(101.97, 104.30, 101.51, 103.46, 311210),), (True,)),
    ((tBar(97.00, 97.00, 93.07, 96.00, 95891),),      (False,)),
    ((tBar(95.34, 97.52, 92.02, 97.25, 242829),),     (False,)),
    ((tBar(97.77, 99.50, 97.77, 97.85, 321915),),     (True,)),
    ((tBar(98.60, 99.50, 96.00, 97.05, 210585),),     (False,)),
    ((tBar(95.09, 96.32, 91.22, 96.00, 50564),),      (False,)),
    ((tBar(94.60, 95.30, 94.13, 95.20, 80697),),      (False,)),
    ((tBar(95.52, 96.82, 95.51, 96.00, 198607),),     (True,)),
    ((tBar(96.59, 98.50, 94.69, 97.51, 88992),),      (False,)),
    ((tBar(98.95, 99.00, 96.61, 97.51, 22776),),      (False,)),
), pattern=gap_up)


#----------------------------------------------------------------------
gap_down_test = testindicator(__name__, "gap_down_test",
#----------------------------------------------------------------------
Recognizer, (
    ((tBar(12.00, 12.00, 11.70, 11.70, 6600),),   (False,)),
    ((tBar(11.70, 12.87, 9.30, 11.60, 65200),),   (False,)),
Example #2
0
import unittest
from coverage.stream import testindicator
from market.stream.filters import *


#----------------------------------------------------------------------
Grather_Test = testindicator(__name__, "Grather_Test",
#----------------------------------------------------------------------
Grather, (
    ((-51.56,), (None,)),
    ((-12.21,), (None,)),
    ((-0.934,), (None,)),
    ((5.9234,), (5.9234,)),
    ((4.9043,), (4.9043,)),
    ((1.5543,), (1.5543,)),
    ((-7.707,), (None,)),
    ((-3.457,), (None,)),
    ((8.9776,), (8.9776,)),
    ((-7.165,), (None,)),
    ((6.1763,), (6.1763,)),
    ((0,),      (None,)),
    ((3.0776,), (3.0776,)),
    ((-24.21,), (None,)),
    ((-46.19,), (None,)),
), base=0)


#----------------------------------------------------------------------
GratherEqual_Test = testindicator(__name__, "GratherEqual_Test",
#----------------------------------------------------------------------
GratherEqual, (
Example #3
0
Min_Test = testindicator(__name__, "Min_Test",
#----------------------------------------------------------------------
Min, (
    ((51.56,), (None,)),	
    ((50.21,), (None,)),	
    ((47.93,), (None,)),	
    ((45.92,), (None,)),	
    ((44.90,), (None,)),
    ((41.55,), (None,)),	
    ((37.70,), (None,)),
    ((33.45,), (None,)),	
    ((38.97,), (None,)),	
    ((37.13,), (33.45,)),
    ((36.13,), (33.45,)),
    ((40.91,), (33.45,)),
    ((43.07,), (33.45,)),
    ((44.21,), (33.45,)),
    ((46.19,), (33.45,)),
    ((48.46,), (33.45,)),
    ((50.85,), (33.45,)),
    ((47.52,), (36.13,)),
    ((46.29,), (36.13,)),
    ((44.49,), (36.13,)),
    ((47.05,), (40.91,)),
    ((48.24,), (43.07,)),
    ((47.64,), (44.21,)),
    ((53.55,), (44.49,)),
    ((53.35,), (44.49,)),
    ((54.80,), (44.49,)),
    ((54.11,), (44.49,)),
    ((53.31,), (44.49,)),
    ((55.71,), (44.49,)),
    ((55.26,), (47.05,)),
), period=10)
Example #4
0
# ----------------------------------------------------------------------
Chain_Test = testindicator(
    __name__,
    "Chain_Test",
    # ----------------------------------------------------------------------
    Chain,
    (
        ((58.90,), (None,)),
        ((51.53,), (58.90,)),
        ((50.23,), (55.95,)),
        ((56.43,), (54.77,)),
        ((64.48,), (58.65,)),
        ((51.82,), (58.65,)),
        ((36.13,), (55.92,)),
        ((47.64,), (48.00,)),
        ((57.88,), (51.87,)),
        ((52.50,), (52.12,)),
        ((53.62,), (52.72,)),
        ((61.95,), (56.41,)),
        ((77.86,), (64.99,)),
        ((71.11,), (67.44,)),
        ((81.03,), (72.88,)),
        ((95.18,), (81.80,)),
        ((96.38,), (87.63,)),
        ((121.58,), (101.21,)),
        ((138.58,), (116.16,)),
    ),
    EMA(4),
    Max(2),
)
Example #5
0
from coverage.stream import testindicator, tBar
from market.pattern.candles import *


#----------------------------------------------------------------------
doji_test = testindicator(__name__, "doji_test",
#----------------------------------------------------------------------
Recognizer, (
    ((tBar(12.00, 12.00, 11.70, 11.70, 6600),),   (False,)),
    ((tBar(11.70, 12.87, 9.30, 11.60, 65200),),   (False,)),
    ((tBar(11.50, 11.70, 11.30, 11.50, 2600),),   (True,)),
    ((tBar(11.06, 11.20, 11.06, 11.20, 2800),),   (False,)),
    ((tBar(10.89, 10.89, 10.89, 10.89, 800),),    (False,)),
    ((tBar(11.01, 11.10, 10.00, 11.01, 900),),    (True,)),
    ((tBar(11.79, 11.79, 11.79, 11.79, 100),),    (False,)),
    ((tBar(11.39, 11.39, 11.26, 11.26, 400),),    (False,)),
    ((tBar(12.10, 12.10, 10.31, 10.55, 251800),), (False,)),
    ((tBar(17.00, 17.75, 17.00, 17.00, 10100),),  (False,)),
    ((tBar(16.20, 16.45, 16.00, 16.20, 3300),),   (True,)),
    ((tBar(16.00, 17.00, 15.80, 16.99, 9800),),   (False,)),
    ((tBar(15.80, 15.80, 15.80, 15.80, 6400),),   (False,)),
    ((tBar(17.99, 18.00, 17.50, 17.99, 100),),    (True,)),
    ((tBar(14.83, 15.06, 14.80, 15.00, 14500),),  (False,)),
    ((tBar(14.50, 14.50, 14.50, 14.50, 200),),    (False,)),
    ((tBar(14.75, 14.75, 14.75, 14.75, 300),),    (False,)),
), pattern=doji)   


#----------------------------------------------------------------------
white_marubozu_test = testindicator(__name__, "white_marubozu_test",
#----------------------------------------------------------------------
Example #6
0
from market.stream.averages import *


#----------------------------------------------------------------------
EMA_Test = testindicator(__name__, "EMA_Test",
#----------------------------------------------------------------------
EMA, (
    ((58.90,), (58.90,)),
    ((51.53,), (55.95,)),
    ((50.23,), (53.66,)),
    ((56.43,), (54.77,)),
    ((64.48,), (58.65,)),
    ((51.82,), (55.92,)),
    ((36.13,), (48.00,)),
    ((47.64,), (47.86,)),
    ((57.88,), (51.87,)),
    ((52.50,), (52.12,)),
    ((53.62,), (52.72,)),
    ((61.95,), (56.41,)),
    ((77.86,), (64.99,)),
    ((71.11,), (67.44,)),
    ((81.03,), (72.88,)),
    ((95.18,), (81.80,)),
    ((96.38,), (87.63,)),
    ((121.58,), (101.21,)),
    ((138.58,), (116.16,)),
), period=4)


#----------------------------------------------------------------------
OWMA_Test = testindicator(__name__, "OWMA_Test",