Skip to content

Display multiple lines in indicator plot #665

Answered by kernc
botradingblog1 asked this question in Q&A
Discussion options

You must be logged in to vote

Quoting the API reference for Strategy.I:

func is a function that returns the indicator array(s) of same length as Strategy.data.

You can simply return a sequence of arrays to have them contained in the same indicator plot:

self.macd = self.I(lambda *args: (MACD(*args), MACD_SIGNAL(*args)),
                   self.data.df, self.macd_1_fast, self.macd_1_slow, self.macd_1_signal)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@botradingblog1
Comment options

Answer selected by botradingblog1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants