Skip to content

Commit 5c8a0af

Browse files
committed
DOC: Explain that Strategy.I can return a tuple of array
Fixes #1174
1 parent 01e0a5d commit 5c8a0af

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

backtesting/backtesting.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ def I(self, # noqa: E743
8383
name=None, plot=True, overlay=None, color=None, scatter=False,
8484
**kwargs) -> np.ndarray:
8585
"""
86-
Declare an indicator. An indicator is just an array of values,
86+
Declare an indicator. An indicator is just an array of values
87+
(or a tuple of such arrays in case of, e.g., MACD indicator),
8788
but one that is revealed gradually in
8889
`backtesting.backtesting.Strategy.next` much like
8990
`backtesting.backtesting.Strategy.data` is.
@@ -94,7 +95,7 @@ def I(self, # noqa: E743
9495
9596
In the plot legend, the indicator is labeled with
9697
function name, unless `name` overrides it. If `func` returns
97-
multiple arrays, `name` can be a sequence of strings, and
98+
a tuple of arrays, `name` can be a sequence of strings, and
9899
its size must agree with the number of arrays returned.
99100
100101
If `plot` is `True`, the indicator is plotted on the resulting

0 commit comments

Comments
 (0)