karlwancl / Trady

Trady is a handy library for computing technical indicators, and it targets to be an automated trading system that provides stock data feeding, indicator computing, strategy building and automatic trading. It is built based on .NET Standard 2.0.
https://lppkarl.github.io/Trady
Apache License 2.0
545 stars 185 forks source link

Ichimoku indicator returns too many null values #78

Closed codebeaulieu closed 5 years ago

codebeaulieu commented 5 years ago

I've just attempted to integrate Ichimoku into a big project. I wrote all of the rules I needed and began writing unit tests against the indicator. My very first, and very simple unit test is failing.

Upon further inspection, its failing because there are a ton of null values returned from the indicator rendering it completely unusable.

screen shot 2018-12-22 at 5 42 23 pm

This is my dataset:

DateTime,Open,High,Low,Close,Volume
12/17/18 4:05:00 AM -06:00,267.48,267.48,267.48,267.48,172
12/17/18 4:25:00 AM -06:00,267.47,267.47,267.47,267.47,248
12/17/18 4:28:00 AM -06:00,267.67,267.67,267.67,267.67,100
12/17/18 4:58:00 AM -06:00,267.61,267.61,267.61,267.61,100
12/17/18 5:21:00 AM -06:00,267.61,267.61,267.61,267.61,178
12/17/18 5:42:00 AM -06:00,267.51,267.51,267.51,267.51,100
12/17/18 5:44:00 AM -06:00,267.22,267.22,267.22,267.22,300
12/17/18 6:26:00 AM -06:00,266.49,266.49,266.49,266.49,150
12/17/18 6:51:00 AM -06:00,267,267,267,267,100
12/17/18 7:06:00 AM -06:00,267,267,267,267,100
12/17/18 7:08:00 AM -06:00,267.1,267.34,267.1,267.34,579
12/17/18 7:09:00 AM -06:00,268,268,268,268,500
12/17/18 7:10:00 AM -06:00,267.9,267.9,267.9,267.9,150
12/17/18 7:19:00 AM -06:00,267.55,267.55,267.55,267.55,200
12/17/18 7:20:00 AM -06:00,267.55,267.55,267.55,267.55,200
12/17/18 7:24:00 AM -06:00,266.85,266.85,266.85,266.85,609
12/17/18 7:32:00 AM -06:00,266.56,266.56,266.52,266.52,315
12/17/18 7:39:00 AM -06:00,266.9,266.9,266.9,266.9,673
12/17/18 7:41:00 AM -06:00,266.95,267.2,266.95,267.2,680
12/17/18 7:42:00 AM -06:00,267.63,267.66,267.14,267.14,384
12/17/18 7:44:00 AM -06:00,267.26,267.26,267.26,267.26,114
12/17/18 7:45:00 AM -06:00,267.25,267.25,267.1,267.15,650
12/17/18 7:46:00 AM -06:00,267.15,267.15,267.15,267.15,145
12/17/18 7:51:00 AM -06:00,267.27,267.27,267.27,267.27,252
12/17/18 7:55:00 AM -06:00,267.47,267.63,267.47,267.63,236
12/17/18 7:57:00 AM -06:00,267.23,267.23,267,267,2492
12/17/18 7:58:00 AM -06:00,267.5,267.5,267.5,267.5,250
12/17/18 7:59:00 AM -06:00,267.04,267.06,267.04,267.04,500
12/17/18 8:00:00 AM -06:00,267.9,267.9999,266.5,267,5073
12/17/18 8:02:00 AM -06:00,266.86,266.86,266.86,266.86,400
12/17/18 8:04:00 AM -06:00,266.95,267.3,266.95,267.3,550
12/17/18 8:06:00 AM -06:00,267.3,267.3,267.3,267.3,500
12/17/18 8:07:00 AM -06:00,267.1,267.1,267.1,267.1,755
12/17/18 8:09:00 AM -06:00,266.5,266.5,266.5,266.5,617
12/17/18 8:10:00 AM -06:00,267,267,267,267,313
12/17/18 8:17:00 AM -06:00,266.9,267,266.9,267,1120
12/17/18 8:21:00 AM -06:00,266.7,266.7,266.7,266.7,200
12/17/18 8:22:00 AM -06:00,266.9,266.9,266.7,266.7,1094
12/17/18 8:23:00 AM -06:00,266.9,266.9,266.9,266.9,150
12/17/18 8:26:00 AM -06:00,266.89,266.89,266.89,266.89,295
12/17/18 8:28:00 AM -06:00,266.48,266.48,266.21,266.21,1644
12/17/18 8:29:00 AM -06:00,266.21,266.25,266.21,266.25,1350
12/17/18 8:32:00 AM -06:00,266.32,266.68,266.05,266.05,1711
12/17/18 8:34:00 AM -06:00,266,266,265.8,265.8,3160
12/17/18 8:35:00 AM -06:00,265.9,266,265.9,266,300
12/17/18 8:37:00 AM -06:00,265.8,265.8,265.5,265.8,2010
12/17/18 8:38:00 AM -06:00,265.61,265.61,265.18,265.19,2770
12/17/18 8:39:00 AM -06:00,265.15,265.5,265,265,2825
12/17/18 8:40:00 AM -06:00,265.1,265.12,265.1,265.12,837
12/17/18 8:41:00 AM -06:00,265.27,265.5001,265.27,265.5001,1432
12/17/18 8:42:00 AM -06:00,265.55,265.55,265.5,265.5,473
12/17/18 8:43:00 AM -06:00,265.33,265.5,265.04,265.1,2450
12/17/18 8:44:00 AM -06:00,265.5,265.6,265.5,265.6,495
12/17/18 8:45:00 AM -06:00,265.3,265.3,265.22,265.3,1417
12/17/18 8:49:00 AM -06:00,265.02,265.02,265.01,265.01,1051
12/17/18 8:51:00 AM -06:00,265.03,265.06,265.01,265.01,1604
12/17/18 8:52:00 AM -06:00,264.91,264.91,264.81,264.9,1335
12/17/18 8:54:00 AM -06:00,264.62,264.89,264.62,264.89,386
12/17/18 8:55:00 AM -06:00,264.5,265,264.5,265,766
12/17/18 8:56:00 AM -06:00,265,265,264.62,264.62,683
12/17/18 8:58:00 AM -06:00,265.2,265.2,265.2,265.2,160
12/17/18 8:59:00 AM -06:00,265,265,265,265,2898
12/17/18 9:00:00 AM -06:00,265.0002,265.0002,265.0002,265.0002,530
12/17/18 9:02:00 AM -06:00,265.49,265.49,265.49,265.49,205
12/17/18 9:03:00 AM -06:00,265.5,265.5,265.49,265.49,683
12/17/18 9:04:00 AM -06:00,265.01,265.25,265.01,265.25,212
12/17/18 9:05:00 AM -06:00,265.06,265.06,265.06,265.06,260
12/17/18 9:08:00 AM -06:00,265.4,265.4,265.4,265.4,196
12/17/18 9:09:00 AM -06:00,265.44,265.44,265.44,265.44,1046
12/17/18 9:11:00 AM -06:00,265.6,266.05,265.6,266,1382
12/17/18 9:12:00 AM -06:00,266.3,266.3,266.3,266.3,157
12/17/18 9:13:00 AM -06:00,265.51,266,265.51,266,369
12/17/18 9:14:00 AM -06:00,266.2,266.2,266,266,2568
12/17/18 9:16:00 AM -06:00,266.01,266.01,265.91,265.91,1865
12/17/18 9:18:00 AM -06:00,266.4,266.4999,266.4,266.4999,1358
12/17/18 9:19:00 AM -06:00,266.0502,266.41,266.0502,266.39,618
12/17/18 9:21:00 AM -06:00,266.38,266.38,266.05,266.05,2101
12/17/18 9:22:00 AM -06:00,266.05,266.06,266.05,266.06,672
12/17/18 9:23:00 AM -06:00,266,266,266,266,228
12/17/18 9:25:00 AM -06:00,266.15,266.15,266.15,266.15,202
12/17/18 9:26:00 AM -06:00,266.15,266.15,265.64,265.64,888
12/17/18 9:27:00 AM -06:00,265.64,265.64,265.64,265.64,518
12/17/18 9:28:00 AM -06:00,266.1,266.7,266,266.55,4477
12/17/18 9:29:00 AM -06:00,266.55,266.92,266.49,266.55,4414
12/17/18 9:30:00 AM -06:00,266.51,268.48,266.51,266.9389,218303
12/17/18 9:31:00 AM -06:00,266.6716,267.09,265.79,266.09,66077
12/17/18 9:32:00 AM -06:00,266.14,268.4734,266.115,268.1235,63447
12/17/18 9:33:00 AM -06:00,267.9615,269.8,267.92,268.7995,75836
12/17/18 9:34:00 AM -06:00,268.46,269.8,268,268.8677,62348
12/17/18 9:35:00 AM -06:00,268.65,269.1,267.13,267.9,59101
12/17/18 9:36:00 AM -06:00,267.74,268.25,266.6601,267.15,64586
12/17/18 9:37:00 AM -06:00,267.1,267.86,266.87,267.13,50614
12/17/18 9:38:00 AM -06:00,267.13,267.31,265.5,266.29,53285
12/17/18 9:39:00 AM -06:00,266.3,266.5,265.3404,265.69,63042
12/17/18 9:40:00 AM -06:00,265.6853,266.0663,264.85,265.73,70557
12/17/18 9:41:00 AM -06:00,265.78,265.8499,263.64,264.167,60068
12/17/18 9:42:00 AM -06:00,264.195,264.73,263.57,263.8608,59108
12/17/18 9:43:00 AM -06:00,263.788,264.03,262.51,263.755,57838
12/17/18 9:44:00 AM -06:00,263.85,264.66,263.6,264.25,30176
12/17/18 9:45:00 AM -06:00,264.19,264.87,263.53,264.735,39801
12/17/18 9:46:00 AM -06:00,264.77,265,263.6701,263.88,46193
12/17/18 9:47:00 AM -06:00,263.77,263.81,262.765,262.8222,27647
12/17/18 9:48:00 AM -06:00,262.6595,262.73,261.74,261.93,52621
12/17/18 9:49:00 AM -06:00,262.1,262.8652,262.1,262.8652,31219
12/17/18 9:50:00 AM -06:00,262.75,262.93,261.55,262.9,46965
12/17/18 9:51:00 AM -06:00,262.68,262.6841,261.77,262.34,18894
12/17/18 9:52:00 AM -06:00,262.1501,262.79,262,262.48,16901
12/17/18 9:53:00 AM -06:00,262.29,262.75,261.31,261.67,36727
12/17/18 9:54:00 AM -06:00,261.65,263,261.65,262.9799,53638
12/17/18 9:55:00 AM -06:00,263,263.6496,262.78,263.54,52760
12/17/18 9:56:00 AM -06:00,263.5,264.1791,263.0546,263.48,57560
12/17/18 9:57:00 AM -06:00,263.47,263.47,262.5016,262.71,26280
12/17/18 9:58:00 AM -06:00,262.61,264,262.61,263.97,44799
12/17/18 9:59:00 AM -06:00,264,264.225,263.54,263.82,43110
12/17/18 10:00:00 AM -06:00,263.8,263.83,262.89,263.34,45555
12/17/18 10:01:00 AM -06:00,263.15,264.48,262.96,264.43,51639
12/17/18 10:02:00 AM -06:00,264.3288,264.5424,263.62,263.77,26816
12/17/18 10:03:00 AM -06:00,263.94,264.31,263.56,264,34136
12/17/18 10:04:00 AM -06:00,264.16,264.3999,263.79,264.29,18048
12/17/18 10:05:00 AM -06:00,264.19,264.29,263.6,264.2019,25195
12/17/18 10:06:00 AM -06:00,264.1761,265.18,264.08,265.0881,37166
12/17/18 10:07:00 AM -06:00,265.18,265.377,264.71,264.73,33960
12/17/18 10:08:00 AM -06:00,264.785,264.91,264.37,264.5,12803
12/17/18 10:09:00 AM -06:00,264.53,265.68,264.43,265.5,22052
12/17/18 10:10:00 AM -06:00,265.4067,265.85,264.66,265.52,29961
12/17/18 10:11:00 AM -06:00,265.4821,266.2699,265.456,266.2322,29773
12/17/18 10:12:00 AM -06:00,266.1192,267.15,265.7,267.0785,44108
12/17/18 10:13:00 AM -06:00,266.93,267.15,266.5,267.05,22832
12/17/18 10:14:00 AM -06:00,267.0245,267.66,266.99,267.27,45868
12/17/18 10:15:00 AM -06:00,267.397,268.13,267.2701,267.68,43465
12/17/18 10:16:00 AM -06:00,267.6,267.685,266.81,266.81,55713
12/17/18 10:17:00 AM -06:00,266.965,267,266.25,266.745,36927
12/17/18 10:18:00 AM -06:00,266.7596,267.5,266.7596,267.253,20019
12/17/18 10:19:00 AM -06:00,267.25,268,267.22,267.53,28141
12/17/18 10:20:00 AM -06:00,267.41,267.4918,266.63,266.9264,21642
12/17/18 10:21:00 AM -06:00,266.9553,267.42,263.75,266.9847,12680
12/17/18 10:22:00 AM -06:00,266.9261,267.32,266.5,266.61,18468
12/17/18 10:23:00 AM -06:00,266.751,267.6,266.5,266.76,26739
12/17/18 10:24:00 AM -06:00,266.81,267.1891,266.5612,266.5918,8114
12/17/18 10:25:00 AM -06:00,266.5,267.5,266.39,267.499,17151
12/17/18 10:26:00 AM -06:00,267.34,268.5487,267.0661,268.5487,44910
12/17/18 10:27:00 AM -06:00,268.3817,268.9247,268.2501,268.44,36728
12/17/18 10:28:00 AM -06:00,268.69,268.69,267.7,267.815,18883
12/17/18 10:29:00 AM -06:00,267.71,268.46,267.57,268.3337,23075
12/17/18 10:30:00 AM -06:00,268.46,269.27,268.15,268.545,70376
12/17/18 10:31:00 AM -06:00,268.55,268.69,267.27,267.7605,28416
12/17/18 10:32:00 AM -06:00,267.66,268.2813,267.56,268.03,20968
12/17/18 10:33:00 AM -06:00,267.99,267.99,267.56,267.76,7294
12/17/18 10:34:00 AM -06:00,267.76,268.185,267.16,267.249,43088
12/17/18 10:35:00 AM -06:00,267.21,267.2962,266.86,267.2612,13928
12/17/18 10:36:00 AM -06:00,267.3198,267.3198,266.84,266.95,13977
12/17/18 10:37:00 AM -06:00,266.86,267.5,266.84,267.5,20950
12/17/18 10:38:00 AM -06:00,267.649,267.985,267.23,267.81,34469
12/17/18 10:39:00 AM -06:00,267.83,268.19,267.71,267.98,19227
12/17/18 10:40:00 AM -06:00,267.87,268.8254,267.1405,268.8254,38607
12/17/18 10:41:00 AM -06:00,268.6666,269.18,268.52,268.9787,25359
12/17/18 10:42:00 AM -06:00,268.9661,269.97,268.9661,269.8,30278
12/17/18 10:43:00 AM -06:00,269.775,269.775,269.01,269.26,17544
12/17/18 10:44:00 AM -06:00,269.45,269.66,268.805,269.225,15476
12/17/18 10:45:00 AM -06:00,269.35,269.5,268.7,269.0921,17691
12/17/18 10:46:00 AM -06:00,269.0797,269.22,268.62,269.22,14239
12/17/18 10:47:00 AM -06:00,269.2375,269.42,268.72,269.37,39954
12/17/18 10:48:00 AM -06:00,269.3091,269.3091,268.6,268.6,16587
12/17/18 10:49:00 AM -06:00,268.5801,268.86,268.45,268.8,12029
12/17/18 10:50:00 AM -06:00,268.7822,268.8099,268.55,268.7,18747
12/17/18 10:51:00 AM -06:00,268.8,269.1,268.4,268.98,16708
12/17/18 10:52:00 AM -06:00,268.9301,269.95,268.9301,269.8198,25691
12/17/18 10:53:00 AM -06:00,269.805,269.9,268.8165,269.08,17639
12/17/18 10:54:00 AM -06:00,269.2564,269.71,269.185,269.632,12716
12/17/18 10:55:00 AM -06:00,269.81,270.24,269.6101,269.92,54838
12/17/18 10:56:00 AM -06:00,270.07,271.2,270.07,270.9129,69109
12/17/18 10:57:00 AM -06:00,270.9206,271.3425,270.36,270.3794,33115
12/17/18 10:58:00 AM -06:00,270.4,271,270.4,270.722,19804
12/17/18 10:59:00 AM -06:00,270.5,270.55,269.7562,269.9557,33035
12/17/18 11:00:00 AM -06:00,269.9,270.38,269.9,270.38,19307
12/17/18 11:01:00 AM -06:00,270.44,270.44,269.94,270.16,39813
12/17/18 11:02:00 AM -06:00,270.46,270.87,270.15,270.87,18095
12/17/18 11:03:00 AM -06:00,270.8851,271.8,270.8818,271.54,56581
12/17/18 11:04:00 AM -06:00,271.698,271.775,271.4,271.5945,39275
12/17/18 11:05:00 AM -06:00,271.7,271.9,271.4,271.48,34195
12/17/18 11:06:00 AM -06:00,271.4,272.13,271.17,271.99,36072
12/17/18 11:07:00 AM -06:00,272.105,272.11,271,271.1104,17227
12/17/18 11:08:00 AM -06:00,271.1,271.62,270.9149,271.495,8954
12/17/18 11:09:00 AM -06:00,271.4813,272.2,271.4813,271.5498,34750
12/17/18 11:10:00 AM -06:00,271.6,272.3,271.6,271.88,31656
12/17/18 11:11:00 AM -06:00,271.8782,272.05,271.6301,271.69,14751
12/17/18 11:12:00 AM -06:00,271.84,272.05,271.5791,271.5791,18618
12/17/18 11:13:00 AM -06:00,271.6581,271.7541,271.08,271.35,29992
12/17/18 11:14:00 AM -06:00,271.42,272.98,271.3471,272.83,86212
12/17/18 11:15:00 AM -06:00,272.9519,272.98,271.73,271.76,20959
12/17/18 11:16:00 AM -06:00,271.82,272,271.5651,271.7065,20352
12/17/18 11:17:00 AM -06:00,271.79,272.585,271.78,272.585,22480
12/17/18 11:18:00 AM -06:00,272.6355,272.7873,271.7457,271.8547,17502
12/17/18 11:19:00 AM -06:00,271.808,271.9999,271.3016,271.4735,21099
12/17/18 11:20:00 AM -06:00,271.56,271.89,270.71,270.71,29350
12/17/18 11:21:00 AM -06:00,270.7955,271.22,270.7955,270.96,22949
12/17/18 11:22:00 AM -06:00,270.98,270.98,270.5982,270.5982,18101
12/17/18 11:23:00 AM -06:00,270.52,270.8349,270.3,270.4,16988
12/17/18 11:24:00 AM -06:00,270.5,270.78,270.3335,270.6504,9040
12/17/18 11:25:00 AM -06:00,270.73,271.16,270.675,271.015,25902
12/17/18 11:26:00 AM -06:00,270.95,271,270.51,270.71,14563
12/17/18 11:27:00 AM -06:00,270.737,271.0965,270.52,270.69,12704
12/17/18 11:28:00 AM -06:00,270.76,271,270.56,270.6701,9415
12/17/18 11:29:00 AM -06:00,270.735,270.91,269.93,269.93,35828
12/17/18 11:30:00 AM -06:00,269.8984,270.28,269.72,269.745,44837
12/17/18 11:31:00 AM -06:00,269.79,269.95,269.57,269.69,16620
12/17/18 11:32:00 AM -06:00,269.6103,270.09,269.6052,270.02,13440
12/17/18 11:33:00 AM -06:00,269.924,270.7999,269.924,270.785,18015
12/17/18 11:34:00 AM -06:00,270.76,270.79,270.53,270.53,14401
12/17/18 11:35:00 AM -06:00,270.5512,270.855,270.49,270.76,13983
12/17/18 11:36:00 AM -06:00,270.7,271.18,270.65,270.956,28417
12/17/18 11:37:00 AM -06:00,270.8802,271.1852,270.4,270.4,17995
12/17/18 11:38:00 AM -06:00,270.39,270.58,270.15,270.495,13926
12/17/18 11:39:00 AM -06:00,270.38,270.64,270.38,270.43,4570
12/17/18 11:40:00 AM -06:00,270.35,270.3988,269.7,269.7725,18467
12/17/18 11:41:00 AM -06:00,269.63,269.96,269.15,269.28,30587
12/17/18 11:42:00 AM -06:00,269.18,269.8,269.18,269.66,17290
12/17/18 11:43:00 AM -06:00,269.52,269.93,269.43,269.84,29166
12/17/18 11:44:00 AM -06:00,269.8376,270.0748,269.33,269.5051,21834
12/17/18 11:45:00 AM -06:00,269.45,269.45,269.09,269.1945,24425
12/17/18 11:46:00 AM -06:00,269.29,269.32,268.85,268.955,30225
12/17/18 11:47:00 AM -06:00,269.1778,269.5,268.98,269.25,15933
12/17/18 11:48:00 AM -06:00,269.35,269.44,269.16,269.3216,8920
12/17/18 11:49:00 AM -06:00,269.43,269.79,269.32,269.69,12496
12/17/18 11:50:00 AM -06:00,269.81,269.94,269.55,269.64,24725
12/17/18 11:51:00 AM -06:00,269.585,269.69,269.3792,269.3792,15541
12/17/18 11:52:00 AM -06:00,269.19,269.69,269.1896,269.435,17219
12/17/18 11:53:00 AM -06:00,269.58,269.9399,269.58,269.6,11841
12/17/18 11:54:00 AM -06:00,269.6,269.91,269.52,269.8212,7289
12/17/18 11:55:00 AM -06:00,269.94,270.75,269.94,270.59,29302
12/17/18 11:56:00 AM -06:00,270.58,270.835,270.26,270.627,14606
12/17/18 11:57:00 AM -06:00,270.535,270.6,270.03,270.5,11971
12/17/18 11:58:00 AM -06:00,270.45,270.83,270.29,270.695,7407
12/17/18 11:59:00 AM -06:00,270.7037,271.25,270.68,271.0949,16958
12/17/18 12:00:00 PM -06:00,271.2,271.54,270.961,271.37,23760
12/17/18 12:01:00 PM -06:00,271.5,271.8,271.38,271.51,28105
12/17/18 12:02:00 PM -06:00,271.57,271.9,271.356,271.4,24480
12/17/18 12:03:00 PM -06:00,271.16,271.49,271.03,271.118,22181
12/17/18 12:04:00 PM -06:00,271,271.39,270.875,271.2442,14120
12/17/18 12:05:00 PM -06:00,271.13,271.6924,271.13,271.65,16271
12/17/18 12:06:00 PM -06:00,271.6334,271.65,271.32,271.5,21370
12/17/18 12:07:00 PM -06:00,271.4126,271.6,271.3,271.31,5238
12/17/18 12:08:00 PM -06:00,271.3,271.55,271.15,271.15,7271
12/17/18 12:09:00 PM -06:00,271.2,271.3,271.03,271.11,12511
12/17/18 12:10:00 PM -06:00,271.11,271.19,270.92,270.92,16033
12/17/18 12:11:00 PM -06:00,270.92,271.12,270.83,271,16368
12/17/18 12:12:00 PM -06:00,270.97,270.97,270.4,270.6496,20170
12/17/18 12:13:00 PM -06:00,270.7572,270.8,270.505,270.505,4418
12/17/18 12:14:00 PM -06:00,270.51,270.5799,269.78,269.9828,25460
12/17/18 12:15:00 PM -06:00,269.93,269.93,269.3932,269.3932,10327
12/17/18 12:16:00 PM -06:00,269.5399,269.67,269.33,269.59,8918
12/17/18 12:17:00 PM -06:00,269.39,270.3,269.39,270.0647,16967
12/17/18 12:18:00 PM -06:00,270,270.38,269.9915,270.078,7611
12/17/18 12:19:00 PM -06:00,270.185,270.185,269.91,269.92,15546
12/17/18 12:20:00 PM -06:00,270.14,270.52,270.14,270.48,5190
12/17/18 12:21:00 PM -06:00,270.4453,270.74,270.4453,270.622,15959
12/17/18 12:22:00 PM -06:00,270.74,270.745,269.98,270.03,11963
12/17/18 12:23:00 PM -06:00,270.01,270.03,269.45,269.5,18364
12/17/18 12:24:00 PM -06:00,269.48,269.58,269.3425,269.4675,9231
12/17/18 12:25:00 PM -06:00,269.4525,269.4525,268.95,269.2453,11780
12/17/18 12:26:00 PM -06:00,269.32,269.38,269.01,269.15,6361
12/17/18 12:27:00 PM -06:00,269.1131,269.5,269,269.4,9273
12/17/18 12:28:00 PM -06:00,269.45,269.65,269.29,269.29,8815
12/17/18 12:29:00 PM -06:00,269.3624,269.64,269.25,269.5,13307
12/17/18 12:30:00 PM -06:00,269.49,269.5,268.5332,268.8121,17232
12/17/18 12:31:00 PM -06:00,268.81,268.87,268.09,268.3379,24028
12/17/18 12:32:00 PM -06:00,268.15,268.25,267.74,268,24960
12/17/18 12:33:00 PM -06:00,268,268.109,267.685,267.685,13320
12/17/18 12:34:00 PM -06:00,267.7,267.8999,267.42,267.4914,29259
12/17/18 12:35:00 PM -06:00,267.535,267.8,267.53,267.545,11348
12/17/18 12:36:00 PM -06:00,267.61,267.8,267.05,267.15,20229
12/17/18 12:37:00 PM -06:00,267.1105,267.9756,267.01,267.72,14886
12/17/18 12:38:00 PM -06:00,267.6544,268.11,267.28,267.9288,26923
12/17/18 12:39:00 PM -06:00,267.8462,268.28,267.71,268.1244,9106
12/17/18 12:40:00 PM -06:00,268.2,268.41,267.9338,268.41,6919
12/17/18 12:41:00 PM -06:00,268.4099,268.67,268.3544,268.54,17627
12/17/18 12:42:00 PM -06:00,268.58,268.63,268.15,268.15,26337
12/17/18 12:43:00 PM -06:00,268.15,268.31,267.56,267.6427,22958
12/17/18 12:44:00 PM -06:00,267.57,268.34,267.33,268.07,15286
12/17/18 12:45:00 PM -06:00,268.29,268.56,268,268.47,13098
12/17/18 12:46:00 PM -06:00,268.52,268.6484,268.4361,268.5,11453
12/17/18 12:47:00 PM -06:00,268.595,268.595,268.24,268.24,4338
12/17/18 12:48:00 PM -06:00,268.2596,268.27,267.62,267.8276,15031
12/17/18 12:49:00 PM -06:00,267.7,268.07,267.53,267.971,6980
12/17/18 12:50:00 PM -06:00,267.8,268.16,267.53,268.058,11786
12/17/18 12:51:00 PM -06:00,267.94,268,267.6,267.91,7105
12/17/18 12:52:00 PM -06:00,267.7731,267.7731,267.17,267.33,18304
12/17/18 12:53:00 PM -06:00,267.34,267.35,266.56,266.79,27941
12/17/18 12:54:00 PM -06:00,266.9,267.28,266.71,267.23,12845
12/17/18 12:55:00 PM -06:00,267.2794,267.34,266.455,266.9667,27540
12/17/18 12:56:00 PM -06:00,266.91,267.13,266.63,266.88,14890
12/17/18 12:57:00 PM -06:00,267.039,267.4383,266.9812,267.2,12904
12/17/18 12:58:00 PM -06:00,267.1,267.3535,266.62,266.8,16882
12/17/18 12:59:00 PM -06:00,266.6352,267.06,266.58,266.97,14303
12/17/18 1:00:00 PM -06:00,266.81,266.97,266.54,266.6802,14294
12/17/18 1:01:00 PM -06:00,266.77,266.84,266.1203,266.33,27672
12/17/18 1:02:00 PM -06:00,266.26,267,266.23,266.82,24769
12/17/18 1:03:00 PM -06:00,266.67,267.39,266.67,266.9,13147
12/17/18 1:04:00 PM -06:00,266.9,267.01,266.56,266.8,4563
12/17/18 1:05:00 PM -06:00,266.81,267.35,266.6,266.92,13925
12/17/18 1:06:00 PM -06:00,267.1,267.8,267.03,267.61,19164
12/17/18 1:07:00 PM -06:00,267.63,267.63,267.03,267.36,12501
12/17/18 1:08:00 PM -06:00,267.355,268,267.13,267.88,13401
12/17/18 1:09:00 PM -06:00,267.89,268.08,267.62,267.7001,15139
12/17/18 1:10:00 PM -06:00,267.63,268.04,267.59,267.99,7779
12/17/18 1:11:00 PM -06:00,267.95,268.13,267.445,267.445,8071
12/17/18 1:12:00 PM -06:00,267.42,267.5075,267.19,267.2465,6667
12/17/18 1:13:00 PM -06:00,267.17,267.39,266.9,267.16,8804
12/17/18 1:14:00 PM -06:00,266.9963,267.4242,266.62,267.24,22286
12/17/18 1:15:00 PM -06:00,267.25,267.25,266.6,266.755,16020
12/17/18 1:16:00 PM -06:00,266.75,267.0415,266.38,266.5825,15622
12/17/18 1:17:00 PM -06:00,266.4,266.4,265.88,266.29,33136
12/17/18 1:18:00 PM -06:00,266.35,266.6722,266.13,266.4953,13108
12/17/18 1:19:00 PM -06:00,266.38,266.7245,265.8678,265.8678,12902
12/17/18 1:20:00 PM -06:00,265.9944,266.1333,265.33,265.46,15607
12/17/18 1:21:00 PM -06:00,265.46,266.1151,265.3101,265.6952,2837037
12/17/18 1:22:00 PM -06:00,265.6836,266.1151,265.3,265.5928,2839501
12/17/18 1:23:00 PM -06:00,265.81,266.5,265.5,266.5,16792
12/17/18 1:24:00 PM -06:00,266.36,266.63,266.1677,266.3777,7889
12/17/18 1:25:00 PM -06:00,266.3699,266.57,266.25,266.5,6038
12/17/18 1:26:00 PM -06:00,266.25,266.6899,266.25,266.35,8735
12/17/18 1:27:00 PM -06:00,266.33,266.33,265.83,265.83,8215
12/17/18 1:28:00 PM -06:00,265.84,266.27,265.62,266.02,15621
12/17/18 1:29:00 PM -06:00,265.875,266.01,265.5001,265.52,8201
12/17/18 1:30:00 PM -06:00,265.5,266.55,265.376,266.55,18365
12/17/18 1:31:00 PM -06:00,266.3681,266.5993,266.14,266.14,5457
12/17/18 1:32:00 PM -06:00,266.1,266.6393,265.837,266.14,14813
12/17/18 1:33:00 PM -06:00,266.03,266.03,265.61,265.7993,8016
12/17/18 1:34:00 PM -06:00,265.5714,265.8115,264.93,264.95,35594
12/17/18 1:35:00 PM -06:00,264.9,265.6919,264.69,265.05,17211
12/17/18 1:36:00 PM -06:00,265.1264,265.3061,264.4414,264.4414,26057
12/17/18 1:37:00 PM -06:00,264.4,264.83,264.2932,264.6,16461
12/17/18 1:38:00 PM -06:00,264.6119,264.75,264.44,264.75,5105
12/17/18 1:39:00 PM -06:00,264.67,265.0359,264.4828,265.0359,8162
12/17/18 1:40:00 PM -06:00,265.0031,265.2385,264.78,264.89,13991
12/17/18 1:41:00 PM -06:00,265,265.43,264.9725,265.27,12782
12/17/18 1:42:00 PM -06:00,265.3,265.7499,265.3,265.3339,16554
12/17/18 1:43:00 PM -06:00,265.5,265.66,265.1985,265.3396,10575
12/17/18 1:44:00 PM -06:00,265.405,265.405,264.56,264.735,19764
12/17/18 1:45:00 PM -06:00,264.64,264.64,264,264.4711,35226
12/17/18 1:46:00 PM -06:00,264.4912,264.5799,264.17,264.17,12719
12/17/18 1:47:00 PM -06:00,264.08,264.56,264,264.3177,22677
12/17/18 1:48:00 PM -06:00,264.25,264.88,264.25,264.6386,15383
12/17/18 1:49:00 PM -06:00,264.56,265,264.56,264.825,17041
12/17/18 1:50:00 PM -06:00,264.91,265.17,264.54,264.55,21690
12/17/18 1:51:00 PM -06:00,264.5726,265.19,264.5726,264.8404,9743
12/17/18 1:52:00 PM -06:00,264.705,265.47,264.705,265.175,12700
12/17/18 1:53:00 PM -06:00,264.93,265.2095,264.8948,265.12,11237
12/17/18 1:54:00 PM -06:00,265.14,265.3514,264.7761,264.99,17757
12/17/18 1:55:00 PM -06:00,264.86,265.35,264.86,265.35,6095
12/17/18 1:56:00 PM -06:00,265.49,265.84,265.48,265.632,10609
12/17/18 1:57:00 PM -06:00,265.75,265.75,265.04,265.2924,17193
12/17/18 1:58:00 PM -06:00,265.35,265.55,264.9,265.0936,9400
12/17/18 1:59:00 PM -06:00,264.88,264.9499,264.53,264.7153,13936
12/17/18 2:00:00 PM -06:00,264.64,265.27,264.64,264.8,11363
12/17/18 2:01:00 PM -06:00,264.6665,264.7776,264.3,264.7,13246
12/17/18 2:02:00 PM -06:00,264.81,264.89,264.3,264.47,16043
12/17/18 2:03:00 PM -06:00,264.558,264.558,263.41,263.7483,27752
12/17/18 2:04:00 PM -06:00,263.6102,263.74,263.08,263.37,12958
12/17/18 2:05:00 PM -06:00,263.4,263.69,263.0501,263.4909,11831
12/17/18 2:06:00 PM -06:00,263.4575,263.847,263.39,263.39,22064
12/17/18 2:07:00 PM -06:00,263.43,263.7816,263.3,263.7454,6470
12/17/18 2:08:00 PM -06:00,263.6291,263.73,263.47,263.51,17479
12/17/18 2:09:00 PM -06:00,263.5096,263.77,263.15,263.4933,11790
12/17/18 2:10:00 PM -06:00,263.3217,263.59,263.2579,263.5134,3363
12/17/18 2:11:00 PM -06:00,263.4767,263.97,263.4767,263.81,6657
12/17/18 2:12:00 PM -06:00,264,264.13,263.53,263.6996,14876
12/17/18 2:13:00 PM -06:00,263.737,264.1298,263.3865,263.3865,10863
12/17/18 2:14:00 PM -06:00,263.4,264.26,263.3,264.1,9920
12/17/18 2:15:00 PM -06:00,263.91,264.0599,263.3,263.3882,13390
12/17/18 2:16:00 PM -06:00,263.4,264.16,263.24,264.16,13365
12/17/18 2:17:00 PM -06:00,264.14,264.25,263.8063,264.2,27663
12/17/18 2:18:00 PM -06:00,264.1702,264.7,264.05,264.5286,13039
12/17/18 2:19:00 PM -06:00,264.53,264.9,264.2,264.8536,16721
12/17/18 2:20:00 PM -06:00,264.97,265.39,264.7461,265.39,26985
12/17/18 2:21:00 PM -06:00,265.4,265.83,265,265.7,20888
12/17/18 2:22:00 PM -06:00,265.625,265.75,265.12,265.2,11517
12/17/18 2:23:00 PM -06:00,265.19,265.4201,264.8817,265.06,22494
12/17/18 2:24:00 PM -06:00,264.97,265.0519,264.26,264.4448,19034
12/17/18 2:25:00 PM -06:00,264.41,264.55,264.011,264.2588,15505
12/17/18 2:26:00 PM -06:00,264.32,264.62,264.13,264.21,16598
12/17/18 2:27:00 PM -06:00,264.13,264.3874,263.61,264.03,23856
12/17/18 2:28:00 PM -06:00,264.01,264.01,263.581,263.6217,14740
12/17/18 2:29:00 PM -06:00,263.7319,263.7319,263.23,263.3464,24905
12/17/18 2:30:00 PM -06:00,263.58,263.93,263.46,263.7001,10819
12/17/18 2:31:00 PM -06:00,263.8,263.905,263.6296,263.72,11062
12/17/18 2:32:00 PM -06:00,264,264.5355,263.9324,264.19,17204
12/17/18 2:33:00 PM -06:00,264.36,264.6351,264.27,264.3623,11253
12/17/18 2:34:00 PM -06:00,264.4393,264.49,264.01,264.35,14559
12/17/18 2:35:00 PM -06:00,264.3215,264.3215,263.9024,263.912,9105
12/17/18 2:36:00 PM -06:00,263.8943,264.18,263.72,263.8991,16020
12/17/18 2:37:00 PM -06:00,264.05,264.35,263.87,264.29,8493
12/17/18 2:38:00 PM -06:00,264.41,264.41,263.92,264.32,10484
12/17/18 2:39:00 PM -06:00,264.4,264.47,264.15,264.15,7259
12/17/18 2:40:00 PM -06:00,264.29,264.85,264.22,264.8,16963
12/17/18 2:41:00 PM -06:00,264.83,265.6,264.83,265.446,26888
12/17/18 2:42:00 PM -06:00,265.4757,265.8,265.2105,265.3201,12846
12/17/18 2:43:00 PM -06:00,265.33,265.34,264.4901,264.962,14870
12/17/18 2:44:00 PM -06:00,264.94,265,264.66,265,9528
12/17/18 2:45:00 PM -06:00,264.9225,265.65,264.65,265.5546,14621
12/17/18 2:46:00 PM -06:00,265.68,265.74,264.85,265.05,22269
12/17/18 2:47:00 PM -06:00,265.046,265.13,264.66,264.91,14682
12/17/18 2:48:00 PM -06:00,264.89,265.0799,264.58,264.62,13006
12/17/18 2:49:00 PM -06:00,264.6271,264.64,264.39,264.5158,15161
12/17/18 2:50:00 PM -06:00,264.52,264.7088,264,264.1964,21355
12/17/18 2:51:00 PM -06:00,264.21,264.3584,263.733,263.733,15635
12/17/18 2:52:00 PM -06:00,263.8435,264.23,263.71,263.78,19854
12/17/18 2:53:00 PM -06:00,263.96,264.18,263.5,263.54,18338
12/17/18 2:54:00 PM -06:00,263.57,263.6,262.85,263.36,37600
12/17/18 2:55:00 PM -06:00,263.2,263.57,263.19,263.5579,15824
12/17/18 2:56:00 PM -06:00,263.66,263.94,263.56,263.81,12526
12/17/18 2:57:00 PM -06:00,263.7904,264,263.5948,263.7796,12836
12/17/18 2:58:00 PM -06:00,263.8377,264.25,263.78,263.8643,13307
12/17/18 2:59:00 PM -06:00,263.8,264.35,263.8,264.13,16070
12/17/18 3:00:00 PM -06:00,264.245,264.245,263.71,264.01,13471
12/17/18 3:01:00 PM -06:00,264.08,264.54,263.995,264.29,12293
12/17/18 3:02:00 PM -06:00,264.42,264.56,264.01,264.15,9257
12/17/18 3:03:00 PM -06:00,264.04,264.32,263.5757,264.0079,17665
12/17/18 3:04:00 PM -06:00,263.95,264.15,263.5,263.63,21824
12/17/18 3:05:00 PM -06:00,263.7099,264.01,263.4,263.6817,25076
12/17/18 3:06:00 PM -06:00,263.7999,265,263.79,264.85,34215
12/17/18 3:07:00 PM -06:00,264.81,264.9799,264.2855,264.35,21803
12/17/18 3:08:00 PM -06:00,264.3828,264.41,263.81,264.255,10275
12/17/18 3:09:00 PM -06:00,264.29,264.29,263.5,263.604,15514
12/17/18 3:10:00 PM -06:00,263.5,264.13,263.4976,264.05,11557
12/17/18 3:11:00 PM -06:00,264.08,264.36,263.674,264.2,13273
12/17/18 3:12:00 PM -06:00,264.31,264.63,263.73,264.4332,18626
12/17/18 3:13:00 PM -06:00,264.38,264.508,263.83,264.105,28812
12/17/18 3:14:00 PM -06:00,264.14,264.18,263.65,264.005,18873
12/17/18 3:15:00 PM -06:00,264.03,264.17,263.64,263.77,10610
12/17/18 3:16:00 PM -06:00,263.75,264.19,263.55,263.8962,22157
12/17/18 3:17:00 PM -06:00,263.9039,264.17,263.6932,263.88,12221
12/17/18 3:18:00 PM -06:00,263.87,264.698,263.75,264.035,28824
12/17/18 3:19:00 PM -06:00,264.13,264.29,263.85,264.0633,9616
12/17/18 3:20:00 PM -06:00,264.07,264.2,263.81,264.08,14122
12/17/18 3:21:00 PM -06:00,264.11,264.2119,263.64,263.77,28912
12/17/18 3:22:00 PM -06:00,263.74,263.74,263,263.2881,37793
12/17/18 3:23:00 PM -06:00,263.22,263.22,262.4536,262.4735,36623
12/17/18 3:24:00 PM -06:00,262.49,262.93,262.4,262.735,23411
12/17/18 3:25:00 PM -06:00,262.59,262.779,262.25,262.35,35894
12/17/18 3:26:00 PM -06:00,262.3497,262.75,261.99,262,54709
12/17/18 3:27:00 PM -06:00,262.14,262.29,261.77,261.9159,31135
12/17/18 3:28:00 PM -06:00,261.75,261.9,261.34,261.62,42644
12/17/18 3:29:00 PM -06:00,261.74,262.289,261.55,262.0443,21698
12/17/18 3:30:00 PM -06:00,262.15,262.3,261.3,261.6489,25346
12/17/18 3:31:00 PM -06:00,261.4001,261.7885,261.39,261.43,20086
12/17/18 3:32:00 PM -06:00,261.59,261.96,261.075,261.96,48975
12/17/18 3:33:00 PM -06:00,262,262.16,261.55,261.5584,22471
12/17/18 3:34:00 PM -06:00,261.59,261.92,261.4,261.6578,15212
12/17/18 3:35:00 PM -06:00,261.675,261.8599,261.28,261.392,21552
12/17/18 3:36:00 PM -06:00,261.41,262.1495,261.301,262.1495,24641
12/17/18 3:37:00 PM -06:00,262.15,262.5,261.91,262.49,31430
12/17/18 3:38:00 PM -06:00,262.4,262.78,262.32,262.38,40688
12/17/18 3:39:00 PM -06:00,262.3504,262.43,262,262.43,32862
12/17/18 3:40:00 PM -06:00,262.41,262.77,262.2,262.22,28357
12/17/18 3:41:00 PM -06:00,262.25,262.8,262.18,262.69,16773
12/17/18 3:42:00 PM -06:00,262.6652,262.7599,261.88,262.23,27800
12/17/18 3:43:00 PM -06:00,262.21,262.4,261.83,262.2,32006
12/17/18 3:44:00 PM -06:00,262.2558,262.4613,261.9471,262,16888
12/17/18 3:45:00 PM -06:00,262,263,261.99,262.8476,50176
12/17/18 3:46:00 PM -06:00,262.8,263.1786,262.415,262.415,29594
12/17/18 3:47:00 PM -06:00,262.3265,262.34,261.41,261.85,42599
12/17/18 3:48:00 PM -06:00,261.83,261.86,261.3,261.61,32731
12/17/18 3:49:00 PM -06:00,261.52,262.12,261.47,262.12,35581
12/17/18 3:50:00 PM -06:00,262.02,262.21,261.69,261.77,29098
12/17/18 3:51:00 PM -06:00,261.78,262.35,261.78,262.07,37615
12/17/18 3:52:00 PM -06:00,262.13,262.41,262.03,262.2,23277
12/17/18 3:53:00 PM -06:00,262.11,262.24,261.9444,262.1399,36269
12/17/18 3:54:00 PM -06:00,262.07,262.1,261.6801,261.95,40014
12/17/18 3:55:00 PM -06:00,261.94,262.49,261.45,262.49,60237
12/17/18 3:56:00 PM -06:00,262.45,262.68,262.06,262.3895,53720
12/17/18 3:57:00 PM -06:00,262.3921,262.5499,262.25,262.47,38461
12/17/18 3:58:00 PM -06:00,262.48,262.87,262.45,262.72,42522
12/17/18 3:59:00 PM -06:00,262.71,263.33,262.71,262.96,116373
12/17/18 4:00:00 PM -06:00,262.8,263.49,262.8,263.49,387250
12/17/18 4:01:00 PM -06:00,263.49,264,263.49,264,1754
12/17/18 4:02:00 PM -06:00,263.49,263.49,263.49,263.49,466
12/17/18 4:03:00 PM -06:00,263.03,263.03,263.03,263.03,475
12/17/18 4:07:00 PM -06:00,263.59,263.59,263.59,263.59,106
12/17/18 4:08:00 PM -06:00,263.8,263.8,263.8,263.8,324
12/17/18 4:09:00 PM -06:00,263.7,263.7,263.7,263.7,114
12/17/18 4:11:00 PM -06:00,263.6999,263.6999,263.6999,263.6999,1709
12/17/18 4:17:00 PM -06:00,263.15,263.15,263.15,263.15,1003
12/17/18 4:19:00 PM -06:00,263.28,263.28,263.28,263.28,100
12/17/18 4:24:00 PM -06:00,263.23,263.23,263.2,263.2,966
12/17/18 4:25:00 PM -06:00,263.2,263.2,263.2,263.2,558
12/17/18 4:26:00 PM -06:00,263.3,263.3,263.29,263.29,359
12/17/18 4:31:00 PM -06:00,263.15,263.15,263.15,263.15,213
12/17/18 4:34:00 PM -06:00,262.8,262.8,262.8,262.8,160
12/17/18 4:39:00 PM -06:00,263.5,263.5,263.5,263.5,237
12/17/18 4:41:00 PM -06:00,263.5,263.5,263.5,263.5,436
12/17/18 4:47:00 PM -06:00,263.15,263.15,263.15,263.15,332
12/17/18 4:50:00 PM -06:00,263.2,263.2,263.2,263.2,185
12/17/18 4:55:00 PM -06:00,263.3,263.3,263.3,263.3,329
12/17/18 4:56:00 PM -06:00,263.3,263.3,263.3,263.3,100
12/17/18 4:58:00 PM -06:00,263.33,263.5,263.33,263.5,405
12/17/18 4:59:00 PM -06:00,263.5,263.72,263.5,263.72,300
12/17/18 5:02:00 PM -06:00,263.5,263.5,263.5,263.5,106
12/17/18 5:08:00 PM -06:00,263.2,263.2,263.2,263.2,604
12/17/18 5:16:00 PM -06:00,263.37,263.37,263.37,263.37,700
12/17/18 5:44:00 PM -06:00,263.15,263.15,263.15,263.15,400

I'm importing this data from a CSV file:

            string path = AppDomain.CurrentDomain.BaseDirectory.Split("/bin").First();

            using (var reader = new StreamReader($"{path}/CSV/NFLX_1m_12_17_2018.csv"))
            using (var csv = new CsvReader(reader))
            {
                return csv.GetRecords<Trady.Core.Candle>().ToList();
            }

Here's what the data looks like coming back from the CSV file:

screen shot 2018-12-22 at 5 55 03 pm

Then running a unit test over it like so:

        [Fact]
        public void IchimokuTenkanIsRising_Positive() 
        {
            var candles = Utility.CSVUtility.GetNFLX_1m_12_17_2018();
            var selected = candles.Where(x => x.DateTime.TimeOfDay > new DateTime(2018, 12, 17, 10, 00, 00).TimeOfDay && x.DateTime.TimeOfDay <= new DateTime(2018, 12, 17, 11, 15, 00).TimeOfDay);
            var config = new IchimokuConfig().GetDefaultConfig();
            config.LookBack = 5;
            var isRising = IchimokuRules.IchimokuTenkanIsRising(selected, config);

            Assert.True(isRising); 
        }

Do you have any ideas as to why this indicator is returning so many null values?

codebeaulieu commented 5 years ago

For good measure I just attempted to import the data using your CSVImporter and I had the same results.

codebeaulieu commented 5 years ago

I see what you are doing here... and it makes sense after I think about it. It was just a bit hard to understand without thinking through how the indicator works.

So, for anyone using this indicator in the future. Keep in mind that the indicator has a leading compnent to it (Span A & Span B). So, if we are trying to perform analysis on the Tenkan line (for example), we have to look back in our data by the amount we input as the middlePeriodCount.

So, for my unit tests I had to look back 26 bars to read my current Tenkan line.