Using ChatGPT to create an AI retirement trading bot
Creating an AI retirement trading bot using ChatGPT and Composer - A no-code trading bot creator
In today's fast-paced world of technology, ChatGPT stands out as an impressive language model that is transforming how we interact with the digital realm. Created by OpenAI, ChatGPT boasts remarkable abilities in natural language understanding and generation, offering users a highly adaptable tool for a wide range of uses. ChatGPT operates in a Q&A format, allowing you to ask questions/enter instructions, while ChatGPT will answer and also remember previous instructions you gave it.
This article will delve into how you can combine the power of ChatGPT to develop a retirement strategy trading bot from scratch. The key focus of this article will be on how to personalize this commodity strategy based on your needs.
Composer is the tool we’ll use for this tutorial. It allows you to build trading algorithms with AI, backtest them, then execute—all in one platform.
Why are we using Composer in this tutorial? Composer uses ChatGPT4 which is the latest AI model by OpenAI (released in March 2023). Composer has also invested heavily in finetuning the ChatGPT4 model specifically for the trading use case. Therefore you get a much better AI assistant for trading use cases (you can test it on the free plan and it's included as part of the Pro Plan).
Step 1 - Head to Composer and click on the ‘Create’ section.
On the Create page you’ll have the option to “Create with AI”.


Step 2 - Create a baseline strategy by giving the AI assistant some details
For some context, Chat GPT is a natural language processing (NLP) model so you interact with it in a question/answer style.
Start by giving the AI assistant some basic facts so we can create a baseline retirement strategy (don't worry too much as we can continue to amend it as necessary).
The example we'll use: "Can you create a retirement strategy. I'm in my mid-30s and want to retire by 65. Provide some exposure to both stocks and bonds"
Great! We have a baseline strategy that is split 70% in stocks and 30% in bonds. Don't worry about the code, you don't need to use it.

Step 3 - Click “Insert and Backtest”.
This places the code that the AI assistant has created into the visual editor. Here it’s much easier to see how the logic works. You can also edit the strategy directly in this editor e.g. you may want to use the various indicators e.g. relative strength index or moving average to filter your assets.

If you scroll down, you’ll arrive at the backtester so you can use professional grade data to understand how the trading bot would have performed historically. There is also detailed performance metrics for the trading bot e.g. maximum drawdown, calmar ratio, sharpe ratio etc. You can also find how the bot would have allocated across assets each day.

Step 4 - Continue the conversation and fine-tune your strategy.
This is where things can get interesting! Let's adjust the strategy to include another asset type.
For the purpose of this tutorial, we will ask the AI assistant "Can you reduce my exposure to stocks by 5% and add a 5% hedge in Gold?"

Great! The AI assistant has found a Gold ETF and has reduced your stock exposure to 65%. As you can tell, this is a very simple example. If we want to increase the complexity, we can do something like the following:

This makes use of the indicators available in Composer if you have a clearer understanding of the indicators you want to use in your strategy.
This is only the start! Retirement strategy also adjust their exposure over time to hold less volatile assets closer to retirement. You can easily adjust your strategy every 6 months/1 year to hold different assets e.g. less stocks, and more bonds closer to retirement.
Step 5 - Invest with the click of a button.
Composer automatically executes your trades for you based on your rebalancing schedule. Composer is a Registered Investment Advisor (RIA) and they are regulated by FINRA and the SEC. Funds are protected up to $500k through SIPC and the custodian is BMO Harris bank.

Common Mistakes
If you find that the AI assistant throws an error, this can be due to a few common pitfalls.
1) Ensure that you are only using the indicators currently available on the Composer Symphony Editor. E.g. You can't currently as AI assistant to create the Composer code for a trading bot that trades based on CPI as CPI is not a function you can use in Composer yet.
2) Sometimes, the stock ticker will be imported into the Composer Symphony editor but may require manual editing of the name in case ChatGPT has misspelt the ticker name or the ticker name has changed since ChatGPT was released. ChatGPT may also suggest tickers that may now not be traded publically.
You can find the full documentation here.
Summary
As you can see, Composer's AI assistant with ChatGPT4 is a versatile tool that can assist you in building a personalised retirement strategy based on your needs. The AI assistant can also help you change the rebalancing frequency of your investment strategies to ensure they follow the desired schedule. When it comes to identifying potential investment options, the AI assistant can provide recommendations for commodity ETFs and stocks. Another great use of the tool is finding and replace assets within existing strategies.
I hope I've provided some initial inspiration for you to create your own AI commodity strategy trading bot. I look forward to seeing what you create!
Important Disclosures
Investing in securities involves risks, including the risk of loss, including principal. Composer Securities LLC is a broker-dealer registered with the SEC and member of FINRA / SIPC. The SEC has not approved this message.
Certain information contained in here has been obtained from third-party sources. While taken from sources believed to be reliable, Composer has not independently verified such information and makes no representations about the accuracy of the information or its appropriateness for a given situation. In addition, this content may include third-party advertisements; Composer has not reviewed such advertisements and does not endorse any advertising content contained therein.
This content is provided for informational purposes only, as it was prepared without regard to any specific objectives, or financial circumstances, and should not be relied upon as legal, business, investment, or tax advice. You should consult your own advisers as to those matters. References to any securities or digital assets are for illustrative purposes only and do not constitute an investment recommendation or offer to provide investment advisory services. Furthermore, this content is not intended as a recommendation to purchase or sell any security and performance of certain hypothetical scenarios described herein is not necessarily indicative of actual results. Any investments referred to, or described are not representative of all investments in strategies managed by Composer, and there can be no assurance that the investments will be profitable or that other investments made in the future will have similar characteristics or results.
Charts and graphs provided within are for informational purposes solely and should not be relied upon when making any investment decision. Past performance is not indicative of future results. The content speaks only as of the date indicated. Any projections, estimates, forecasts, targets, prospects, and/or opinions expressed in these materials are subject to change without notice and may differ or be contrary to opinions expressed by others. Please see Composer's Legal Page for additional important information.