I am facing an issue with TradeBar object, and it shows that it has no attribute.
I am currently working on equity data for Daily resolution, and I am fetching the data from my local system.
Can you provide any solution or suggestion what I should do to solve this issue?
The Error I am facing is below:
ERROR:: Runtime Error: 'TradeBar' object has no attribute 'IsReady'
at OnData
if not symbol_data.IsReady:
at Python.Runtime.PythonException.ThrowLastAsClrException()
at Python.Runtime.PyObject.Invoke(PyTuple args in main.py
'TradeBar' object has no attribute 'IsReady'
at OnData
if not symbol_data.IsReady:
at Python.Runtime.PythonException.ThrowLastAsClrException()
at Python.Runtime.PyObject.Invoke(PyTuple args in main.py
Mia Alissi
The error message you're seeing is indicating that the 'TradeBar' object does not have an 'IsReady' attribute. The 'TradeBar' object has the following attributes:
Open
,High
,Low
,Close
,Volume
,Time
,EndTime
, andSymbol
.The 'IsReady' attribute is typically used with indicators to check if the indicator is ready to be used (i.e., it has received enough data points to start producing accurate values). If you're trying to check if the 'TradeBar' data is ready, you might want to check if the 'TradeBar' object is not None instead.
Here's an example of how you can do this:
This code checks if the 'TradeBar' data for the given symbol exists in the 'data' object, and if it does, it assigns the 'TradeBar' data to the 'tradeBar' variable. Then it checks if 'tradeBar' is not None before proceeding with the rest of the code. This ensures that the 'TradeBar' data is ready to be used.
Please revise your code accordingly. If you continue to have issues, please provide more specific details about the problems you are encountering.
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.
Khushbu Shah
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!