Currently, QuantConnect does not have access to market breadth indexes, such as the $ADD , $TICK and $TRIN. However, being as that QC has access to the data for all of the underlying equities that comprise these indexes, I am holding out hope that it is possible to re-create them in QC.
For example with the $ADD, is there an easy way to implement something like:
Step1: Create array NYSE{"Symbol.1", "Symbol.2", "Symbol.3", ... } containing all equities traded on the NYSE.
Step2: Create a new array ADD{ } that will contain boolean values that corresponed to the index elements in NYSE{ }
Step3: Compare current price of NYSE{"Symbol.1"} with previous price of NYSE{"Symbol.1"}.
Step4: if current price of NYSE{"Symbol.1"} is greater than previous price NYSE{"Symbol.1"}, then ADD{0}==true else if current price of NYSE{"Symbol.1"} is less than previous NYSE{"Symbol.1"} then ADD{0}==false.
Etc. Resulting in a fully updated array of boolean values: ADD{true, true, false, ...}
Thanks in advance for any help.
Derek Melchin
Hi Zwi,
It's not currently possible to determine if a security is trading on NYSE or another exchange during a backtest. Since we don't have data on index membership, we have built a custom universe that mimics the S&P 500 index. Refer to QC500 index source code here.
In regards to limiting a universe to securities with positive returns over the last day, we can add a RateOfChange indicator to our universe selection method. The EmaCrossUniverseSelectionAlgorithm is a great example which demonstrates using a technical indicator inside a universe selection model.
Best,
Derek Melchin
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.
Zwi Trader
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!