I'm new to the site, but not new to quant strategies. I'm trying to apply my ideas using the QC models for construction, execution, etc. What I'm trying to accomplish is to go long, and liquidate a stock when my indicator goes below 0. As long as it's positive, stay in, and once it goes below 0, flat the stock until the indicator goes positive.
Using the provided equal weighting model, the stocks aren't being held. The model is buying one day and selling the next, not holding. Do I need to use the construction and execution models provided to get my alpha approved, or can I implement my own strategy in my QCAlgorithm class with OnData and onSecuritiesChanged?
Is the only coding requirement that I have these?
//1. Required: Five years of backtest history
SetStartDate(2014, 1, 1);
//2. Required: Significant AUM Capacity
SetCash(5000000);
//3. Required: Alpha Streams Models:
SetBrokerageModel(BrokerageName.AlphaStreams);
I'm leaving out Alpha score and Sharpe, etc, since those are part of the review.
Just talking from a coding perspective.
Alexandre Catarino
Hi Tim Bohmann ,
The EqualWeightingPortfolioConstructionModel (EWPCM) creates a portfolio target while there is an Insight that supports that decision. It means that once the insight expires, the EWPCM creates a zero-quantity portfolio target that leads to position liquidation.
If the Alpha Model emits insights with a large period, say 10 days, if it emits two insights in different days, one with Up direction and another with Flat, the newest one will be taken into account and the oldest one only when the other expiry. Since the oldest one will expiry sooner, we can consider it was replaced. Example:
Day 1: Emit Up Insight for SPY with 10-day period.
All portfolio value is allocated to SPY
Day 4: Emit Flat Insight for SPY with 10-day period.
Liquidate SPY
Day 11: First Insight expires.
Day 15: Second Insight expires.
Another example:
Day 1: Emit Up Insight for SPY with 10-day period.
All portfolio value is allocated to SPY
Day 4: Emit Flat Insight for SPY with 2-day period.
Liquidate SPY
Day 6: Second Insight expires, First insight is valid:
All portfolio value is allocated to SPY
Day 11: First Insight expires.
Liquidate SPY
Knowing the EWPCM mechanics, you can write the Alpha Model that produces the desired results.Â
Tim Bohmann
This is invaluable information to me. It really helps explain some of the mechanics going on "under the hood". I can see now how this can be used to time the insights for a particular type of strategy.
Thanks Alexandre!
Tim Bohmann
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!