@@ -2355,7 +2355,7 @@ def create_ohlc(open, high, low, close,
2355
2355
py.iplot(fig, filename='finance/simple-ohlc', validate=False)
2356
2356
```
2357
2357
"""
2358
- if dates :
2358
+ if dates is not None :
2359
2359
TraceFactory .validate_equal_length (open , high , low , close , dates )
2360
2360
else :
2361
2361
TraceFactory .validate_equal_length (open , high , low , close )
@@ -2628,7 +2628,7 @@ def create_candlestick(open, high, low, close,
2628
2628
"""
2629
2629
FigureFactory .validate_ohlc (open , high , low , close , direction ,
2630
2630
** kwargs )
2631
- if dates :
2631
+ if dates is not None :
2632
2632
TraceFactory .validate_equal_length (open , high , low , close , dates )
2633
2633
else :
2634
2634
TraceFactory .validate_equal_length (open , high , low , close )
@@ -2683,10 +2683,8 @@ def __init__(self, open, high, low, close, dates, **kwargs):
2683
2683
self .low = low
2684
2684
self .close = close
2685
2685
self .empty = [None ] * len (open )
2686
- if dates :
2687
- self .dates = dates
2688
- else :
2689
- self .dates = None
2686
+ self .dates = dates
2687
+
2690
2688
self .all_x = []
2691
2689
self .all_y = []
2692
2690
self .increase_x = []
@@ -2709,7 +2707,7 @@ def get_all_xy(self):
2709
2707
"""
2710
2708
self .all_y = list (zip (self .open , self .open , self .high ,
2711
2709
self .low , self .close , self .close , self .empty ))
2712
- if self .dates :
2710
+ if self .dates is not None :
2713
2711
date_dif = []
2714
2712
for i in range (len (self .dates ) - 1 ):
2715
2713
date_dif .append (self .dates [i + 1 ] - self .dates [i ])
@@ -2780,7 +2778,7 @@ def __init__(self, open, high, low, close, dates, **kwargs):
2780
2778
self .high = high
2781
2779
self .low = low
2782
2780
self .close = close
2783
- if dates :
2781
+ if dates is not None :
2784
2782
self .x = dates
2785
2783
else :
2786
2784
self .x = [x for x in range (len (self .open ))]
0 commit comments