@@ -76,7 +76,7 @@ def _check_params(self, params):
7676 def I (self , # noqa: E741, E743
7777 func : Callable , * args ,
7878 name = None , plot = True , overlay = None , color = None , scatter = False ,
79- ** kwargs ) -> np .ndarray :
79+ legends = None , ** kwargs ) -> np .ndarray :
8080 """
8181 Declare indicator. An indicator is just an array of values,
8282 but one that is revealed gradually in
@@ -105,6 +105,10 @@ def I(self, # noqa: E741, E743
105105 If `scatter` is `True`, the plotted indicator marker will be a
106106 circle instead of a connected line segment (default).
107107
108+ `legends` can be list or array of string values to represent
109+ legends on your indicator chart. By default it's set to None,
110+ and `name` is used as legends.
111+
108112 Additional `*args` and `**kwargs` are passed to `func` and can
109113 be used for parameters.
110114
@@ -151,7 +155,7 @@ def init():
151155 overlay = ((x < 1.4 ) & (x > .6 )).mean () > .6
152156
153157 value = _Indicator (value , name = name , plot = plot , overlay = overlay ,
154- color = color , scatter = scatter ,
158+ color = color , scatter = scatter , legends = legends ,
155159 # _Indicator.s Series accessor uses this:
156160 index = self .data .index )
157161 self ._indicators .append (value )
0 commit comments