Hi,
I just looked at the optimization tool and am confused on if/how I would use for my intent. I have a strategy that leverages a set of price conditions to take trades. I then look at indicators to see if certain ones can enhance performance. For example I use bollinger band width (BBW) and I ultimately want to see which range of BBW values are optimal (which support the most winning trades). I see how to optimize the BBW inputs such as period but I want to optimize the BBW values themselves (i.e. I set the inputs and the values are derived at my signals). Is that possible?
On a related note, another way to test is to export the completed trades and logged indicator values. How would I go about logging and exporting that information?
Mia Alissi
To optimize the Bollinger Band Width (BBW) values in your strategy, you can follow these steps:
Set Up Optimization Parameters: Use QuantConnect's parameter system to define the BBW values as parameters in your algorithm. This involves setting up a configuration file (
config.json
) where you specify the parameters you want to optimize. For example:In your algorithm, retrieve these parameters using
self.get_parameter("bbw-period")
andself.get_parameter("bbw-multiplier")
.Use the Optimization Tool: Utilize QuantConnect's optimization tool to run multiple backtests with different BBW values. You can configure the optimization to vary these parameters and analyze which values yield the best performance.
Log Indicator Values: Implement logging within your algorithm using the
Log
method to record BBW values and other relevant metrics during the backtest. Here's an example of how to use theLog
method:Export Completed Trades: After running the backtest, you can export completed trades and logged indicator values. Use the
History
method to retrieve historical trade data and export it for further analysis.Analyze Results: Load the optimization results into the Research Environment to analyze how different BBW values affected the algorithm's performance.
Iterate and Refine: Based on the analysis, refine your BBW value range and repeat the optimization process to further hone in on optimal values.
Implement in Live Strategy: Once optimal BBW values are identified, implement them in your live trading strategy for improved performance.
If you need further assistance with specific code examples or configurations, feel free to ask!
Sources: Walk Forward Optimization - QuantConnect.com, Bitcoin as a Leading Indicator, Bollinger Bands - QuantConnect.com, Key Concepts - QuantConnect.com, Data Point Indicators - QuantConnect.com
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.
Taylor Jorgensen
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!