Hello fellows, I´m new in here and I a question:
I am not sure what is the error. I tried to compute SCTR (from stockcharts) using a dataframe built with self.History. I tried to use setHoldings to execute the trade but I faced the following error:
Runtime Error: IndexingError : Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match).
at check_bool_indexer
"Unalignable boolean Series provided as "
File "indexing.py" in indexing.py:line 2409
IndexingError : Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match). (Open Stacktrace)
Need help in understanding what's the error I'm facing here
Thanks a lot!!
Louis Szeto
Hi Ang
I think this link has the definition of SCTR. So I'll use QC indicator to create one. Owing to bunches of indicator usage, I've created a new class object for easy and clear manipulation. Using indicators and rolling window will save you lots of time/space from memory leaks in pandas dataframe (repeated call history).
I attached backtest with some basics codes only. You can modify by your need.
Cheers
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.
Louis Szeto
Amendment:
Also need to include the update method for renewal of PPO's rolling window:
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.
Varad Kabade
Hi Ang Jin Wei and Louis,
Thank you, Louis, for your response the logic for SCTR. Moving forward, we have implemented the above SCTR logic into a custom python indicator. Refer to the attached backtest for reference.
Best,
Varad Kabade
Aaron Eller
Hi Ang Jin Wei, Louis, and Varad,
I recently had a client have me work on an algo with this indicator. He mentioned this post, so I was looking at the codes provided to save some time implementing it. I noticed a few things that need updated for this indicator:
To see my implementation of the custom indicator, see the “stockcharts_technical_rank” file in the attached backtest. I just added my implementation as a separate file to Varad's backtest. NOTE: it's not using my implementation. I like to use a standard structure where I have a SymbolData class that holds all indicators. It was significantly different, so I thought I'd just share the SCTR indicator class. Hope it's helpful.
Best,
Aaron
Ang Jin Wei
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!