backtesting.py icon indicating copy to clipboard operation
backtesting.py copied to clipboard

Plotting horizontal lines (support and resistence)

Open arturnawrot opened this issue 3 years ago • 1 comments

As the title says: is it possible to plot horizontal lines? Seems like docs don't mention anything about it, and I have seen _plotting.py and I don't think it would be possible.

arturnawrot avatar May 22 '22 20:05 arturnawrot

You can plot a single line by way of vectors of all y s:

def init(self):
    support = 30000
    self.I(lambda: np.repeat(support, len(self.data)), name='support line')

kernc avatar May 22 '22 21:05 kernc