@@ -32,7 +32,8 @@ def test_renko01(bolldata):
3232 tname = os .path .join (tdir ,fname )
3333 rname = os .path .join (refd ,fname )
3434
35- mpf .plot (df ,type = 'renko' , volume = True ,savefig = tname )
35+ fig_axis = mpf .plot (df ,type = 'renko' ,volume = True ,savefig = tname ,returnfig = True )
36+ plt .close (fig_axis [0 ])
3637
3738 tsize = os .path .getsize (tname )
3839 print (glob .glob (tname ),'[' ,tsize ,'bytes' ,']' )
@@ -54,8 +55,9 @@ def test_renko02(bolldata):
5455 tname = os .path .join (tdir ,fname )
5556 rname = os .path .join (refd ,fname )
5657
57- mpf .plot (df ,type = 'renko' , renko_params = dict (brick_size = 4 ), volume = True , savefig = tname )
58-
58+ fig_axis = mpf .plot (df ,type = 'renko' ,renko_params = dict (brick_size = 4 ),volume = True ,savefig = tname ,returnfig = True )
59+ plt .close (fig_axis [0 ])
60+
5961 tsize = os .path .getsize (tname )
6062 print (glob .glob (tname ),'[' ,tsize ,'bytes' ,']' )
6163
@@ -76,8 +78,9 @@ def test_renko03(bolldata):
7678 tname = os .path .join (tdir ,fname )
7779 rname = os .path .join (refd ,fname )
7880
79- mpf .plot (df ,type = 'renko' , renko_params = dict (brick_size = 'atr' , atr_length = 2 ), volume = True , savefig = tname )
80-
81+ fig_axis = mpf .plot (df ,type = 'renko' ,renko_params = dict (brick_size = 'atr' ,atr_length = 2 ),volume = True ,savefig = tname ,returnfig = True )
82+ plt .close (fig_axis [0 ])
83+
8184 tsize = os .path .getsize (tname )
8285 print (glob .glob (tname ),'[' ,tsize ,'bytes' ,']' )
8386
@@ -97,8 +100,9 @@ def test_renko04(bolldata):
97100 tname = os .path .join (tdir ,fname )
98101 rname = os .path .join (refd ,fname )
99102
100- mpf .plot (df ,type = 'renko' , renko_params = dict (brick_size = 'atr' , atr_length = 'total' ), mav = (8 ,20 ,30 ), volume = True , savefig = tname )
101-
103+ fig_axis = mpf .plot (df ,type = 'renko' ,renko_params = dict (brick_size = 'atr' ,atr_length = 'total' ),mav = (8 ,20 ,30 ),volume = True ,savefig = tname ,returnfig = True )
104+ plt .close (fig_axis [0 ])
105+
102106 tsize = os .path .getsize (tname )
103107 print (glob .glob (tname ),'[' ,tsize ,'bytes' ,']' )
104108
@@ -108,4 +112,14 @@ def test_renko04(bolldata):
108112 result = compare_images (rname ,tname ,tol = IMGCOMP_TOLERANCE )
109113 if result is not None :
110114 print ('result=' ,result )
111- assert result is None
115+ assert result is None
116+
117+ def test_renkovalues (bolldata ):
118+
119+ df = bolldata
120+
121+ rcv = {}
122+ fig_axis = mpf .plot (df ,type = 'renko' ,return_calculated_values = rcv ,returnfig = True )
123+ plt .close (fig_axis [0 ])
124+
125+ assert rcv ['renko_bricks' ][- 1 ] == 133.919998
0 commit comments