Skip to content

Commit

Permalink
adding a test for CDL3BLACKCROWS
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Nov 9, 2015
1 parent 6a1be2c commit de742b9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions talib/test_func.py
Expand Up @@ -98,3 +98,12 @@ def test_EMAEMA():
i = np.where(~np.isnan(result))[0][0]
assert_true(len(series) == len(result))
assert_equals(i, 2)

def test_CDL3BLACKCROWS():
o = np.array([39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 40.32, 40.51, 38.09, 35.00, 27.66, 30.80])
h = np.array([40.84, 40.84, 40.84, 40.84, 40.84, 40.84, 40.84, 40.84, 40.84, 40.84, 40.84, 40.84, 40.84, 40.84, 41.69, 40.84, 38.12, 35.50, 31.74, 32.51])
l = np.array([35.80, 35.80, 35.80, 35.80, 35.80, 35.80, 35.80, 35.80, 35.80, 35.80, 35.80, 35.80, 35.80, 35.80, 39.26, 36.73, 33.37, 30.03, 27.03, 28.31])
c = np.array([40.29, 40.29, 40.29, 40.29, 40.29, 40.29, 40.29, 40.29, 40.29, 40.29, 40.29, 40.29, 40.29, 40.29, 40.46, 37.08, 33.37, 30.03, 31.46, 28.31])

result = func.CDL3BLACKCROWS(o, h, l, c)
assert_np_arrays_equal(result, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -100, 0, 0])

0 comments on commit de742b9

Please sign in to comment.