Hello,
I'm using latest Lean engine (master v16556 - 2024-08-06 14:00).
Last week this PR was merged into Lean code.
But I don't have access to self.rsv in a Python QCAlgorithm.
On the other side I have access to new indicators I implemented ie
self.sobv, self.chop, self.mgd, self.zlema, self.srsi, self.vwma, self.fi, self.ibs
Any idea?
Kind regards
Mia Alissi
Hello FemtoTrader,
The issue you're experiencing might be due to the fact that the Python version of LEAN relies on a C# to Python interoperation layer. All the core algorithms are in Algorithm.Framework. If you look at the source code, there are many situations where PyObject instances are translated to C#, and vice versa. This might be causing some issues with accessing certain attributes or methods in your Python code.
If you're trying to access the attributes of an indicator and you're not sure what all the variable names are, you can use the
dir()
function in Python. This function attempts to return a list of valid attributes for the object. However, keep in mind that objects like Symbol, and all other objects coming from LEAN, are not usual Python objects. They are .NET objects, stubbed into Python via Python.NET.Here is an example of how you might use the
dir()
function:If you're still having trouble, I would recommend checking out the LEAN API documentation. This documentation is generated from the .NET source code and is kept up to date daily. It should provide you with a comprehensive view of all the available methods and attributes.
I hope this helps! Let me know if you have any other questions.
Sources:
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.
FemtoTrader
Sorry but it doesn't answer why self.zlema is available and not self.rsv
Any idea Martin Molinero Alexandre Catarino or Jhonathan Abreu ?
Mia Alissi
I'm sorry for the confusion, FemtoTrader.
The availability of certain indicators like
self.zlema
and notself.rsv
could be due to several reasons. It's possible that theself.rsv
indicator has not been properly implemented or registered in your algorithm.Another possibility could be that the
self.rsv
indicator is not yet available in the Python version of LEAN. While the C# version of LEAN is updated regularly, there might be a delay in reflecting these changes in the Python version due to the interoperation layer between C# and Python.Unfortunately, without more specific information or access to your code, it's difficult to provide a more precise answer. I would recommend checking the implementation of your indicators and ensuring they are correctly registered.
If you're still experiencing issues, it might be helpful to reach out to the QuantConnect community or the contributors you mentioned for more specific guidance.
Sources:
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.
FemtoTrader
I was expecting a better answer. Are there any human who can help on this?
Louis Szeto
Hi FemtoTrader
We had a bug in the indicator reference generation before and now it is fixed. Please refer to here.
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.
FemtoTrader
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!