-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathstochslow_test.go
19 lines (15 loc) · 1010 Bytes
/
stochslow_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package tart
import (
"testing"
)
func TestStochSlow(t *testing.T) {
k, d := StochSlowArr(testHigh, testLow, testClose, 5, SMA, 3, SMA, 3)
compare(t, "result, d = talib.STOCH(testHigh, testLow, testClose, 5, 3, talib.MA_Type.SMA, 3, talib.MA_Type.SMA)", k)
compare(t, "k, result = talib.STOCH(testHigh, testLow, testClose, 5, 3, talib.MA_Type.SMA, 3, talib.MA_Type.SMA)", d)
k, d = StochSlowArr(testHigh, testLow, testClose, 12, SMA, 3, SMA, 3)
compare(t, "result, d = talib.STOCH(testHigh, testLow, testClose, 12, 3, talib.MA_Type.SMA, 3, talib.MA_Type.SMA)", k)
compare(t, "k, result = talib.STOCH(testHigh, testLow, testClose, 12, 3, talib.MA_Type.SMA, 3, talib.MA_Type.SMA)", d)
k, d = StochSlowArr(testHigh, testLow, testClose, 12, SMA, 3, SMA, 15)
compare(t, "result, d = talib.STOCH(testHigh, testLow, testClose, 12, 3, talib.MA_Type.SMA, 15, talib.MA_Type.SMA)", k)
compare(t, "k, result = talib.STOCH(testHigh, testLow, testClose, 12, 3, talib.MA_Type.SMA, 15, talib.MA_Type.SMA)", d)
}