-
Notifications
You must be signed in to change notification settings - Fork 56
/
indicator.test.js
31 lines (25 loc) · 1.12 KB
/
indicator.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var Indicator = require('./indicator.js');
// //江苏银行
// describe('obv test', function(){
// console.log(Indicator.OBV([[11.94, 9300], [13.13, 3600], [14.44, 2000]]));
// });
// var testArray = [9.03, 9.93, 10.92, 12.01, 11.46, 12.19];
// describe('macd test', function(){
// console.log(Indicator.MACD(testArray));
// });
// testArray = [[9.03, 7.52, 9.03], [9.93, 9.93, 9.93], [10.92, 10.92, 10.92], [12.01, 11.20, 12.01], [11.80, 11.28, 11.46], [12.49, 11.38, 12.19]];
// describe('kdj test', function(){
// console.log(Indicator.KDJ(testArray));
// });
// testArray = [9.03, 9.93, 10.92, 12.01, 11.46, 12.19, 12.68, 12.39, 13.53, 14.36, 14.26, 13.71, 13.66, 13.24, 13.03, 13.14, 12.68, 12.37, 12.12, 12.18, 12.2, 12.38, 12.01, 11.81, 11.59];
// describe('boll test', function(){
// console.log(Indicator.BOLL(testArray));
// });
// testArray = [9.03, 9.03, 10.92, 12.01, 11.46, 12.19, 12.68];
// describe('rsi test', function(){
// console.log(Indicator.RSI(testArray));
// });
testArray = [9.03, 9.03, 10.92, 12.01, 11.46, 12.19, 12.68];
describe('ma test', function(){
console.log(Indicator.MA(testArray, 20));
});