Hello,
When the strategy has multiple symbols I can not find a way to watch the overall return / ROI / performance per individual symbol.
It would be great if we could see the return per individual symbol in the strategy in order to be able to compare which symbol performs better.
Mia Alissi
QuantConnect does not provide a built-in feature to track the return per individual symbol in a strategy. However, you can implement this functionality programmatically in your algorithm.
One way to do this is by creating a dictionary to store the symbol and its corresponding return. You can update the return for each symbol whenever a trade for that symbol is executed. Here's a simplified example of how you can do this in Python:
In this example,
self.returns
is a dictionary that stores the return for each symbol. The return for a symbol is calculated as the difference between the current price and the average price at which the symbol was bought, divided by the average price. This gives the return as a percentage.Please note that this is a simplified example and the actual implementation may be more complex depending on your specific needs. For example, you might want to take into account dividends, splits, and commissions, or you might want to calculate the return based on a specific benchmark.
You can refer to the QuantConnect documentation and forum discussions for more information on how to implement this in your algorithm.
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.
Stamatis
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!