Whitepaper Quopi
Whitepaper Quopi
Whitepaper
2022
Table Of Contents
Executive Summary 1
Introduction 2
Cultural Context 4
Quopi GPT 6
Quopi AI Trader 10
Challenges 14
Results and Conclusion 16
Quopi LTD
2022
Executive Summary
This whitepaper is written to explain the Quopi AI teams development of a fully
automated trading bot using the GPT architecture, which we dubbed the
“Quopi AI Trader”. The bot is designed to operate on the New York Stock
Exchange and uses a combination of natural language processing techniques
and technical indicators to make trading decisions.
The first step in developing the bot was to collect and preprocess financial
data, including news articles and historical stock prices. This data was used to
train the GPT model, which was then used to develop trading rules and
strategies based on the insights gained from the data. Technical indicators
were also incorporated to improve the accuracy of the bot's predictions.
After the bot was developed, it was backtested and evaluated to determine its
effectiveness. Multiple iterations of testing were performed, during which the
bot was tweaked and improved. Despite some challenges faced during
development, the bot has not had a single day with a net loss at market closing.
The framework developed for the bot could be applied to other types of
trades, such as crypto trading, and alternative bots are also in development.
While the bot is mostly automated, some trades may still need to be manually
closed before the end of the trading day.
The success of this bot is a proof of concept for the potential of AI in day
trading, and suggests that AI can help bring profits from day trading to a wider
audience. Furthermore, it is a sign of the rapid advances being made in AI, and
the potential for AI to revolutionize various industries in the future.
1
Introduction
Technology underpins many functions in asset management and has for
decades. Virtually all asset managers utilize technology, either developing
their own tools or outsourcing specific functions to a third party provider.
Simply processing large quantities of data from portfolio managers,
exchanges, custodians, rating agencies, and pricing services requires some
level of automation to ensure efficiency and accuracy.
These technological tools are part of a larger ecosystem in which people make
decisions using the information generated by computers in various aspects of
asset management, where a myriad of regulations already apply. These
regulations apply regardless of whether a process is performed manually or
automated.
2
historical performance of various assets, and specific historical, anecdotal and
statistic information of specific stocks that we planned to monitor and trade.
After doing this we mediated the process of creation of the AI trading Bot, AKA
the Quopi AI Trader, through prompting the trained GPT to deliver us its’
version of a successful day trading bot, based on predetermined risk comfort
levels defined by the team. Afterwards, the bot was tweaked through
prompting, with only direct human intervention being the programming part of
the development, when errors and inefficiencies were fixed and and code
cleaned up by our technical team.
The end result of the experiment can be considered a fantastic indicator of the
unbelievable potential of Artificial Intelligence cobmined with competent
controlling human intellect.
3
Cultural Context
Since the now famous company OpenAI released its blockbuster bot ChatGPT
in November of 2022, an incredible amount of users have casually
experimented with the tool, with Chat GPT becoming the fastest ever
application to reach 1 million users, surpassing even TikTok and Instagram in
terms of user adoption. This alone is a great indicator of the incredible
potential to disrupt that this technology possesses.
But ChatGPT, the latest in technology known as "large language model tools,"
doesn't speak with sentience and doesn't "think" the way people do. That
means that even though ChatGPT can explain quantum physics or write a
poem on command, a full AI takeover isn't exactly imminent, according to
experts. Regardless, our investor team saw an opportunity to change the way
we approach the development of new tools for trading. One could argue, we
speculated, that day trading is a field, where humanlike approach and pattern
recognition can hurt your results, instead of enhancing them.
Our team decided to develop our very own GPT, basing our approach on the
one documented by OpenAI, and use this GPT to deliver us, as we dubbed it,
“The Ultimate Trading Bot”. We had two goals when first starting the project:
1. Find out whether management of AI lead tools with this alternative and
4
intuitive method can produce high quality results.
2. If successful, create a marketable product for retail investor use, both
for profit and raising awareness of the capabilities of modern AI.
Process
4
3. Training the GPT Model We train the GPT model on the financial data to
learn the patterns and relationships between different data points, such as
market conditions, news events, and trading strategies.
4. Developing Trading Rules: we use the GPT model to develop trading rules
and strategies based on the insights it has learned from the data.
6. Deploying the Trading Bot Once the trading rules and strategies have been
tested and evaluated, we deploy the trading bot to execute trades
automatically based on the pre-defined rules and conditions.
The steps outlined above can be summarized in three main phases: training the
GPT model, developing the trading bot, and monitoring the bot once it is
deployed.
5
Quopi GPT
We trained this model using Reinforcement Learning from Human Feedback
(RLHF), using the same methods as OpenAI’s InstructGPT, but with slight
differences in the data collection setup. We trained an initial model using
supervised fine-tuning: human AI trainers provided conversations in which
they played both sides—the user and an AI assistant. We gave the trainers
access to model-written suggestions to help them compose their responses.
We mixed this new dialogue dataset with the pre-fed dataset, as well as
introduced a massive amount of information about trading (approximately
140,000 pages total), which we transformed into a dialogue form.
Functionality
The Quopi GPT uses a variety of underlying tools and libraries to implement its
functionality. Here are some of the key tools and libraries that are used in the
ChatGPT stack:
6
3. Transformers Transformers is a PyTorch library that provides a high-level
API for building and training transformer-based models. Quopi GPT uses the
transformers library to build and train the GPT-3.5 model.
7. AWS EC2 AWS EC2 is a cloud computing platform that is used to host the
Quopi GPT API. The API is deployed on a high-performance EC2 instance that
is optimized for running deep learning workloads.
Data preparation.
The financial markets generate vast amounts of data, and the ability to process
this data and derive insights from it is a critical aspect of successful trading. In
recent years, there has been growing interest in using natural language
processing techniques, such as GPT models, to analyze financial data and
develop automated trading bots. Further discussed is the process of data
collection and preprocessing techniques used to train a GPT model on financial
data.
7
Data Collection:
The first step in training a GPT model on financial data is to collect a large and
diverse dataset. This dataset should include market data, news articles, social
media posts, and other relevant sources, including historical information on
stocks, the business surrounding them and even backgrounds of the people
involved. The goal is to capture a broad range of market conditions, events,
and sentiments that can be used to train the GPT model.
In our case, market data included historical stock prices, trading volumes, and
other indicators that reflect market trends and sentiment. News articles and
social media posts provided additional context, such as company news,
analyst reports, and opinions from market participants.
Data Preprocessing:
Once the data has been collected, the next step is to preprocess it for training
the GPT model. This involves cleaning, normalizing, and transforming the data
into a format that can be used by the model.
The technique that Quopi AI team implemented was for transforming financial
data into a format that can be used by GPT models is to convert it into a
sequence of tokens. These tokens can represent individual words, phrases, or
8
other data points, and they can be used to train the GPT model to recognize
patterns and relationships between different data points.
9
Quopi AI Trader
Overall, the goal of an automated trading bot is to remove human emotions and
biases from trading decisions and to execute trades quickly and efficiently
based on pre-defined rules and conditions. By doing so, automated trading
bots can potentially generate profits while minimizing risk and maximizing
efficiency. Before we continue, let’s quickly go through what defines an
automated trading.
Automated trading bots, also known as algorithmic trading bots, are computer
programs designed to execute trades in financial markets based on
pre-defined rules and conditions. These bots are often used by traders to
automate their trading strategies and to execute trades quickly and efficiently.
Once the data has been collected and preprocessed, the next step is to use
the GPT model to develop trading rules and strategies. This involves analyzing
the data to identify patterns and relationships between different data points,
and using these insights to make trading decisions.
Defining success
Before we can effectively determine whether the bot is successful or not, we
must first define what would constitute a successful automated trading bot in
our eyes. The defining features are as follows:
Speed The bot should be able to execute trades quickly and efficiently.
10
Robustness The bot should be able to operate reliably and handle a variety
of market conditions without breaking down.
Technical analysis This involves using past price and volume data to identify
patterns and trends that may indicate a good time to buy or sell a particular
asset. Technical traders may use a variety of tools such as charts, trend lines,
and oscillators to help identify trade opportunities.
News and events Day traders may also keep an eye on news and events that
could affect the price of an asset. This could include economic reports,
company earnings announcements, and political developments.
Market sentiment Traders may also consider the overall sentiment of the
market or a particular asset when looking for trade opportunities. For example,
if the market is generally bullish (optimistic), a trader may look for long (buy)
11
trades, whereas if the market is bearish (pessimistic), they may look for short
(sell) trades
When it comes to determining when to buy and sell, our bot looks for certain
patterns in the technical indicators, such as moving averages or RSI, as well as
market sentiment analysis to determine the overall trend of the stock. We also
use price action analysis to identify support and resistance levels, which can
be helpful in determining entry and exit points.
Once our bot has identified a potential trade, it uses the GPT model to analyze
market sentiment and news articles to gauge overall market conditions and
determine whether it's a good time to enter or exit the trade. Our bot's
algorithm takes all of these factors into account before making a decision on
whether to buy or sell.
12
Backtesting and Evaluation
Once the trading bot was developed, it was necessary to backtest and
evaluate its performance to determine its effectiveness in delivering profitable
trades. The first step in evaluating the bot was to test it on historical data to
see how it would perform under real market conditions. This involved analyzing
how the bot would have performed on past trades, and comparing its
performance to that of a human trader.
During the testing phase, we made several changes to the trading bot to
improve its performance. For instance, we added additional technical
indicators to the GPT model to provide more accurate trading signals. We also
fine-tuned the model to better identify market trends and volatility, and
adjusted the risk management rules to minimize potential losses.
Overall, the backtesting and evaluation process was crucial in determining the
effectiveness of the trading bot and identifying areas for improvement.
Through continuous testing and iteration, we were able to develop a incredibly
accurate and profitable trading bot.
13
Challenges
While developing the fully automated trading bot with the help of GPT, we
encountered several challenges that required careful consideration and
problem-solving to overcome. Here are some of the major challenges we faced
during the development process:
Data quality and preprocessing The first challenge was to ensure that the
data used to train the GPT model was of high quality and properly
preprocessed. Financial data can be complex, and it was important to clean
and transform the data to make it suitable for training the model. To address
this challenge, we carefully selected the data sources and employed various
preprocessing techniques such as normalization, scaling, and feature
engineering.
Market volatility The financial markets are highly volatile and can change
rapidly, making it difficult to predict future market movements accurately. To
address this challenge, we incorporated risk management rules into the
trading bot, allowing it to respond quickly to changes in market conditions and
minimize potential losses.
14
of AI in financial trading, such as the potential for market manipulation and
unfair advantage. To ensure the trading bot was ethically sound, we followed
industry regulations and guidelines, and implemented safeguards to prevent
any misuse of the technology.
15
Results and Conclusion
The Quopi fully automated trading bot developed using GPT has delivered
exceptional results, with not a single day ending in a total net loss. The
framework has been successful in predicting market movements and
generating profitable trades for the user. This success has provided strong
evidence to the idea that AI can help bring profits from day trading to
everyone, and has marked a significant change in the financial industry.
The framework developed for this trading bot can also be applied to other
types of trades, such as crypto trading. This has allowed us to explore
alternative trading strategies, and we are currently developing new bots for
other types of trades using similar AI models. While the bot has been able to
generate profitable trades automatically, there are still some instances where
we have to manually close trades to ensure that all trades are closed by the
end of the trading day. However, we are continually working to improve the
bot's performance and its ability to make fully automated trades.
The success of the trading bot has provided proof of concept to the idea that
AI can be an effective tool for generating profits in day trading. It is a testament
to the power of AI in finance and marks the beginning of a new era in financial
trading. The rapid advancements in AI technology are sure to bring about many
changes in various industries, and the financial industry is just one example of
this. The fully automated trading bot developed using GPT is a prime example
of how AI can be used to create efficient and effective solutions to complex
problems.
16