Hi There,
Have just created a testing algo. It has the following features:
- Universe selection based on fundamental data
- Alpha Model: Creates just buy-insights, for stocks added into the universe, but doesn't sell the removed stocks since that's the job of the Stop Loss (Risk management). So, the portfolio keeps just growing in number of securities, until a stock hits stop loss
- Portfolio construction: It allocates equal capital to the securities depending on the number of securities. So if total portfolio is 200k and there are 10 securities then allocates 20k to each security. if the security had 25k in stock, then it would just sell 5k on stock to balance the equation.
- Risk management model: creates a soft take profit that does not close the trade, but rather updates the trailing stop loss.
- Execution model Immediate
The problem here is that although my portfolio rebalances every month, i do need to execute sell orders as soon as the price of the security hits the stop loss. In this case, they just execute the sell order at the beginning of the next month when the whole rebalancing happens.
Why's that?
Lucas
Hey Jose
I think you have to do something like this instead. The problem is in the RiskManagement, and not the execution
I did not check if it works 100% as you intended (tight schedule on a saturday ;) '
Have a good day
Lucas
Louis Szeto
Hi Jose and Lucas
The main problem is the data resolution is daily, so bars are received at the end of the day. Any stop-loss order has to wait until the next day's opening to be submitted. Since the framework models are using that data bar received to update, for more “real-time” stop-loss, we recommend a denser resolution like minute or second.
Although the Risk Management Model would generate portfolio targets that will close the positions with market orders "mimicking" a stop loss, the insight is still active. Thus, it will re-order the stop-loss asset. Please refer to this thread on how to stop loss using the framework.
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.
Jose David Delgado Mosquera
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!