From 00f4b4af4290fffe645c7e21ff61c1dfd0ccda9f Mon Sep 17 00:00:00 2001 From: kootsZhin <69758390+kootsZhin@users.noreply.github.com> Date: Thu, 23 May 2024 20:50:39 +0800 Subject: [PATCH] add vcedge to `make_marketcolors()` --- src/mplfinance/_styles.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mplfinance/_styles.py b/src/mplfinance/_styles.py index 84eb7fd5..ea638d25 100644 --- a/src/mplfinance/_styles.py +++ b/src/mplfinance/_styles.py @@ -260,6 +260,13 @@ def _valid_make_marketcolors_kwargs(): or isinstance(value,str) or _mpf_is_color_like(value) }, + 'vcedge' : { 'Default' : None, + 'Description' : "color of volume bars edge; may be single color,"+ + " or may be dict with keys 'up' and 'down'", + 'Validator' : lambda value: isinstance(value,dict) + or isinstance(value,str) + or _mpf_is_color_like(value) }, + 'vcdopcod' : { 'Default' : False, 'Description' : 'True/False volume color depends on price change from previous day', 'Validator' : lambda value: isinstance(value,bool) }, @@ -294,6 +301,8 @@ def make_marketcolors(**kwargs): if ohlc == "inherit" then use up/down colors. volume = color of volume bars when all the same color; if volume == "inherit" then use up/down colors. + vcedge = color of volume bars edge when all the same color; + if volume == "inherit" then use up/down colors. ''' config = _process_kwargs(kwargs, _valid_make_marketcolors_kwargs()) @@ -336,7 +345,7 @@ def _check_and_set_mktcolor(candle,**kwarg): candle = marketcolors['candle'] - for kw in ['edge','volume','ohlc','wick']: + for kw in ['edge','volume','ohlc','wick','vcedge']: # `inherit=True` takes precedence: if config[kw] is not None or config['inherit'] == True: if config['inherit'] == True: