traquer 0.7.0

technical analysis library
Documentation
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
use criterion::{black_box, criterion_group, criterion_main, Criterion};

use serde::{Deserialize, Serialize};
use std::fs;

use traquer::*;

#[derive(Deserialize, Serialize, Debug)]
struct SecStats {
    high: Vec<f64>,
    low: Vec<f64>,
    open: Vec<f64>,
    close: Vec<f64>,
    volume: Vec<f64>,
}

fn criterion_benchmark(c: &mut Criterion) {
    let data = fs::read_to_string("./benches/aapl.input").expect("Unable to read file");
    let stats: SecStats = serde_json::from_str(&data).expect("JSON does not have correct format.");
    c.bench_function("sig-trend-adx", |b| {
        b.iter(|| {
            black_box(
                trend::adx(&stats.high, &stats.low, &stats.close, 14, 14)
                    .collect::<Vec<(f64, f64, f64)>>(),
            )
        })
    });
    c.bench_function("sig-momentum-qstick", |b| {
        b.iter(|| black_box(momentum::qstick(&stats.open, &stats.close, 8).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-volume-twiggs", |b| {
        b.iter(|| {
            black_box(
                volume::twiggs(&stats.high, &stats.low, &stats.close, &stats.volume, 16)
                    .collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-momentum-rsi", |b| {
        b.iter(|| black_box(momentum::rsi(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-volume-kvo", |b| {
        b.iter(|| {
            black_box(
                volume::kvo(
                    &stats.high,
                    &stats.low,
                    &stats.close,
                    &stats.volume,
                    10,
                    16,
                    Some(false),
                )
                .collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-volume-kvo-alt", |b| {
        b.iter(|| {
            black_box(
                volume::kvo(
                    &stats.high,
                    &stats.low,
                    &stats.close,
                    &stats.volume,
                    10,
                    16,
                    Some(true),
                )
                .collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-momentum-macd", |b| {
        b.iter(|| black_box(momentum::macd(&stats.close, 12, 26).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-momentum-cmo", |b| {
        b.iter(|| black_box(momentum::cmo(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-momentum-cfo", |b| {
        b.iter(|| black_box(momentum::cfo(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-momentum-cog", |b| {
        b.iter(|| black_box(momentum::cog(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-trend-shinohara", |b| {
        b.iter(|| {
            black_box(
                trend::shinohara(&stats.high, &stats.low, &stats.close, 26)
                    .collect::<Vec<(f64, f64)>>(),
            )
        })
    });
    c.bench_function("sig-momentum-elder_ray", |b| {
        b.iter(|| {
            black_box(
                momentum::elder_ray(&stats.high, &stats.low, &stats.close, 16)
                    .collect::<Vec<(f64, f64)>>(),
            )
        })
    });

    c.bench_function("sig-volume-elder_force", |b| {
        b.iter(|| {
            black_box(volume::elder_force(&stats.close, &stats.volume, 16).collect::<Vec<f64>>())
        })
    });
    c.bench_function("sig-volume-mfi", |b| {
        b.iter(|| {
            black_box(
                volume::mfi(&stats.high, &stats.low, &stats.close, &stats.volume, 16)
                    .collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-volume-ad", |b| {
        b.iter(|| {
            black_box(
                volume::ad(&stats.high, &stats.low, &stats.close, &stats.volume, None)
                    .collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-volume-ad_yahoo", |b| {
        b.iter(|| {
            black_box(
                volume::ad(
                    &stats.high,
                    &stats.low,
                    &stats.close,
                    &stats.volume,
                    Some(true),
                )
                .collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-volume-cmf", |b| {
        b.iter(|| {
            black_box(
                volume::cmf(&stats.high, &stats.low, &stats.close, &stats.volume, 16)
                    .collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-momentum-wpr", |b| {
        b.iter(|| {
            black_box(
                momentum::wpr(&stats.high, &stats.low, &stats.close, 16).collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-trend-vortex", |b| {
        b.iter(|| {
            black_box(
                trend::vortex(&stats.high, &stats.low, &stats.close, 16)
                    .collect::<Vec<(f64, f64)>>(),
            )
        })
    });
    c.bench_function("sig-momentum-ppo", |b| {
        b.iter(|| black_box(momentum::ppo(&stats.volume, 10, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-momentum-apo", |b| {
        b.iter(|| black_box(momentum::apo(&stats.close, 10, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-momentum-pmo", |b| {
        b.iter(|| black_box(momentum::pmo(&stats.close, 10, 6).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-volatility-vhf", |b| {
        b.iter(|| {
            black_box(
                volatility::vhf(&stats.high, &stats.low, &stats.close, 16).collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-volatility-heikin_ashi", |b| {
        b.iter(|| {
            black_box(
                volatility::heikin_ashi(&stats.open, &stats.high, &stats.low, &stats.close)
                    .collect::<Vec<_>>(),
            )
        })
    });
    c.bench_function("sig-momentum-ultimate", |b| {
        b.iter(|| {
            black_box(
                momentum::ultimate(&stats.high, &stats.low, &stats.close, 6, 12, 24)
                    .collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-momentum-pgo", |b| {
        b.iter(|| {
            black_box(
                momentum::pgo(&stats.high, &stats.low, &stats.close, 16).collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-momentum-si", |b| {
        b.iter(|| {
            black_box(
                momentum::si(&stats.open, &stats.high, &stats.low, &stats.close, 0.5)
                    .collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-trend-asi", |b| {
        b.iter(|| {
            black_box(
                trend::asi(&stats.open, &stats.high, &stats.low, &stats.close, 0.5)
                    .collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-trend-ulcer", |b| {
        b.iter(|| black_box(trend::ulcer(&stats.close, 8).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-momentum-trix", |b| {
        b.iter(|| black_box(momentum::trix(&stats.close, 7).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-momentum-tii", |b| {
        b.iter(|| black_box(momentum::tii(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-volume-tvi", |b| {
        b.iter(|| black_box(volume::tvi(&stats.close, &stats.volume, 0.5).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-volume-vpt", |b| {
        b.iter(|| black_box(volume::vpt(&stats.close, &stats.volume).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-trend-supertrend", |b| {
        b.iter(|| {
            black_box(
                trend::supertrend(&stats.high, &stats.low, &stats.close, 16, 3.0)
                    .collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-momentum-stochastic", |b| {
        b.iter(|| {
            black_box(
                momentum::stochastic(&stats.high, &stats.low, &stats.close, 16)
                    .collect::<Vec<(f64, f64)>>(),
            )
        })
    });
    c.bench_function("sig-momentum-stc", |b| {
        b.iter(|| black_box(momentum::stc(&stats.close, 3, 6, 12).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-momentum-relative_vigor", |b| {
        b.iter(|| {
            black_box(
                momentum::relative_vigor(&stats.open, &stats.high, &stats.low, &stats.close, 16)
                    .collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-trend-rwi", |b| {
        b.iter(|| {
            black_box(
                trend::rwi(&stats.high, &stats.low, &stats.close, 16).collect::<Vec<(f64, f64)>>(),
            )
        })
    });
    c.bench_function("sig-trend-dpo", |b| {
        b.iter(|| black_box(trend::dpo(&stats.close, 16, None).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-momentum-fisher", |b| {
        b.iter(|| black_box(momentum::fisher(&stats.high, &stats.low, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-momentum-rainbow", |b| {
        b.iter(|| black_box(momentum::rainbow(&stats.close, 3, 16).collect::<Vec<(f64, f64)>>()))
    });
    c.bench_function("sig-momentum-coppock", |b| {
        b.iter(|| black_box(momentum::coppock(&stats.close, 10, 11, 14).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-momentum-psych", |b| {
        b.iter(|| black_box(momentum::psych(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-momentum-roc", |b| {
        b.iter(|| black_box(momentum::roc(&stats.low, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-momentum-bal_power", |b| {
        b.iter(|| {
            black_box(
                momentum::bal_power(&stats.open, &stats.high, &stats.low, &stats.close, 16)
                    .collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-momentum-disparity", |b| {
        b.iter(|| black_box(momentum::disparity(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-momentum-tsi", |b| {
        b.iter(|| black_box(momentum::tsi(&stats.close, 6, 10).collect::<Vec<_>>()))
    });
    c.bench_function("sig-momentum-special_k", |b| {
        b.iter(|| black_box(momentum::special_k(&stats.close).collect::<Vec<_>>()))
    });
    c.bench_function("sig-momentum-kst", |b| {
        b.iter(|| black_box(momentum::kst(&stats.close, None, None).collect::<Vec<_>>()))
    });
    c.bench_function("sig-momentum-derivative", |b| {
        b.iter(|| black_box(momentum::derivative(&stats.close, 6, 10, 3).collect::<Vec<_>>()))
    });
    c.bench_function("sig-momentum-cci", |b| {
        b.iter(|| {
            black_box(momentum::cci(&stats.high, &stats.low, &stats.close, 16).collect::<Vec<_>>())
        })
    });
    c.bench_function("sig-momentum-qqe", |b| {
        b.iter(|| black_box(momentum::qqe(&stats.close, 6, 3).collect::<Vec<_>>()))
    });
    c.bench_function("sig-momentum-deli", |b| {
        b.iter(|| black_box(momentum::deli(&stats.high, &stats.low, 16).collect::<Vec<_>>()))
    });
    c.bench_function("sig-momentum-gator", |b| {
        b.iter(|| black_box(momentum::gator(&stats.close, 13, 0, 8, 0, 5, 0).collect::<Vec<_>>()))
    });
    c.bench_function("sig-momentum-crsi", |b| {
        b.iter(|| black_box(momentum::crsi(&stats.close, 10, 6, 16).collect::<Vec<_>>()))
    });
    c.bench_function("sig-momentum-kdj", |b| {
        b.iter(|| {
            black_box(
                momentum::kdj(&stats.high, &stats.low, &stats.close, 16, 3, None, None)
                    .collect::<Vec<_>>(),
            )
        })
    });
    c.bench_function("sig-trend-aroon", |b| {
        b.iter(|| black_box(trend::aroon(&stats.high, &stats.low, 16).collect::<Vec<(f64, f64)>>()))
    });
    c.bench_function("sig-trend-psar", |b| {
        b.iter(|| black_box(trend::psar(&stats.high, &stats.low, None, None).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-trend-zigzag", |b| {
        b.iter(|| {
            black_box(trend::zigzag(&stats.high, &stats.low, Some(10.0)).collect::<Vec<f64>>())
        })
    });
    c.bench_function("sig-trend-chandelier", |b| {
        b.iter(|| {
            black_box(
                trend::chandelier(&stats.high, &stats.low, &stats.close, 16, None)
                    .collect::<Vec<(f64, f64)>>(),
            )
        })
    });
    c.bench_function("sig-trend-decay", |b| {
        b.iter(|| black_box(trend::decay(&stats.close, 6).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-trend-cks", |b| {
        b.iter(|| {
            black_box(
                trend::cks(&stats.high, &stats.low, &stats.close, 10, 6, None)
                    .collect::<Vec<(f64, f64)>>(),
            )
        })
    });
    c.bench_function("sig-trend-atr_stop", |b| {
        b.iter(|| {
            black_box(
                trend::atr_stop(&stats.high, &stats.low, &stats.close, 6, None)
                    .collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-trend-alligator", |b| {
        b.iter(|| black_box(trend::alligator(&stats.close, 13, 0, 8, 0, 5, 0).collect::<Vec<_>>()))
    });
    c.bench_function("sig-trend-ichimoku", |b| {
        b.iter(|| {
            black_box(
                trend::ichimoku(&stats.high, &stats.low, &stats.close, 5, 13, 26, 13)
                    .collect::<Vec<_>>(),
            )
        })
    });
    c.bench_function("sig-trend-hurst", |b| {
        b.iter(|| black_box(trend::hurst(&stats.close, 100, None).collect::<Vec<_>>()))
    });
    c.bench_function("sig-volume-bw_mfi", |b| {
        b.iter(|| {
            black_box(volume::bw_mfi(&stats.high, &stats.low, &stats.volume).collect::<Vec<f64>>())
        })
    });
    c.bench_function("sig-volume-ease", |b| {
        b.iter(|| {
            black_box(
                volume::ease(&stats.high, &stats.low, &stats.volume, 16).collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-volume-obv", |b| {
        b.iter(|| black_box(volume::obv(&stats.close, &stats.volume).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-volume-pvi", |b| {
        b.iter(|| black_box(volume::pvi(&stats.close, &stats.volume).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-volume-nvi", |b| {
        b.iter(|| black_box(volume::nvi(&stats.close, &stats.volume).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-volume-vwap", |b| {
        b.iter(|| {
            black_box(
                volume::vwap(
                    &stats.high,
                    &stats.low,
                    &stats.close,
                    &stats.volume,
                    Some(&[7, 15, 23, 31]),
                )
                .collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-volume-vwma", |b| {
        b.iter(|| black_box(volume::vwma(&stats.close, &stats.volume, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-volatility-mass", |b| {
        b.iter(|| black_box(volatility::mass(&stats.high, &stats.low, 9, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-volatility-keltner", |b| {
        b.iter(|| {
            black_box(
                volatility::keltner(&stats.high, &stats.low, &stats.close, 16)
                    .collect::<Vec<(f64, f64, f64)>>(),
            )
        })
    });
    c.bench_function("sig-volatility-gri", |b| {
        b.iter(|| black_box(volatility::gri(&stats.high, &stats.low, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-volatility-std_dev", |b| {
        b.iter(|| black_box(volatility::std_dev(&stats.close, 16, None).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-volatility-bbands", |b| {
        b.iter(|| {
            black_box(
                volatility::bbands(&stats.close, 16, None, None).collect::<Vec<(f64, f64, f64)>>(),
            )
        })
    });
    c.bench_function("sig-volatility-donchian", |b| {
        b.iter(|| {
            black_box(
                volatility::donchian(&stats.high, &stats.low, 16).collect::<Vec<(f64, f64, f64)>>(),
            )
        })
    });
    c.bench_function("sig-volatility-fbands", |b| {
        b.iter(|| {
            black_box(volatility::fbands(&stats.high, &stats.low).collect::<Vec<(f64, f64)>>())
        })
    });
    c.bench_function("sig-volatility-hv", |b| {
        b.iter(|| black_box(volatility::hv(&stats.close, 16, None).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-volatility-starc", |b| {
        b.iter(|| {
            black_box(
                volatility::starc(&stats.high, &stats.low, &stats.close, 16, 5, None)
                    .collect::<Vec<(f64, f64)>>(),
            )
        })
    });
    c.bench_function("sig-volatility-tr", |b| {
        b.iter(|| {
            black_box(volatility::tr(&stats.high, &stats.low, &stats.close).collect::<Vec<f64>>())
        })
    });
    c.bench_function("sig-volatility-atr", |b| {
        b.iter(|| {
            black_box(
                volatility::atr(&stats.high, &stats.low, &stats.close, 16).collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-volatility-typical", |b| {
        b.iter(|| {
            black_box(
                volatility::typical(&stats.high, &stats.low, &stats.close, 16)
                    .collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-volatility-cvi", |b| {
        b.iter(|| black_box(volatility::cvi(&stats.high, &stats.low, 16, 2).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-volatility-relative_vol", |b| {
        b.iter(|| black_box(volatility::relative_vol(&stats.close, 6, 10).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-volatility-inertia", |b| {
        b.iter(|| black_box(volatility::inertia(&stats.close, 6, 10).collect::<Vec<f64>>()))
    });
    c.bench_function("sig-volatility-chop", |b| {
        b.iter(|| {
            black_box(
                volatility::chop(&stats.high, &stats.low, &stats.close, 16).collect::<Vec<f64>>(),
            )
        })
    });
    c.bench_function("sig-volatility-wcp", |b| {
        b.iter(|| {
            black_box(volatility::wcp(&stats.high, &stats.low, &stats.close).collect::<Vec<f64>>())
        })
    });
    c.bench_function("sig-volatility-gkyz_hv", |b| {
        b.iter(|| {
            black_box(
                volatility::gkyz_hv(&stats.open, &stats.high, &stats.low, &stats.close, 16)
                    .collect::<Vec<_>>(),
            )
        })
    });
    c.bench_function("sig-volatility-cc_hv", |b| {
        b.iter(|| black_box(volatility::cc_hv(&stats.close, 16).collect::<Vec<_>>()))
    });

    c.bench_function("ma-ewma", |b| {
        b.iter(|| black_box(smooth::ewma(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-sma", |b| {
        b.iter(|| black_box(smooth::sma(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-dema", |b| {
        b.iter(|| black_box(smooth::dema(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-tema", |b| {
        b.iter(|| black_box(smooth::tema(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-wma", |b| {
        b.iter(|| black_box(smooth::wma(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-wilder", |b| {
        b.iter(|| black_box(smooth::wilder(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-hull", |b| {
        b.iter(|| black_box(smooth::hull(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-vidya", |b| {
        b.iter(|| black_box(smooth::vidya(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-vma", |b| {
        b.iter(|| black_box(smooth::vma(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-lrf", |b| {
        b.iter(|| black_box(smooth::lrf(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-trima", |b| {
        b.iter(|| black_box(smooth::trima(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-zlma", |b| {
        b.iter(|| black_box(smooth::zlma(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-pwma", |b| {
        b.iter(|| black_box(smooth::pwma(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-kernel", |b| {
        b.iter(|| black_box(smooth::kernel(&stats.close, 16.0).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-kama", |b| {
        b.iter(|| black_box(smooth::kama(&stats.close, 10, None, None).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-alma", |b| {
        b.iter(|| black_box(smooth::alma(&stats.close, 10, 6.0, None).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-mdma", |b| {
        b.iter(|| black_box(smooth::mdma(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-hwma", |b| {
        b.iter(|| black_box(smooth::hwma(&stats.close, None, None, None).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-fwma", |b| {
        b.iter(|| black_box(smooth::fwma(&stats.close, 16).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-ssf", |b| {
        b.iter(|| black_box(smooth::ssf(&stats.close, 16, None).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-mama", |b| {
        b.iter(|| black_box(smooth::mama(&stats.close, None, None).collect::<Vec<(f64, f64)>>()))
    });
    c.bench_function("ma-t3", |b| {
        b.iter(|| black_box(smooth::t3(&stats.close, 6, None).collect::<Vec<f64>>()))
    });
    c.bench_function("ma-frama", |b| {
        b.iter(|| {
            black_box(
                smooth::frama(&stats.close, 16)
                    .unwrap()
                    .collect::<Vec<f64>>(),
            )
        })
    });

    c.bench_function("correlation-pcc", |b| {
        b.iter(|| black_box(correlation::pcc(&stats.open, &stats.close, 16).collect::<Vec<_>>()))
    });
    c.bench_function("correlation-rsq", |b| {
        b.iter(|| black_box(correlation::rsq(&stats.open, &stats.close, 16).collect::<Vec<_>>()))
    });
    c.bench_function("correlation-beta", |b| {
        b.iter(|| black_box(correlation::beta(&stats.open, &stats.close, 16).collect::<Vec<_>>()))
    });
    c.bench_function("correlation-rsc", |b| {
        b.iter(|| black_box(correlation::rsc(&stats.open, &stats.close).collect::<Vec<_>>()))
    });
    c.bench_function("correlation-perf", |b| {
        b.iter(|| black_box(correlation::perf(&stats.open, &stats.close, 16).collect::<Vec<_>>()))
    });
    c.bench_function("correlation-srcc", |b| {
        b.iter(|| black_box(correlation::srcc(&stats.open, &stats.close, 16).collect::<Vec<_>>()))
    });
    c.bench_function("correlation-krcc", |b| {
        b.iter(|| black_box(correlation::krcc(&stats.open, &stats.close, 16).collect::<Vec<_>>()))
    });
    c.bench_function("correlation-hoeffd", |b| {
        b.iter(|| black_box(correlation::hoeffd(&stats.open, &stats.close, 16).collect::<Vec<_>>()))
    });
    c.bench_function("correlation-dcor", |b| {
        b.iter(|| black_box(correlation::dcor(&stats.open, &stats.close, 16).collect::<Vec<_>>()))
    });
    c.bench_function("correlation-mic", |b| {
        b.iter(|| black_box(correlation::mic(&stats.open, &stats.close, 16).collect::<Vec<_>>()))
    });

    c.bench_function("stats-dist-variance", |b| {
        b.iter(|| {
            black_box(statistic::distribution::variance(&stats.close, 16).collect::<Vec<_>>())
        })
    });
    c.bench_function("stats-dist-std_dev", |b| {
        b.iter(|| black_box(statistic::distribution::std_dev(&stats.close, 16).collect::<Vec<_>>()))
    });
    c.bench_function("stats-dist-zscore", |b| {
        b.iter(|| black_box(statistic::distribution::zscore(&stats.close, 16).collect::<Vec<_>>()))
    });

    c.bench_function("stats-dist-mad", |b| {
        b.iter(|| black_box(statistic::distribution::mad(&stats.close, 16).collect::<Vec<_>>()))
    });
    c.bench_function("stats-dist-cv", |b| {
        b.iter(|| black_box(statistic::distribution::cv(&stats.close, 16).collect::<Vec<_>>()))
    });
    c.bench_function("stats-dist-kurtosis", |b| {
        b.iter(|| {
            black_box(statistic::distribution::kurtosis(&stats.close, 16).collect::<Vec<_>>())
        })
    });
    c.bench_function("stats-dist-skew", |b| {
        b.iter(|| black_box(statistic::distribution::skew(&stats.close, 16).collect::<Vec<_>>()))
    });
    c.bench_function("stats-dist-median", |b| {
        b.iter(|| black_box(statistic::distribution::median(&stats.close, 16).collect::<Vec<_>>()))
    });
    c.bench_function("stats-dist-quantile", |b| {
        b.iter(|| {
            black_box(statistic::distribution::quantile(&stats.close, 16, 90.0).collect::<Vec<_>>())
        })
    });
    c.bench_function("stats-dist-rank", |b| {
        b.iter(|| {
            black_box(
                statistic::distribution::rank(
                    &stats.close,
                    Some(statistic::distribution::RankMode::Min),
                )
                .collect::<Vec<_>>(),
            )
        })
    });
    c.bench_function("stats-dist-approx_entropy", |b| {
        b.iter(|| {
            black_box(
                statistic::distribution::approx_entropy(&stats.close, 16, None, None)
                    .collect::<Vec<_>>(),
            )
        })
    });
    c.bench_function("stats-dist-sample_entropy", |b| {
        b.iter(|| {
            black_box(
                statistic::distribution::sample_entropy(&stats.close, 16, None, None)
                    .collect::<Vec<_>>(),
            )
        })
    });

    c.bench_function("stats-regress-mse", |b| {
        b.iter(|| {
            black_box(statistic::regression::mse(&stats.close, &stats.open).collect::<Vec<_>>())
        })
    });
    c.bench_function("stats-regress-rmse", |b| {
        b.iter(|| {
            black_box(statistic::regression::rmse(&stats.close, &stats.open).collect::<Vec<_>>())
        })
    });
    c.bench_function("stats-regress-mae", |b| {
        b.iter(|| {
            black_box(statistic::regression::mae(&stats.close, &stats.open).collect::<Vec<_>>())
        })
    });
    c.bench_function("stats-regress-mape", |b| {
        b.iter(|| {
            black_box(statistic::regression::mape(&stats.close, &stats.open).collect::<Vec<_>>())
        })
    });
    c.bench_function("stats-regress-smape", |b| {
        b.iter(|| {
            black_box(statistic::regression::smape(&stats.close, &stats.open).collect::<Vec<_>>())
        })
    });
    c.bench_function("stats-regress-mda", |b| {
        b.iter(|| {
            black_box(statistic::regression::mda(&stats.close, &stats.open).collect::<Vec<_>>())
        })
    });
    c.bench_function("stats-regress-mase", |b| {
        b.iter(|| {
            black_box(statistic::regression::mase(&stats.close, &stats.open).collect::<Vec<_>>())
        })
    });
    c.bench_function("stats-regress-emae", |b| {
        b.iter(|| {
            black_box(statistic::regression::emae(&stats.close, &stats.open).collect::<Vec<_>>())
        })
    });
}

criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);

//#[divan::bench]
//fn run() {
//    divan::black_box(traquer::main());
//}
//
//fn main() {
//    divan::main();
//}