---
title: "Comment by Jing Li on \"Generating Buy and Sell Signals for SMA, MACD, and Bollinger-Bands with Python\" | Hashnode"
description: "Hello Thank you! It is well written! I want a bit more information on the two points below: When I run the code to To visualize the MACD histogram we create a s"
url: "https://hashnode.com/posts/generating-buy-sell-signals-using-python/61241129663d427e19ff8e26/comment/6245d2cad1ff58fbe6947f52"
---

[Discussion](https://hashnode.com/posts/generating-buy-sell-signals-using-python/61241129663d427e19ff8e26)

Comment [Generating Buy and Sell Signals for SMA, MACD, and Bollinger-Bands with Python](https://hashnode.com/posts/generating-buy-sell-signals-using-python/61241129663d427e19ff8e26)

[Jing Li](https://hashnode.com/@JingL)

[Mar 31, 2022](https://hashnode.com/posts/generating-buy-sell-signals-using-python/61241129663d427e19ff8e26/comment/6245d2cad1ff58fbe6947f52)

Hello Thank you! It is well written! I want a bit more information on the two points below:

1.  When I run the code to To visualize the MACD histogram we create a simple function to insert a boolean column. It showed me -1 is not in range. I don't know how to fix it.
2.  Is it possible to set your own short-term and long-term range, for example, 3 days and 7 days? I want to use it for my research project. Would be interesting to check how it works.

Thank you! Jing L

[Utkarsh singhal](https://hashnode.com/@utkarsh060)

[Apr 2, 2022](https://hashnode.com/posts/generating-buy-sell-signals-using-python/61241129663d427e19ff8e26/comment/6245d2cad1ff58fbe6947f52#reply-6248211f4b4dde0dc0be6811)

Hi Jing,

1.  It would be great if you could give a more elaborate description of the error you're facing with a screenshot.
2.  Yes it's possible, you can configure the time period while generating the MACD using ta,

Here: ta.macd(data\['Close'\], \*\*)

Thanks
