Assume we are using ImmediateExecutionModel and CompositeRiskManagementModel combining MaximumUnrealizedProfitPercentPerSecurity and MaximumDrawdownPercentPerSecurity.
If I emit an Insight, there will be a market order submitted. There are three possibility about how this position will be closed:
1. hit the target (the maximum unrealized profit);
2. hit the stop (the maximum drawdown);
3. the time is up (the insight length expires).
I want to keep track of whether every trade is a winner or a loser. My question is: how do I keep track of the three possible closes of a trade in an Alpha? Rewrite the risk management model? I can't seem to find where it is done. I also think about trying OnOrderEvent, but it is under the QCAlgorithm, not the AlphaModel. I'm unable to find a way to pass variables between them because I don't understand how the class AlphaModel works deeper inside. Any suggestions is appreciated!
Jared Broad
Hey Honglu! Our vision is that the modules will be completely interchangeable which will allow a marketplace of modules -- where you can substitute in a module and it will work seamlessly. In order for that to happen the modules need absolute separation of concerns. The Alpha should not be aware of fills or interested in their results. It should purely emit signals based on the best prediction at that moment.
We do not restrict your development -- if you wish to design in the classic format its fine! Classic is simpler but less portable code.
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.
Honglu Fan
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!