Please note this blog was originally published on April 19, 2024.
Welcome to a new era of algorithmic trading, where complexity meets accessibility, and precision is attainable without the burdens of coding expertise.
In this article, Phoenix Copilot aims to transform the landscape of trading strategy development by harnessing the power of Generative AI.
Introduction: Redefining Algorithmic Trading
Algorithmic trading has long been a domain of the technically proficient, demanding hours of coding, debugging, and refining strategies. However, Phoenix Copilot, powered by Generative AI, seeks to transform this arena. It offers traders, both seasoned and novice, a sophisticated and user-friendly platform to create, optimize, and implement trading strategies without the need for extensive coding skills.
The Phoenix Copilot Interface: Your Gateway to Trading Excellence
When you log in to your AlgoBulls account, you'll discover the Phoenix option in the side menu. Within this interface, five distinct options await your exploration. In this blog post, our focus centers on the 'Create Using AI' feature, which is also called “Phoenix Copilot”, a remarkable innovation that leverages Gen AI technology to streamline strategy development. While the other four options hold their significance, we have addressed them separately in dedicated articles here.
Our AI is trained on hundreds of strategies that were created from scratch by our team. These strategies have been successfully tested not just for Backtesting but also on billions of dollars worth of Live Trading.
Commencing Your Journey
To begin your algorithmic trading journey using our Gen AI, you simply need to purchase one of our plans. To begin with, you can get our FREE “Starter Phoenix Plan” so that you can explore Gen AI and its features before diving deep into it. Once comfortable, you can get our “Advanced Phoenix Plan” to create amazing strategies using your ideas.
Once you have the plan activated, please ensure to add your Alpaca broking account since that is required to perform Backtesting and other execution modes. To know how to add your broker, you can read our documentation or simply follow the steps given below:
- Go to the “Broking Details” page on the left menu.
- Click on the “Add Broker” button on the top-right of the page.
- Search for “Alpaca” in the search bar and choose your preferred option.
- Authorize AlgoBulls to access your Alpaca account.
- Continue your strategy creation process once you are redirected back to the AlgoBulls platform.
Embarking on your Gen AI Session
Once you click on the “Create using AI” option, you'll encounter a history panel on the left-hand side, displaying your previous sessions and chats. Here, you can choose to continue where you left off or initiate a fresh strategy development session by clicking "New Session".
Crafting Your Vision
Each new session grants you the flexibility to select from a range of pre-made prompts from our prompt library, tailoring them to your specific requirements. This feature significantly reduces the effort needed for strategy creation. Alternatively, for those seeking a more customized approach, you can compose your prompts to generate strategy code.
Now, let’s dive into understanding the flow of creating and validating your strategy using Phoenix Copilot.
Step 1 - Choose your prompt
Once you have chosen your prompt, you can copy-paste it from the Prompt Library or type in the chat box and press Enter or click on the Generate button. The AlgoBulls core along with Generative AI will analyze your prompt to create the expected strategy with highest possible accuracy. It takes a few seconds to a minute to generate the output depending on your prompt.
You will see a section that is generated as a result. This contains the code of your strategy along with the necessary parameters and an explanation of the generated code.. AlgoBulls AI is smart enough to give you the necessary parameters too for the strategy to function properly. Make sure to analyze the code and parameters manually first.
While AI can assist you in creating your trading strategy, it's important to view it as a helpful partner rather than a flawless solution. It's like having a smart assistant. For more complex strategies, AI can get you up to 90% accuracy, but reaching the final 100% might require some additional effort. In other words, AI is a great tool, but it's not perfect.
Step 2 - Validate your strategy
Once your strategy code is ready, you have the option to validate the strategy without leaving the chat window. To the right of the code box, you will see a section that says “Backtest config”. This section is meant to choose the most important factor for executing the strategy which is the instrument. Of course there are more but we take care of that on our end to get you started. (For the advanced user, you can modify it by clicking on “Advanced Customisations”. We are not covering it here to keep things simple.)
If you have already added your broker, you will see the name of your “Primary Broker” there or else you will get the option to add your broker in a new tab. In case you are adding your broker from the AI interface, make sure to click the refresh button so your broker is visible there.
Once done, click on “Randomise” to randomly select an instrument for backtesting the strategy. Alternatively, you can also type your preferred instrument in the dialog box and choose from the list of instruments available. Your primary broker will define the market for which you will get the instruments. If you are comfortable with the instrument chosen, you can proceed to validate your strategy by clicking on the “Backtest” button.
Step 3 - Backtest the strategy
The “Backtest” button gives you the option to choose your time frame for backtesting. You can choose between the last 3 months, 6 months and 1 year. The default time frame we use is 3 months.
Upon clicking the button, the AlgoBulls core will start executing the generated strategy on the backend for the selected time period. You will be able to see a progress bar to keep track of the execution.
Step 4 - Analyze the results
Post execution, you will receive the most important metrics to help you analyse the performance of the strategy. You can see Total Returns, Max Drawdown and Average Hit Ratio as the key metrics.
To further analyse the strategy, we have the option where you can see various charts. This will help you understand the critical path your strategy has taken to give you the result of the execution. You can check these charts by clicking on the “Show Chart” button below the performance metrics.
Additionally, you have the option to check advanced analytics by clicking on the “Get Advanced Analytics” button. This will open a pop up modal with all the advanced analytics, profit & loss report and user logs.
Step 5 - Optimize the strategy
Based on the analysis of the results, if you feel you can optimize the strategy even further, follow the entire flow again until you are satisfied with the outcome.
The best part of Phoenix Copilot is that you don’t have to go through the usual strategy creation-execution flow just to validate the strategy. You can backtest or paper trade and analyze the generated code right in the AI window and check if the strategy works the way you want to, thus saving a lot of your time and effort.To know more about the functionality of this AI generated code, refer to our article which explains strategy creation in depth or go to our doc site.
Next step of the process
If you are satisfied with the strategy code or the backtested results, you can proceed by clicking the “Advanced Customisation” button and then clicking the “Live Trade in Phoenix” button. This will open your strategy for you to take the next step of your execution journey which is deployment to Live Trading.
Final Step
With all the aspects of the strategy verified, your final step is to deploy your strategy for Live Trading with Alpaca. We recommend you to start with a small fund and then eventually as you feel comfortable with the outcome, you can increase your fund for better results. To know more about how you can optimize and deploy your strategy for live trading, you can read our blog “Validating and Configuring your Trading Strategy” that explains the process to optimize and then execute your strategy in Live Trading mode.
Conclusion: Empowering Traders with AI-Driven Efficiency
Phoenix Copilot, fueled by Generative AI, marks a new era of efficiency and accessibility in trading strategy development. Its user-friendly interface, coupled with AI-driven strategy creation, empowers you to explore, experiment, and optimize strategies with unprecedented ease. By simplifying the coding process, Phoenix Copilot opens doors for you to elevate your trading endeavors and seize opportunities in the dynamic world of financial markets.
If you're seeking a more detailed explanation of how to harness Generative AI, we invite you to explore our comprehensive documentation.Make sure to proceed reading the previous posts of this blog series here to understand Phoenix and seamless algorithmic trading.
With Phoenix, the future of algorithmic trading is in your hands. Harness its power, and let your trading potential soar to new heights.
Options trading is not suitable for all investors due to its inherent high risk, which can potentially result in significant losses. Please read Characteristics and Risks of Standardized Options before investing in options.
Alpaca Securities LLC and AlgoBulls are not affiliated and neither are responsible for the liabilities of the other.
Please note that this article is for educational and informational purposes only. All screenshots are for illustrative purposes only. The views and opinions expressed are those of the author and do not reflect or represent the views and opinions of Alpaca. Alpaca does not recommend any specific securities or investment strategies.
Alpaca does not prepare, edit, or endorse Third Party Content. Alpaca does not guarantee the accuracy, timeliness, completeness or usefulness of Third Party Content, and is not responsible or liable for any content, advertising, products, or other materials on or available from third party sites.
Securities brokerage services are provided by Alpaca Securities LLC ("Alpaca Securities"), member FINRA/SIPC, a wholly-owned subsidiary of AlpacaDB, Inc. Technology and services are offered by AlpacaDB, Inc.
This is not an offer, solicitation of an offer, or advice to buy or sell securities or open a brokerage account in any jurisdiction where Alpaca Securities are not registered or licensed, as applicable.
All investments involve risk and the past performance of a security, or financial product does not guarantee future results or returns. There is no guarantee that any investment strategy will achieve its objectives. Please note that diversification does not assure a profit, or protect against loss. There is always the potential of losing money when you invest in securities, or other financial products. Investors should consider their investment objectives and risks carefully before investing.
Past hypothetical backtest results do not guarantee future returns, and actual results may vary from the analysis.
The Paper Trading API is offered by AlpacaDB, Inc. and does not require real money or permit a user to transact in real securities in the market. Providing use of the Paper Trading API is not an offer or solicitation to buy or sell securities, securities derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, given or in any manner endorsed by AlpacaDB, Inc. or any AlpacaDB, Inc. affiliate and the information made available through Paper Trading is not an offer or solicitation of any kind in any jurisdiction where AlpacaDB, Inc. or any AlpacaDB, Inc. affiliate is not authorized to do business.