@@ -10,21 +10,21 @@ def _get_widths_df():
10
10
and observing which numbers gave the "best" appearance.
11
11
'''
12
12
numpoints = [n for n in range (30 ,241 ,30 )]
13
- #volume_width = (0.95, 0.90, 0.85, 0.80, 0.75, 0.70, 0.65, 0.60 )
14
- #volume_width = (0.95, 0.925, 0.90, 0.875, 0.85, 0.825, 0.80, 0.775 )
15
13
volume_width = (0.98 , 0.96 , 0.95 , 0.925 , 0.9 , 0.9 , 0.875 , 0.825 )
16
14
volume_linewidth = tuple ([0.65 ]* 8 )
17
- candle_width = (0.65 , 0.575 , 0.50 , 0.425 , 0.350 , 0.312 , 0.312 , 0.321 )
18
- candle_linewidth = (1.00 , 0.875 , 0.75 , 0.625 , 0.500 , 0.438 , 0.438 , 0.438 )
15
+ candle_width = (0.65 , 0.575 , 0.50 , 0.445 , 0.435 , 0.425 , 0.420 , 0.415 )
16
+ candle_linewidth = (1.00 , 0.875 , 0.75 , 0.625 , 0.500 , 0.438 , 0.435 , 0.435 )
19
17
ohlc_tickwidth = tuple ([0.35 ]* 8 )
20
18
ohlc_linewidth = (1.50 , 1.175 , 0.85 , 0.525 , 0.525 , 0.525 , 0.525 , 0.525 )
19
+ line_width = (2.00 , 1.600 , 1.15 , 0.720 , 0.715 , 0.710 , 0.705 , 0.700 )
21
20
widths = {}
22
21
widths ['vw' ] = volume_width
23
22
widths ['vlw' ] = volume_linewidth
24
23
widths ['cw' ] = candle_width
25
24
widths ['clw' ] = candle_linewidth
26
25
widths ['ow' ] = ohlc_tickwidth
27
26
widths ['olw' ] = ohlc_linewidth
27
+ widths ['lw' ] = line_width
28
28
return pd .DataFrame (widths ,index = numpoints )
29
29
30
30
_widths = _get_widths_df ()
@@ -39,6 +39,9 @@ def _valid_scale_width_kwargs():
39
39
40
40
'candle' : { 'Default' : None ,
41
41
'Validator' : lambda value : isinstance (value ,(float ,int )) },
42
+
43
+ 'lines' : { 'Default' : None ,
44
+ 'Validator' : lambda value : isinstance (value ,(float ,int )) },
42
45
}
43
46
_validate_vkwargs_dict (vkwargs )
44
47
return vkwargs
@@ -63,6 +66,9 @@ def _valid_update_width_kwargs():
63
66
64
67
'candle_linewidth' : { 'Default' : None ,
65
68
'Validator' : lambda value : isinstance (value ,(float ,int )) },
69
+
70
+ 'line_width' : { 'Default' : None ,
71
+ 'Validator' : lambda value : isinstance (value ,(float ,int )) },
66
72
}
67
73
_validate_vkwargs_dict (vkwargs )
68
74
return vkwargs
@@ -91,6 +97,7 @@ def _determine_width_config( xdates, config ):
91
97
width_config ['ohlc_linewidth' ] = None
92
98
width_config ['candle_width' ] = avg_dist_between_points / 2.0
93
99
width_config ['candle_linewidth' ] = None
100
+ width_config ['line_width' ] = None
94
101
95
102
else : # config['width_adjuster_version'] == 'v1'
96
103
@@ -100,16 +107,19 @@ def _determine_width_config( xdates, config ):
100
107
width_config ['ohlc_linewidth' ] = _dfinterpolate (_widths ,datalen ,'olw' )
101
108
width_config ['candle_width' ] = _dfinterpolate (_widths ,datalen ,'cw' ) * adjust
102
109
width_config ['candle_linewidth' ] = _dfinterpolate (_widths ,datalen ,'clw' )
110
+ width_config ['line_width' ] = _dfinterpolate (_widths ,datalen ,'lw' )
103
111
104
112
if config ['scale_width_adjustment' ] is not None :
105
113
106
114
scale = _process_kwargs (config ['scale_width_adjustment' ],_valid_scale_width_kwargs ())
107
115
if scale ['volume' ] is not None :
108
- width_config ['volume_width' ] *= scale ['volume' ]
116
+ width_config ['volume_width' ] *= scale ['volume' ]
109
117
if scale ['ohlc' ] is not None :
110
118
width_config ['ohlc_ticksize' ] *= scale ['ohlc' ]
111
119
if scale ['candle' ] is not None :
112
- width_config ['candle_width' ] *= scale ['candle' ]
120
+ width_config ['candle_width' ] *= scale ['candle' ]
121
+ if scale ['lines' ] is not None :
122
+ width_config ['line_width' ] *= scale ['lines' ]
113
123
114
124
115
125
if config ['update_width_config' ] is not None :
0 commit comments