About a-team Marketing Services

A-Team Insight Blogs

How Should Stock Analysts Use Prompts for ChatGPT?

Subscribe to our newsletter

Daniel Philps, Head of Rothko Investment Strategies and Co-Leader of Machine Learning at the Gillmore Centre for Financial Technology at Warwick Business School.

2023, termed Generative AI’s ‘breakout year,’ has seen generative AI techniques continually advancing, researchers are exploring new applications and pushing the boundaries of what can be generated.

The latest annual McKinsey Global Survey shows that less than a year after these tools debuted, one-third of organisations are using AI regularly in at least one business function.

We have now reached a point where large language models (LLMs) such as ChatGPT can be used to assist with investment management and finance industry tasks. Although we haven’t reached a point of automation yet, for many tasks that is coming, and in the meantime LLMs have become an invaluable tool in a stock analyst’s repertoire.

How can the research-driven fundamental analysts and tech-savvy quant analysts effectively utilise LLMs like ChatGPT? Can these technologies serve as adept co-pilots or assistants?

The key lies mainly in the practice of ‘prompt engineering’. To make the most of ChatGPT and similar LLMs, equity analysts must concentrate on crafting well-structured prompts; in fact, prompt engineering has emerged as a crucial discipline.

The quality of the question posed to ChatGPT directly influences the quality of its response. The system performs optimally when presented with keywords, phrases, bullet points, task trees, and well-sequenced follow-up inquiries.

Utilising ChatGPT as a quant analyst

As for the technical and quantitative aspect, ChatGPT can be employed to generate basic code snippets and provide explanations of complex code. Notably, GPT codex, a GPT-3 trained on programming code, already serves as a beneficial code completion tool in AI programmer GitHub Copilot and has now been absorbed into GPT-4, while GPT-4 is set to form the foundation of the more comprehensive GitHub Copilot X.

However, unless the code required is fairly standardised, code produced by ChatGPT often necessitates adjustments and refinements for accuracy and optimisation. As such, it is most effective as a template. Presently, it seems improbable that LLM autopilots will replace quantitative coders in the near future. However, they will be able to significantly boost their productivity, accuracy and code quality.

For instance, quant analysts can make use of ChatGPT for the following three tasks, by prompting ChatGPT. In practice, the approach would involve accessing specialised codex LLMs and integrating additional tools to prompt for highly reliable code semi-automatically.

Developing an entire investment pipeline:

ChatGPT can execute complex programming instructions to some extent, such as generating Python functions for driving quantitative equity investment strategies.

However, significant editing and refining of the generated code is usually required. The challenge lies in getting code from ChatGPT that closely resembles the final product. This can be achieved by providing a bulletised list of instructions with crucial details for each item.

Creating a machine-learning alpha-forecasting function:

By posing follow-up questions, we can obtain a basic machine-learning function or template for predicting stock returns.

ChatGPT performs reasonably well in this context, delivering a function that can be adjusted, along with guidance on its application, including a recommendation for cross-validation using a random forest algorithm.

Crafting a useful function: target shuffling:

Subsequently, we tasked ChatGPT with generating a helpful and moderately complex function for conducting target shuffling—a technique to validate outcomes of an investment model.

A simple request for “Python code for a target shuffling function” yielded limited results. Once again, providing a comprehensive list of requirements was necessary for ChatGPT to produce a viable template.

The road ahead

With carefully managed prompts, LLMs can now help fundamental analysts quickly acquire basic knowledge about many companies at once and help quant analysts to develop and debug code.

While the examples above are simply ChatGPT prompts, developers and managers with class-leading technology are already working to apply LLMs to investment management workflows.

Even in their current form, effectively integrated LLMs can yield significant efficiencies if applied in the correct way. They also provide a glimpse into the immense capabilities of this technology.

In its next generation, LLM technology will evolve into an essential tool for investment management. Through automating tasks like information acquisition, human analysts will be afforded additional time and cognitive resources to concentrate on the critical aspects of reasoning and decision-making within the investment workflow.

Subscribe to our newsletter

Related content


Recorded Webinar: The emerging structure of the institutional digital assets market

As interest in trading digital assets continues to increase among institutional investors, so too does the need to focus on market structure, regulation and trading solutions. For financial institutions that get it right the rewards will be significant, but it is not necessarily easy and the challenges are many. This webinar will consider how digital...


Crédit Agricole CIB Implements Opensee’s Advanced Market Risk Management Platform

Opensee, the specialist data analytics platform for financial institutions, has successfully rolled out a new market risk management solution for the front office users of Crédit Agricole Corporate & Investment Bank (CACIB). The new solution consolidates multiple data sets from varied sources into a single repository, rather than the previously segregated systems used for each...


Data Management Summit London

Now in its 14th year, the Data Management Summit (DMS) in London brings together the European capital markets enterprise data management community, to explore how data strategy is evolving to drive business outcomes and speed to market in changing times.


MiFID II Handbook

As the 3 January 2018 compliance deadline for Markets in Financial Instruments Directive II (MiFID II) approaches, A-Team Group has pulled together everything you need to know about the regulation in a precise and concise handbook. The MiFID II Handbook, commissioned by Thomson Reuters, provides a guide to aspects of the regulation that will have...