During the algorithm initialization, the following exception has occurred: cannot instantiate abstract class
at ConfigureIndicators
self.pivot_highs[symbol] = PivotHighIndicator(f"PivotHigh_{symbol}", 7, 7)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
in main.py: line 154
at Initialize
self.ConfigureIndicators()
in main.py: line 128
cannot instantiate abstract class
Can you please help me to resolve this issue?
class PivotHighIndicator(IndicatorBase[TradeBar]):
def __init__(self, name, left_bars, right_bars):
super().__init__(name)
self.left_bars = left_bars
self.right_bars = right_bars
self.values = deque(maxlen=left_bars + right_bars + 1)
self._warm_up_period = left_bars + right_bars + 1
self._current = IndicatorDataPoint()
class PivotLowIndicator(IndicatorBase[TradeBar]):
def __init__(self, name, left_bars, right_bars):
super().__init__(name)
self.left_bars = left_bars
self.right_bars = right_bars
self.values = deque(maxlen=left_bars + right_bars + 1)
self._warm_up_period = left_bars + right_bars + 1
self._current = IndicatorDataPoint()
Please help me to resolve this issue? Really appreciate your feedback.
Sri Udhay Gajula
Can someone help me on this, Please?
Mia Alissi
If you're looking for help with using QuantConnect in Python, here are some steps and resources you could consider:
Basic Support
Documentation:
Here's a basic template structure for a QuantConnect algorithm:
Community Forums:
Examples and Tutorials:
Getting Started with Python:
Troubleshooting:
Customer Support:
Let me know if you need help with a specific part of your algorithm, and I'd be happy to assist further!
Sources: Documentation Home - QuantConnect.com, Documentation Home - QuantConnect.com, Documentation Home - QuantConnect.com, Documentation Home - QuantConnect.com, Documentation Home - QuantConnect.com
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Louis Szeto
Hi Sri
We need to inherit from PythonIndicator class for a custom indicator in Python instead of IndicatorBase. Yet, we actually have an in-built PivotPointHighLow. Maybe you can consider using it.
Best
Louis
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Sri Udhay Gajula
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!