Multi-Agent Platform To Support Trading Decisions in The FOREX Market

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Applied Intelligence (2024) 54:11690–11708

https://doi.org/10.1007/s10489-024-05770-x

Multi-agent platform to support trading decisions in the FOREX market


Marcin Hernes1 · Jerzy Korczak2 · Dariusz Krol3 · Maciej Pondel1 · Jörg Becker4

Accepted: 11 August 2024 / Published online: 30 August 2024


© The Author(s) 2024

Abstract
Trading decisions often encounter risk and uncertainty complexities, significantly influencing their overall performance.
Recognizing the intricacies of this challenge, computational models within information systems have become essential to
support and augment trading decisions. The paper introduces the concepts of trading software agents, investment strategies,
and evaluation functions that automate the selection of the most suitable strategy in near real-time, offering the potential to
enhance trading effectiveness. This approach holds the promise of significantly increasing the effectiveness of investments.
The research also seeks to discern how changing market conditions influence the performance of these strategies, emphasizing
that no single agent or strategy universally outperforms the rest. In summary, the overarching objective of this research is to
contribute to the realm of financial decision-making by introducing a pragmatic platform and strategies tailored for traders,
investors, and market participants in the FOREX market. Ultimately, this endeavor aims to empower people with more
informed and productive trading decisions. The contributions of this work extend beyond the theoretical realm, demonstrating
a commitment to address the practical challenges faced by traders and investors in real-time decision-making within the
financial markets. This multidimensional approach to financial decision support promises to enhance investment effectiveness
and contribute to the broader field of algorithmic trading.

Keywords Multi-agent system · Supporting trading decision-making · FOREX market

1 Introduction technology. The goal is to generate profits by capitalizing on


minimal price fluctuations, characterized by high-frequency
A combination of statistical analysis, financial mathemat- occurrences, where profits often arise from market liquidity
ics, econometrics, and, increasingly, artificial intelligence imbalances or short-term pricing inefficiencies.
often informs trading decisions. These methods are fre- In general, the trading platforms must offer real-time
quently integrated into multi-agent systems to enhance trad- guidance on trading positions, such as when to open/close
ing activities in the foreign exchange market (FOREX) [1]. positions, whether to go long or short or when to step away
These systems strongly emphasize high-frequency trading from investments. These guidelines form specific trading
(HFT), short-term position openings/closings, and sophisti- strategies, defined by their verifiability, quantifiability, con-
cated algorithms that leverage robust indicators and modern sistency, and objectivity [2].
A trading strategy should outline the assets, entry / exit
B Marcin Hernes points, and money management rules, drawing from funda-
[email protected] mental, technical, or behavioral analysis. These strategies
1 Department of Process Management, Wrocław University of
are validated through backtesting (historical data) or forward
Economics, Komandorska 118/120, Wrocław 53-345, Poland testing (simulated trading environments compared to real-
2 International University of Logistics and Transport in
world results). Online trading adds further challenges [3],
Wroclaw, Sołtysowicka 19B, Wrocław 51-168, Poland requiring the real-time use of one or multiple algorithms,
3 Department of Applied Informatics, Wrocław University of
often implemented as software agents. Currently, most trad-
Science and Technology, Wyb. Wyspiańskiego 27, Wroc,ław ing systems are based on single or numerous algorithms
50-370, Poland without employing agents [4–10]. They are also based on
4 Department of Information Systems, University of Münster, the single agent architecture [11]. This paper introduces A-
Leonardo Campus 3, Münster, 9, Germany Trader, a multi-agent platform designed to support financial

123
Multi-agent platform to support trading... 11691

decision-making within the FOREX market. As the A-Trader 3. It ensures more realistic trading performance analysis
platform is presented, several critical issues in designing based not only on return-based metrics but also on risk
advisory systems for stock markets will be addressed. These assessment and endogenous benchmarks.
challenges encompass: 4. The approach allows for the creation of strategies with
superior performance compared to other methods.
1. Integration of Diverse Decision Sources: Harmonizing 5. The multi-agent approach enables the simulation of
many decision sources, offering insight into effectively trader behavior, which can be used to enhance FOREX
integrating varied inputs for informed decision-making. decision-making processes.
2. Selection of Recommendation Methods and Algorithms:
Exploring the crucial task of selecting the most suitable The paper is structured as follows. The first part of the
recommendation methods and algorithms. paper introduces A-Trader’s architecture and functionalities.
3. Cooperation and Control of Advisory Algorithms: The The second part delves into the specifications of various trad-
importance of seamless collaboration and control of ing agents. Three categories of trading agents are examined:
advisory algorithms is emphasized, providing valuable agents based on technical analysis, agents based on macroe-
insights into optimizing algorithmic efficiency. conomic and fundamental analysis, and behavior-based
4. Composition of the Global Investment Strategy Evalu- agents. Subsequently, it outlines trading strategy-building
ation Criterion: We underscore a holistic approach to approaches using the set of available agents, and concludes
performance assessment by examining the need for a with an analysis of the results from research experiments
comprehensive evaluation criterion for global investment evaluating the performance of selected trading strategies on
strategies. FOREX.
5. System Openness and Interoperability: The authors dis-
cuss the importance of system flexibility and adaptability,
offering an in-depth understanding of the prerequisites 2 Background
for system openness.
The design and implementation of multi-agent systems in
stock trading has been a focal point for numerous projects
The solutions implemented in the A-Trader platform will and research reports.
exemplify the issues mentioned above. A-Trader is a dynamic
multi-agent experimental platform for constructing, simulat- 2.1 Multi-agent systems for financial decision
ing, and assessing investment strategies, catering to various support
investor types. Technically, A-Trader is integrated with an
online data system, MetaTrader, which provides raw and pre- This paper [14] proposes a modular multi-agent reinforce-
processed data and buy-sell decisions generated by agents ment learning-based system for financial portfolio man-
using various methods. The platform develops investment agement (MSPM) to address the challenges of scalability
strategies and continuously evaluates them based on the and reusability in adapting to ever-changing markets. Using
open/close and short/long positions determined by the most evolving agent modules (EAMs) for generating informa-
highly rated agents. The significant advantage of A-Trader tion and Strategic Agent Modules (SAMs) for portfolio
over other trading platforms lies in its use of a multicriteria optimization, the system ensures improved adaptability and
function to evaluate the strategy unlike platforms that rely performance, evidenced by significant outperformance in
solely on return-based metrics, A-Trader calculates a return US stock market data. The multi-agent deep reinforcement
rate based on risk-based measures, including factors like the learning framework proposed in [15] leverages the collec-
number of transactions, gross profit, gross loss, profitable tive intelligence of expert traders, each focused on different
trades, consecutive profitable transactions, non-profitable timeframes, to improve trading outcomes. It employs a hier-
successive transactions, Sharpe ratio, average volatility coef- archical structure in which knowledge flows from agents
ficient, and average return per transaction [12, 13]. trading on higher time frames to those on lower time frames,
In this paper, it will be demonstrated that: improving robustness against noise in financial data. Other
examples of multi-agent architectures based on the deep
1. The use of advanced technologies and a system architec- reinforcement learning framework are shown in papers [16]
ture offers better performance and greater openness than and [17].
existing solutions. A proposal for a framework for evolutionary multi-agent
2. Provides a flexible and agile methodology for the devel- trading for FOREX was introduced in [18]. In this paper, the
opment of investment strategies. authors focused on currency trading and included the impact

123
11692 M. Hernes et al.

of FX trading spread. They used technical indicators to pro- retraining period, the size of the retraining set, and the num-
vide temporary features from which a decision tree defined ber and type of attributes selected to construct the model.
the training strategy. Tree representation classifiers were built The complexities of the market require a combination of
with Genetic Programming (an evolutionary technique). The parameters that, for the same instrument, could change under
authors proposed a general FOREX Genetic Programming different market conditions and seasons. The models needed
Framework (FXGP), and the proposed simplified framework to learn new patterns to cope with the dynamics of the market,
(sFXGP) has been deployed to construct multiple agents but at the same time, to avoid noisy ways that might not be
operating concurrently [19]. The works [20, 21] present an related to the current market situation could only be based on
approach for financial market prediction, where agents exam- training comprised of current values of the time series using
ine the similarities between the ask and bid asset histories to a sliding window approach.
predict quotes in real time. The paper [22] shows devel- An ensemble approach was proposed in [33] where the
opment of ForexMA, a multi-agent system that enhances authors classify the FOREX market, and behavioral analyzes
decision-making in Forex trading by integrating both quali- are considered by a certain amount, 2) downtrends when FX
tative and quantitative information. The architecture includes rates decrease by a certain amount, and 3) sideways trends.
three agents, namely, the Facts Analyzing Agent, the Deci- They extract features from these trends using multi-scale fea-
sion Agent, and the Performance Analyzing Agent. The tures. Multiple classifiers are trained using these features.
authors demonstrated that ForexMA outperforms human Bayesian voting was used to create an ensemble of these
expert traders by delivering high-frequency, rapid solutions classifiers, which can recognize trends in the market. The
in a matter of seconds. This system was tested and proven experimental results showed that the proposed system could
to generate more accurate predictions than those made by accurately identify up and down trends in the FX rate signal.
human experts, who typically operate on lower frequency Mayo states that a significant amount of intraday market
timeframes and require several hours to analyze the infor- data is noise or redundant, and if it is eliminated, then predic-
mation. tive models built using the remaining intraday data will be
more accurate. He proposed an algorithm known as Evolu-
2.2 Advanced methods for financial decision tionary Data Selection (EDS), which uses a model building
supporting algorithm in conjunction with the available training data to
find an optimal subset of those data [34].
This section analyses the methods developed not as agent- Until now, articles have discussed the competition between
based approaches but can be transformed into agent struc- multi-agent trading systems and their performance in trading
tures in multi-agent systems. scenarios [50]. Some of them explore advances in artifi-
The works [23, 24] present the use of neuro-fuzzy com- cial economics, including agent-based models, and their
puting and neural networks for making quotation predictions applications in finance and game theory [51]. Focusing on
based on analysis of a financial time series’s geometrical the evolution of multi-agent foreign exchange (FX) traders,
patterns. Another paper proposing a behavioral approach Longinov analyzes their performance in FX markets [18].
for trading decisions is [25]. Some authors present strate- Currently, there are many platforms for HFT decision sup-
gies based on trading bots [26] or deep belief networks port in FOREX, such as FinEXo, Trade360, AvaTRADE,
(DBN) [27] to build investment decisions based on the EXsignals, and Trade Chimp.
S&P500. Deep learning techniques, in turn, are presented
in [28]. The deep learning approach is based on such 2.3 Assessment of existing approaches
methods, as recurrent neural networks, including Long
Short-Term Memory [60], spiking neural networks [29– The presented theoretical and practical approaches and solu-
31]. Machine learning (ML) techniques significantly impact tions are often insufficient for HFT decision support. They
on the automatic identification of trading agents to iden- are characterized by low performance (insufficient to support
tify profitable strategies to trade in the stock or currency HFT) and costly maintenance. Moreover, the problem with
market. Financial predictions incorporating ML approaches openness and integration of the technologies appears in most
construct training, test, and off-sample data sets as a collec- cases.
tion of instances using commonly used technical indicators. The existing platforms are mainly based on technical
An example of ML models applied to trading scenarios in the analysis. Fundamental analysis and behavioral analysis are
FOREX market was discussed in [32]. The authors wanted considered to a low degree. The disadvantage of existing
to verify whether, using these models, it is possible to obtain approaches is also a performance measurement process.
consistently profitable returns. The authors proved that while Mainly return-based measures are only taken into consid-
getting good returns using simple classifiers is possible, each eration, and it causes to limitation of personalization of the
model needed a specific setup, including variables such as the strategies evaluation byways(for example, a specific group

123
Multi-agent platform to support trading... 11693

of users can take into consideration mainly the rate of return- The main goal of the Supervisor Agent (SA) is to generate
based measures, and other groups of users want to take profitable trading advice to achieve a specific rate of return
into consideration combining-based measures). Therefore, and reduce investment risk. This agent performs based on
investors often also need other classes of measures, for Basic and Intelligent agents’ decisions. It provides different
example, risk-based measures, to properly manage risk. The trading strategies and final open/close long/short positions
existing platforms are also not fully open-accessible, and to the trader or automatically to the market. The Supervisor
users can develop their strategies using the tools proposed by also resolves Computing Agent knowledge conflicts within
the given platform. It is very difficult to integrate strategies the Cloud and evaluates their performance. Based on col-
developed by a user in other software environments with the lected knowledge, this agent determines which decisions are
given trading platform. Therefore, the main research problem considered in a given strategy and which are ignored.
undertaken in this paper is to develop an approach that over- The Notification Agent (NA) receives the data (quota-
comes the presented disadvantages of existing approaches. tions), distributes messages (signals) to various agents, and
For this purpose, we developed the conception and prototype controls the system operation running in a multi-threaded
of a multi-agent platform in our research. manner. Information about the message flow (which agent
sends signals to which agent) is read during the NA initial-
ization from the Routing Table.
3 Architecture and functionalities of Figure 2 shows an example of the data flow inside the
A-trader NA. This agent “listens” at the given port, and if information
from Agent A5 is received, then NA searches, in the Routing
The primary strengths inherent in multi-agent systems, Table, the agents who listen to messages (signals) from Agent
including A-Trader, lie in their openness to integrate novel A5. In the considered example, these are Agents A7 and A9.
trading algorithms and specific functionalities that enable Next, the NA agent searches for threads being sent (Sending
model-building communication among various agents. These Threads Table) to Agents A7 and A9 and sends them thr-
systems operate on the principles of collective intelligence, ough.
allowing for tailored solutions using diverse market moni- The Cloud of Computing Agents (CCA) consists of the
toring methods. Multi-agent technology facilitates the cus- Basic Agents Cloud (BAC) and Intelligent Agents Cloud
tomization of solutions through agents that evaluate existing (IAC). BAC consists of agents that preprocess the data and
methods and preprocess learning datasets. These agents have calculate the fundamental technical analysis indicators. IAC
learning capabilities, evolving their knowledge about finan- consists of agents with a knowledge base. They can per-
cial market behavior. Overcoming computational challenges form the learning process and can change their internal
are achieved by leveraging a service-oriented architecture state and parameters. This group of agents uses methods
and cloud computing (SOAP). The SOAP communication based on artificial intelligence (neural networks, rule-based
protocol, as implemented in A-Trader, greatly simplifies the systems, genetic algorithms, cognitive technologies, etc.),
integration of individual solutions due to its open and easily agents observing market behavior and agents analyzing text
implementable nature1 . Incorporating PUSH technology, a messages. User-defined Intelligent Agents Cloud (UAC) con-
common feature in distributed systems, notably accelerates sists of agents created by external users. Integration of
information propagation within the system, as discussed in User-defined Agents within the system without installing the
further detail in [35]. The system retrieves real-time data from agent on the servers is possible in A-Trader. The result of the
the currency market using MetaTrader or JForex software. Basic Agents and the Intelligent Agents activity is a decision
A-Trader analyzes quotation data using many criteria, ensur- that the NA transfers to the Supervisor Agent.
ing near real-time processing and the capability to handle The Market Communication Agents (MCA) communicate
diverse data sources. For a more in-depth understanding of between A-Trader and the external environment. MCA pro-
A-Trader’s architecture, system elements, and agent details, vides the actual values of quotations, and they are responsible
refer to [13, 36, 37]. for performing open/close long/short position orders.
In general terms, A-Trader is composed of agents capable A visualization agent (VA) visualizes quotations, deci-
of generating independent decisions. These decisions can be sions, and long/short positions in the form of charts.
characterized by model building by consistency or contra- The layer of Cloud Computing Agents is the system’s core
diction, e.g., the two independent agents can simultaneously that analyzes signals contained in notifications and deliv-
generate open and closed positions. Figure 1 presents an ers decision recommendations to the Supervisor Agent. The
overview of the architecture and functional concept of A- Supervisor Agent then generates the final decision, as previ-
Trader. ously stated. Selected agents (especially belonging to CCA)
running on A-Trader architecture are described in the next
1 W3C SOAP, https://www.w3.org/TR/soap/ section.

123
11694 M. Hernes et al.

Fig. 1 A-Trader system


architecture

Analyzing the computational complexity of a-Trader, it late mainly technical analysis indicators related to FOREX
should be noted that it depends on the computational com- market quotations), 500 intelligent agents (IAC), running in
plexity of the algorithms of the individual agents. However, different aggregates and generating buy-sell decisions (about
the architecture of the system makes it possible to determine 250 agents based on three-valued logic, 250 agents based on
decisions within 5 to 20 milliseconds of receiving the last fuzzy logic) and 300 agents generating open/close long/short
quotation as an input signal (server parameters: Intel Core i7- positions (thus providing the strategies).
9700K 8 cores, RAM 16 GB, NVIDIA GeForce RTX 2060 An experimental platform was designed to easily integrate
16GB, SSD M.2 480 GB, HDD SATA 7200 2000 GB). new agents (user agents) and allow the reuse of existing agent
decisions in new strategies. We adopted three conventions
for generating agent responses / signals: three-value logic,
4 Agent descriptions fuzzy logic, and our signals. Three-value logic is a manner
for the representation of agents’ knowledge to provide buy
A software agent is an intelligent program that not only exe- / sell decision signals, generated as the agent’s output sig-
cutes based on acquired data but also takes specific actions nal, where the value 1 denotes a buy decision, the value
to achieve a specified goal (for example, making satisfactory -1 denotes a sell decision, and the value 0 denotes don’t
decisions in the FOREX market). A-Trader contains vari- care. For a trading decision, fuzzy logic agents are more
ous types of agent, as mentioned in the previous chapter: appropriate. The confidence range for decisions on A-Trader
Market Communication Agents, Notification Agents, Visu- is [−1 . . . 1], where ’-1’ denotes a strong sell decision, ’0’
alization Agents, Supervisor Agents, Historical Agents, and denotes a strong leave unchanged decision and ’1’ denotes a
agents belonging to the cloud of computing agents (Basic strong buy decision. The signal for open/close positions can
Agents, Intelligent Agents, and User Agents), and currently, then be generated based on a given decision’s confidence
approximately 1600 agents are implemented on the platform. level. For example, a short position is opened when a con-
In cloud of computing agents These there are 800 basic fidence level is greater than -0.8, whereas a long position is
agents (BAC) processing data agents (these agents calcu- opened when a confidence level is more significant than 0.6.

Fig. 2 Data flow inside the


Notification Agent

123
Multi-agent platform to support trading... 11695

As a result, open/closed positions can achieve more profitable Algorithm 1 The FuzzyTrendLinearRegression agent speci-
results than positions generated based on three-value logic. It fication.
should be stressed that the level of confidence for open/close Input: < w1 , w2 , . . . , w M >, pr ev_a
1: /* The vector of the quotation values of M is determined by the trader
positions is very important, and it can be determined by or by the genetic algorithm, the previous value of the coefficient "a"
considering trader experience or automatically determined */
by the Supervisor using, for example, a genetic algorithm. Output: Decision D (fuzzy logic - value range [-1…1]
Specific signals are generated by agents which do not have 2: sum_y ← 0; sum_x ← 0; sum_x y ← 0; sum_x2 ← 0;
3: / * sum_y - the sum of the M quotations values, sum_x - the sum
simple/linear interpretation, for example, signals from agents of the quotation indices in the input vector, sum_xy - the sum of the
with unsupervised learning. products of the quotations values and quotation indices, sum_x2 -
Currently, A-Trader consists of three groups of buy/sell the sum of the squares of quotation indices in the input vector */
decision agents. 4: D ← 0; T R L_count ← 0;
5: / * counter needed for fuzzification * /
6: Max_count ← 0;
4.1 Agents based on technical analysis 7: / * maximum limit of counter needed for fuzzification * /
8: for k ← 1 to M do
Agents based on technical analysis use three-valued logic or 9: sum_y ← sum_y + wk ; sum_x y ← sum_x y + wk ∗ k;
10: sum_x ← sum_x + k; sum_x2 ← sum_x2 + k ∗ k;
fuzzy logic. Technical indicators have interpretations such 11: k ← k + 1; c ← sum_x2 ∗ M − sum_x ∗ sum_x;
as the market is oversold, the power of buyers is exhausted, 12: end for
etc. where assembling some of these may give satisfactory 13: if c = 0 then
results. The shorter the investment horizon, the greater the 14: c ← 0.1; a ← (sum_x y ∗ M − sum_x ∗ sum_y)/c;
15: end if
effectiveness of technical analysis. To illustrate how an agent 16: if (a = pr eva = 0) ∨ (a < 0 ∧ pr eva < 0) ∨ (a > 0 ∧ pr eva > 0
works, let us present an example of a fuzzy logic agent called then
FuzzyTrendLinearRegression. This agent makes decisions in 17: D ← 0;
the following manner. A given number of M quotations is 18: end if
19: if a > 0 ∧ pr eva < 0 then
approximated by the equation: y = ax +b (straight line). The 20: if T R L_count > 0 then T R L_count ← 0;
inclination of this line depends on the value of the coefficient 21: end if
“a” or the tangent value of the inclination angle using linear 22: T R L_count ← T R L_count − 1;
regression. 23: if T R L_count < max_count then T R L_count ←
max_count;
The agent generates a buy signal when the coefficient 24: end if
value of “a” changes from positive to negative, and it gen- 25: end if
erates a sell signal when the coefficient “a” changes from 26: D ← T R L_count/max_count;
negative to positive. The transition of the agent’s decision is 27: if a < 0 ∧ pr eva > 0 then
28: if T R L_count < 0 then T R L_count ← 0;
performed using the hysteresis level, defined by the coeffi- 29: end if
cient value δ. 30: T R L_count ← T R L_count + 1;
31: if T R L_count > max_count then T R L_count ←
4.2 Agents based on macro-economic and max_count;
32: end if
fundamental analysis 33: end if
34: D ← T R L_count/max_count; pr eva ← a;
A-Trader also consists of agents based on fundamental analy-
sis and behavioral data. The fundamental analysis in FOREX
is related to the economic, social, and political forces driving
demand and supply on the currency market. The level of the Other factors, such as central bank interventions (e.g., by
supply and demand balance is affected by two main factors: increasing / reducing foreign exchange reserves) strengthen /
reduce demand for a specific currency. Fundamental analysis
• Interest rates can strengthen or weaken a particular cur- is based on an examination of asset markets, macroeco-
rency where a high level of interest rates (as compared nomic indicators, and political considerations of the country
to those in other currencies) can increase the level of for- to evaluate the development of the exchange rate of a partic-
eign investment in a currency, which in turn, leads to a ular currency. Asset markets include stock exchanges, bond
strengthening of the currency. markets, and real estate. Macroeconomic indicators are mea-
• The international trade balance deficit (higher value of sured by Gross Domestic Product, Money Supply (M1, M5,
imports than the value of exports) can usually adversely D1, W1, etc.), unemployment, inflation, foreign exchange
affect a currency. In this case, the currency is transferred reserves, interest rates, and productivity. Political consider-
out of a country to buy foreign products, which can lead ations can influence the level of certainty of stability and
to a devaluation of the currency. the level of confidence in a nation’s government. The funda-

123
11696 M. Hernes et al.

mental analysis agents also consider indicators such as the Algorithm 2 The FuzzyNeuralNetIndices agent specifica-
Consumer Price Index (CPI), Durable Goods Orders, Pro- tion.
ducer Price Index (PPI), Purchasing Managers Index (PMI) Input: w =< w1 , w2 , . . . , w M >, v =< v1 , v2 , . . . , v M >
1: /* The vector of S&P 500 index values consisting of M values (M is
and retail sales. determined by the user or by genetic algorithm), the vector of WIG
However, often online fundamental analysis only some- index values consisting of M values */
times provides market entry and exit points in FOREX as a lot Output: The decision D (fuzzy logic - value range [-1…1]
of information emerges at regular intervals. Still, only a part 2: in M ←< w1 , w2 , . . . , w M , v1 , v2 , . . . , v M >;
3: pr ed M+1 ← Multi − layer Per ceptr on(in M );
of this information is relevant. Therefore, there are only a few 4: D ← heuristic_open_close( pr ed M+1 );
agents based on macro-economic and fundamental analysis
are implemented, notably:
of PLN about USD should grow. Other fundamental analysis
1. Interest rates - if interest rates are higher in one country agents consider information about:
than in its neighbors, the currency prices in this country
will often strengthen because a higher interest rate attracts
• Gold prices ratio: when the price of gold goes down, then
more foreign investors.
the USD often goes up (and vice versa); that means that
2. Gross Domestic Product (GDP) is the sum of all goods
prices of gold tend to have an inverse relationship to the
and services produced/provided by domestic or foreign
price of USD and currency traders can take advantage of
companies in a given country. Based on GDP, the level
this relationship.
of growth (or contraction) of a country’s economy can
• Oil price ratio: economies of oil-dependent countries
be measured. This indicator has the broadest scope for
grow (investors buy their currencies as a consequence)
the change in economic output and production in a given
as oil prices drop.
country. The Gross National Product (GNP), in turn, is
related to the nationality of capital.
3. Purchasing Manager’s Index (PMI) includes data related 4.3 Behavior-based agents
to new orders, supplier delivery times, production, back-
logs, prices, inventories, employment, import and export Many experts point out that the currency market is strongly
orders. It is characterized by high correlation with Mon- correlated with the expectations of traders and their assess-
etary Policy Decisions and is a valuable tool to track the ment of these expectations. There is a commonly observed
health of a country’s manufacturing sector. relationship between stock prices and the behavior of traders,
4. Indexes: notably their perception of risk and benefit. Various prog-
noses, bulletins, and blogs strongly influence these expecta-
• S&P 500 is treated as a leading indicator of US tions. An understanding of investor psychology can generate
equities and is meant to reflect the return/risk charac- profit opportunities and thus can be extremely valuable for
teristics of the large cap universe, this index includes designing trading strategies. Many studies of behavioral
500 stocks chosen on the basis of market size, liquid- models are used in FOREX trading, most based on psy-
ity industry grouping, and other factors. chology theories and applying data mining methods [38].
• FTSE 100 is a London Stock Exchange indicator and However, to validate these models on real financial mar-
includes 100 companies characterized by the highest kets, detailed information about traders, their experience and
market capitalization on this Exchange. knowledge, and their psychological biases is needed.
• WIG–is a Warsaw Stock Exchange index that includes Considering the limited sources of information on these
securities listed on the main market. subjects, in A-Trader only a behavioral time series has been
provided and a few behavioral agents have been imple-
To illustrate one of the agents based on macro-economic anal- mented [20, 39]. The datasets are a broad range of day-by-day
ysis, there is an agent called FuzzyNeuralNetIndices. The indicators (sentiments) provided by Polands MarketPsych
agent computes by applying Multilayer Perceptron to the Data or INI indicator. The indicators have been computed
trading decisions on the S&P500 and WIG indices. from millions of articles and posts in the news and on social
This agent is based on the interpretation of the money media. In the experiments, behavioral indicators such as
flow. If WIG20 is rising and the S&P 500 is falling, it can be SENTIMENT, OPTIMISM, FEAR, as they relate to specific
predicted that investors can exchange their S&P shares for countries and their currencies (e.g. USD/PLN) are updated
USD, then they can exchange USD for PLN to finally buy every day for countries and currencies and are input directly
WIG shares. Therefore, if they buy PLN for USD, the value into A-Trader agents. For example, the SENTIMENT index

123
Multi-agent platform to support trading... 11697

Algorithm 3 The specification of the agent working on SEN- The strategies of A-Trader are based on more com-
TIMENT index values. plex algorithms than algorithms based on technical analysis
Input: s_P L N =< s_ pln 1 , s_ pln 2 , . . . , s_ pln M > indicators [40] and, to illustrate the applied concept, four
1: s_U S D =< s_usd1 , s_usd2 , . . . , s_usd M >
2: w =< w1 , w2 , . . . , w M >, threshold_open, threshold_close
strategies are detailed: MyStrategy, Consensus, Evolution-
3: /* SENTIMENT values for PLN, SENTIMENT values for USD, based, Deep learning. These strategies have been chosen,
USD/PLN quotations, the level of threshold for open long/close short because they were developed on the basis of the deep litera-
position, the level of threshold for close long/open short position */ ture study and based on many experiments (these strategies
Output: The decision D (fuzzy logic - value range [-1…1]
4: s_ pln M+1 ← Multi − layer Per ceptr on(s_P L N );
are in the advanced phase of development in A-Trader, and
5: s_usd M+1 ← Multi − layer Per ceptr on(s_U S D); the remaining strategies are in the preliminary phase of devel-
6: if (s_ pln M+1 > threshold_open) ∧ (s_usd M+1 > opment).
threshold_open) then
7: D ← heuristic_open(s_ pln M+1 , s_usd M+1 ;
8: else if (s_ pln M+1 > threshold_close) ∧ (s_usd M+1 > 5.1 MyStrategy
threshold_close) then
9: D ← heuristic_close(s_ pln M+1 , s_usd M+1 ); The strategy called MyStrategy is built of the basis of
10: else
11: D ← heuristic_don othing(); the following technical analysis, fundamental analysis, and
12: end if behavior-based agents’ signals:

• FuzzyRSI based on the Relative Strength Index indicator,


indicates the 24-hour rolling average score of references in • FuzzyROC based on the Rate of Change indicator,
news and social networks to overall positive references, net • FuzzyCCI based on the Commodity Channel Index indi-
of negative references. The OPTIMISM index is a bipolar cator,
emotional indicator in the range of -1 to 1. For interpretation • FuzzyMACD based on the Moving Average Convergence
purposes, gradual improvement of the SENTIMENT drives Divergence indicator,
the continuation of the trend. • FuzzyBollinger based on the Bollinger Bands indicator,
As mentioned above, agents can generate decisions that • FuzzyWilliams based on the Williams %R indicator,
may be mutually consistent or completely contradictory. • FuzzyNeuralNetIndices,
In A-Trader, the conflicts between agents are resolved by • BehavioralAgent.
the Supervisor. This agent receives signals from decision-
making agents and evaluates their performance. Through this
This strategy is run so that the open / close short / long
evaluation, the Supervisor determines the agents for building
position signal is generated when the average of fuzzy agent
investment strategies. In this way, the Supervisor can apply
signals is higher / lower than a predefined threshold.
various strategies to generate open/close long/short position
The strategy can be defined as follows:
signals. The following section describes examples of these
strategies.
Algorithm 4 The specification of MyStrategy.
Input: Signals AM = {AM 1 , AM 2 , . . . , AM 8 },
5 Trading strategy construction 1: thresholdo pen, thresholdc lose
2: / * the threshold level for the open long / closed short position, for
The strategies of A-Trader are built on the basis of the fol- close long/open short position */
lowing assumptions: Output: position
3: /* value 1 – open long and closed short position, value -1 open short
and closed long position, value 0 – out of market */
1. Buy/sell decisions generated by a Cloud of Computing 4: S ← 0;
Agents form a base for strategy building. Every agent 5: for i ← 1 to 8 do
6: S ← S + AM i ;
running in this Cloud sends its decision to the NA based
7: end for
on a unique decision method for each agent. 8: S ← S/8;
2. The Supervisor Agent builds investment strategies based 9: position ← 0;
on buy/sell decisions generated by Cloud Computing 10: if S ≥ threshold_open then
11: position ← 1;
Agents (read from NA). These strategies generate the
12: end if
open/close long/short position signals. 13: if S ≤ threshold_close then
3. Users–traders or bots (automatic traders), who invest in 14: position ← −1;
FOREX. 15: end if

123
11698 M. Hernes et al.

5.2 Consensus strategy position rules for the agent at time T0 can be specified as
follows:
The strategy Consensus, built on developing a consensus that
determines the issues for financial decisions, is described in A1 T0 ∗ wso1 + · · · + An T0 ∗ wson T h so
detail in [41, 42]. The consensus agent, presented in detail ∧
in [36], develops a trading strategy based on a set of decisions (A1 T0 ∗ Cso1 0) ∨ (Cso1 = 0)
generated by fuzzy logic agents. ∧ (1)
The strategy can be specified as follows: ..
.

Algorithm 5 The specification of Consensus. (An T0 ∗ Cson 0) ∨ (Cson = 0)
Input: A = {D 1 , D 2 , . . . , D M },
1: thresholdo pen, thresholdc lose where:
2: /* The profile (set of decisions of M fuzzy logic agents, where M
An T0 – value of Agent n signal in time T0 ,
denotes the number of fuzzy logic agents, and D 1 , D 2 , . . . , D M
denotes decisions of particular agents), the threshold level for the ws on – weighting for Agent n short position opening,
open long / closed short position, the level of threshold for close T h s o – threshold for Agent n short position opening,
long/open short position */ Cs on – compulsory parameter for Agent n short position
Output: position
opening.
3: /* value 1 –open long and closed short position, value -1 open short
and closed long position, value 0 – out of market */ The conditions for the open/close short/long position are
4: C O N ← 0; /* consensus */ divided into two parts. The algorithm checks if a thresh-
5: B ← Sor t_ Asc(A); old is reached in the first part. The threshold is checked by
6: /* B = {B 1 , B 2 , . . . , B M } – ascending order of the values of profile
multiplying the signals of each agent by the corresponding
A */
7: i ← Floor ((M + 1)/2); weightings, then all the results are to be summed up. The
8: j ← Ceil((M + 2/2); first part of the condition is met if the sum is higher than
9: Set C O N as any value from interval [B i , B j ]; the opening short position threshold. The algorithm checks
10: position ← 0;
if all the mandatory rules are met in the second part of the
11: if C O N ≥ threshold_open then
12: position ← 1; condition. If a compulsory parameter of Agent 1 (OSO1) is
13: end if equal to zero, the algorithm ’does not care’ what the value
14: if C O N ≤ threshold_close then of Agent 1 is. If the parameter is equal to 1, the condition
15: position ← −1;
will be fulfilled only when the signal value of Agent 1 is
16: end if
positive. Similarly, in the case where the compulsory param-
eter is equal to -1, the algorithm expects a negative value of
Agent 1. The compulsory parameters are checked for every
5.3 Evolution-based strategy advising agent. The strategy can be specified as follows.

The strategy Evolution-based is developed based on work [52]. 5.4 Deep learning strategy
This strategy determines the best thresholds for open/close
long/short positions based on decisions generated by tech- The Deep learning strategy has been implemented on an
nical analysis agents, fundamental analysis agents, and open-source H2 O platform [24]. It is a distributed, scal-
behavior-based agents. The Evolution-based strategy deter- able, and interactive in-memory data analysis and modeling
mines which agents should be considered when generating solution. This platform consists of several data analysis
long/closed open/short position signals. It also determines the models, including the Deep Learning Model, for Big Data
importance of decisions generated by a specific agent. The exploration. In our approach, H2 O has been integrated with
evolutionary algorithm indicates the space of agent decisions A-Trader.
and weights their importance. The genotype in Fig. 3 consists The DeepLearningH 2 O Agent is controlled by Supervisor
of the weightings and thresholds for the opening / closing of and runs in two modes, cf. Figure 4:
the short / long position for each agent separately.
In addition to weighting and thresholds, every advisory
1. Learning mode (continuous) divided into the following
agent is characterized by ’compulsory’ parameters. These
steps:
parameters mean that the agent’s signal value must be open,
close, or ’don’t care’. The genotype also consists of values • Import time series from A-Trader to H2 O plat-
such as Profit Taking, Trailing Stop and Stop Loss for long form (H2 O is external module of A-Trader, therefore
and short positions. The result of this algorithm is a pheno- data are imported indirectly from A-Trader database,
type - a set of decision rules. For example, the open short Notification Agent signals are not used),

123
Multi-agent platform to support trading... 11699

Fig. 3 Genotype used in the Evolution-based strategy

• Deep Learning (DL) model specification, • Building of DL model – on the basis of imported data
• DL model Parametrization – (parameters such as;- structure and determined parameters,
number of training epochs, number of hidden layers, • Learning and Testing – where the training and the val-
stopping rounds, stopping metrics, etc), idation datasets are used. Long Short Term Memory

Fig. 4 Schema of Deep


Learning strategy

123
11700 M. Hernes et al.

Algorithm 6 The specification of Evolution-based. networks including MLP, etc.), text messages analysis-
Input: V = {V 1 , V 2 , . . . , V M }, based agents, market behavior-based agents.
1: /* The vector of M decisions of fuzzy logic agents, where M • Decisions of Basic Agents and Intelligent Agents are sent
denotes the number of fuzzy logic agents running in the system, to the Supervisor Agent.
V 1 , V 2 , . . . , V M denotes the decisions of particular agents */
Output: position
2: /* value 1 – open long and closed short position, value -1 open short Formally, the model used by DeepLearningH 2 O Agent is
and close long position, value 0 – out of market – close short/long defined as follows:
position*/
 
3: if Check Per f or manceLevel() then
4: Begin Lear ni ng Pr ocess();
i
Yt+1 = DL M x i , x p , . . . , x q (2)
5: end if
6: position ← 0;
7: if Long Position O pened then where:
8: if Long Position O pened then x i is an input vector of the main quote rate of return,
9: if CheckClosingLong PositionCondition(V ) then x p , . . . , x q are inputs vectors consist of the rates of return
10: position ← −1;
11: end if
of the quotations correlated with main quotation (e.g., main
12: end if quotation is EUR/USD and correlated quotations are gold
13: if Shor t Position O pened then quotations and oil quotations).
14: if CheckClosingShort PositionCondition(V ) then This model uses log-return rates, calculated as follows:
15: CloseShor t Position();
16: position ← 1;  
Sti
17: end if r (t) = log
j
i
(3)
18: end if St−1
19: if Check O peningLong PositionCondition(V ) then
20: position ← 1;
21: end if where S it denotes a price of quotation i at time t.
22: if Check O peningShort PositionCondition(V ) then H2 O normalizes log-return rates and projects them in the
23: position ← −1; range from -1 to 1. Input vector related to main quotation is
24: end if defined as follows:
25: end if
 
x i = r j (t), r j (t − 1), . . . , r j (t − k) (4)
architecture of the deep neural network was used. The
architecture and hyperparameters of the model are as where k denotes the number of past quotations used as input.
follows: three hidden LSTM layers (16, 8 and 4 units), Yt+1 values are in the range [-1, 1] (generated as fuzzy
dropout layer (rate 0.3), RELU activation function logic signals) and predict logarithmic return rates at time
for hidden layers and linear activation function for t + 1 (normalized value).
output layer, loss function: mean squared error, opti- The training set consists of input vectors x i and inputs
mizer: adam, metrics: mse, mae, mape, msle, number x , . . . , x q at time t, t − 1, etc., and output at time t + 1. The
p
of epochs:100, batch size:32. learning process is performed on the basis of historical time
2. Forecast mode (continuous) – time series of quotations series; hence the log-return rate at time t + 1 is known.
are continuously imported from the A-Trader database, The Supervisor Agent uses different strategies to gen-
and the trained model is used for predicting rates of erate opening/closing positions, on the basis of the output
return. of DeepLearningH 2 O Agent using for instance, consensus
strategy or a genetic algorithm, whereas a genetic algo-
rithm determines threshold levels for open/closed short/long
The DeepLearningH 2 O Agent is supported also by the positions. The Supervisor also determines the mode of
following agents [43]: DeepLearningH 2 O Agent operation. If the performance of
DeepLearningH 2 O Agent is low (performance measuring
• Basic Agents - perform time series pre-processing and issues are presented in the next section), then a learning mode
compute the basic indicators; agents can learn and change is initiated. If performance is high, a forecasting mode is run
their parameters and internal states based on their knowl- using a previously generated model.
edge. The strategies provided by A-Trader can be reused and
• Intelligent Agents – running on the basis of artificial intel- extended. The user (trader) can add a new agent or source
ligence (genetic algorithms, rule-based systems, neural of information by filling out a generic pattern of the agent

123
Multi-agent platform to support trading... 11701

structure. This is a process of inserting selected agents into tion) of generated signals (the green line denotes the "long
your trading strategy. position", the red one denotes the "short position").
3. The Buy and Hold (B&H) strategy was used as a bench-
mark (the B&H strategy relies on opening a position at
6 Experiments the beginning of the investment period and closing it at
the end of this period).
The main aim of the experiments is to evaluate the perfor- 4. Performance analysis ratios (absolute ratios) were mea-
mance of selected trading strategies. The specific aims are as sured in ’pips’ (a change in FOREX price of a ’point’ is
follows: called a pip).
5. The cost of transactions is directly proportional to the
• running the investment strategies, developed in A-Trader, number of transactions.
using real data form FOREX market, 6. It was assumed that in each transaction the investor
• the assessment of long/short positions results using engages 100% of the capital held where the trader can
return-based and risk-based measures, individually determine the capital management strategy.
• comparing the performance of strategies to Buy and Hold 7. The following measures (ratios) were used in the perfor-
benchmark, mance analysis [44–48]:
• confirming the results using statistical tests.
• Rate of return (ratio x1 ),
Back-testing is used to verify that the A-Trader strategies • Number of transactions,
were based on the following. • Gross profit (ratio x2 ),
• Gross loss (ratio x3 ),
1. GBP/PLN quotations were selected from randomly • Number of profitable transactions (ratio x4 ),
selected periods, namely • Number of profitable consecutive transactions (ratio
x5 ),
• 16-04-2018, 0:00 am to 19-04-2018, 23:59 pm, • Number of unprofitable consecutive transactions
• 23-04-2018, 0:00 am to 26-04-2018, 23:59 pm, (ratio x6 ),
• 14-05-2018, 0:00 am to 17-05-2018, 23:59 pm. • Sharpe ratio (ratio x7 ),
2. The strategies MyStrategy, Consensus, Evolution-based • Average coefficient of variation (ratio x8 ),
were used to generate trading signals (open long/close • Average rate of return per transaction (ratio x9 ),
short position equals 1, close long/open short position counted as the quotient of the rate of return and the
equals -1). Figure 5 presents an example (with descrip- number of transactions.

Fig. 5 Example of strategy visualization

123
11702

123
Table 1 Performance analysis results
MyStrategy Consensus Deep learning B&H
Ratio Period 1 Period 2 Period 3 Period 1 Period 2 Period 3 Period 1 Period 2 Period 3 Period 1 Period 2 Period 3

Rate of return [Pips] -1244 5017 7824 -1149 5257 7698 -968 5412 7736 -1487 4872 7360
The number of transactions 381 59 323 162 47 139 211 59 234 1 1 1
Gross profit [Pips] 103 186 197 146 217 245 182 254 238 0 4872 198
Gross loss [Pips] 126 77 145 157 149 183 143 161 176 -1487 0 0
The number of profitable transactions 204 38 198 74 32 86 127 172 95 0 1 1
The number of profitable consecutive transactions 10 6 11 5 6 12 12 17 10 0 1 1
The number of unprofitable consecutive transactions 7 4 6 4 2 3 4 2 5 1 0 0
Sharpe ratio 0.60 0.52 0.32 1.92 1.24 2.49 0.92 1.17 1.79 0 0 0
The average coefficient of variation 0,79 0.89 0.83 0.62 0.18 0.35 0.70 0.43 0.58 0 0 0
The average rate of return per transaction 4.25 5.18 3.50 -7.09 111.85 55.38 -4.59 91.72 33.05 -1487 4872 7360
Value of evaluation function (y) 0.23 0.32 0.34 0.41 0.36 0.43 0.47 0.44 0.38 0.08 0.26 0.21
M. Hernes et al.
Multi-agent platform to support trading... 11703

8. For comparison of the agent performance, the evaluation Table 2 Results of Friedman ANOVA test, POST-HOC (Dunn Bonfer-
function was elaborated, defined as follows: roni) for period 1
p-value MyStrategy Consensus Deep learning
y = (a1 x1 + a2 x2 + a3 (1 − x3 ) + a4 x4 + a5 x5
MyStrategy ≤ 0.000001 ≤ 0.000001
+a6 (1 − x6 ) + a7 x7 + a8 (1 − x8 ) + a9 x9 (5) Consensus ≤ 0.000001 0,005493
Deep learning ≤ 0.000001 0,005493
where xi denotes the normalized values of ratios from x1 to x9
(mentioned in item 6). For this experiment, coefficients were
set as follows: x1 to x9 = 1/9. However, it is possible to adopt The evaluation analysis in other trading systems (e.g.,
other values for these coefficients. They can be modified Trade Chimp, XTRADE, MetaTrader) is performed "man-
using, for example, an evolution-based method, or they can ually" by the investor in most cases, and this is a very
be determined by the trader according to his/her preferences. time-consuming process during which there is limited work-
The functions can be easily modified, and they aggregate ing of the system in real time. These systems offer basic
many assessment indicators so that users can choose which performance measures: rate of return, highest profit, highest
assessment criteria are most important to them. For exam- loss, number of transactions, total profit, number of profitable
ple, a trader may be interested in achieving a high rate of transactions, number of profitable consecutive transactions,
return with a high level of risk or a low risk with a low rate of number of unprofitable consecutive transactions. A-Trader
return. Coefficients are needed because the user can arbitrar- calculates additional ratios, such as risk measurements (aver-
ily classify individual components. The function y returns age coefficient of variation, Sharpe ratio), or the average rate
values from the range [0 . . . 1], and the agent’s performance of return for a specific transaction.
is assigned proportionally to the function value. This is just The A-Trader evaluation function enables the measure-
one of the evaluation functions, as A-Trader allows a user to ment and evaluation of investment strategies. These opera-
build other functions. tions are performed automatically by the Supervisor Agent
Table 1 presents the results of the performance analysis. (in time close to real time), which may then advise the
A wide number of changes in particular ratio values signif- investor to trade on the basis of the decisions generated by
icantly hinder the analysis by the trader and. Consequently, the strategy characterized by the highest performance level.
making decisions in time close to real time is very difficult. In addition, users can change the parameters ai and xi of this
The results of the experiment allow us to come to the con- function to consider the preferences of the user related to
clusion that the strategy ranking differs in particular periods. particular performance measures. To confirm the results, sta-
In the first and second periods, Deep learning was the tistical tests were performed separately for particular periods
best evaluated strategy. In the third period, the best was the using the rate of returns generated by particular transactions
Evolution-based strategy. MyStrategy was evaluated worse in selecting a given strategy as input data. PQStat software 2
than Deep learning and Consensus and B&H was ranked the was used for this and the following hypothesis was assumed:
lowest in all periods.
Considering all periods, it can be stated that the highest 1. H0 – the given strategy was not the best in the given
rate of return characterized the Deep learning strategy, it period (the rates of return achieved are not statistically
was ranked highest in two of the three periods. There was a significant).
lower value of the evaluation function in the third period than 2. H1 – the given strategy is the best in the given period (the
in Consensus case, which may result from lower values of rates of return achieved are statistically significant).
ratios such as the average rate of return per transaction and
risk measures. The Consensus strategy achieved the lowest First, normality tests were performed. Data are character-
values for risk measures. It can also be concluded that the ized by a nonnormal distribution at the 5% significance
low evaluation of MyStrategy in all periods is due not only level; therefore, a Friedman ANOVA test was performed that
to the level of the rate of return but also to a high risk level included POST-HOC (Dunn Bonferroni). The results are pre-
and a large number of unprofitable consecutive transactions. sented in Tables 2, 3, and 4.
The MyStrategy is simple strategy based on decisions gener- The calculated p-values between the returns rates gener-
ated by particular agents. The results achieved by MyStrategy ated by particular strategies are less than 0.05 in all periods.
allow us to draw conclusions that more sophisticated multi- The lower probability of the p-value indicates stronger
agent-based methods, such as consensus or deep learning, evidence against the null hypothesis. Therefore, the null
can perform better than simple strategies. The comparison hypothesis can be rejected and the return rates generated by
of multi-agent-based methods and stand-alone methods is
presented in our earlier research, for example [13, 36, 37]. 2 PQStat software, https://pqstat.pl/

123
11704 M. Hernes et al.

Table 3 Results of Friedman ANOVA test, POST-HOC (Dunn Bonfer- encompasses a broad spectrum of performance measures,
roni) for period 2 including risk-focused metrics, underscoring the critical role
p-value MyStrategy Consensus Deep learning of risk management. This emphasis is rooted in the inherent
uncertainty and risk associated with financial investments in
MyStrategy ≤ 0.000001 ≤ 0.000001
the FOREX market, influenced by economic cycles, interest
Consensus ≤ 0.000001 ≤ 0.000001
rates, government policies, and exchange rates [53]. In con-
Deep learning ≤ 0.000001 ≤ 0.000001 trast to existing platforms, A-Trader harnesses the consensual
advice generated by multiple software agents that are profi-
cient in fundamental, technical, and behavioral analyses [18].
all strategies are statistically significant, suggesting that there
Crucially, A-Trader refrains from imposing uniform evalua-
is a significant difference between strategies. By ranking the
tion strategies or functions on every user. The construction of
strategies according to the performance scores on three series
the investment strategy assessment function remains an open
of quotes, the Deep Learning strategy can be rated the high-
endeavor, acknowledging that a one-size-fits-all solution may
est.
not exist. The paper effectively illustrates that the suitability
of a linear function is expected. However, adopting a non-
linear function can be intricate and must be more readily
7 Conclusions
understandable to investors, often shrouded in secrecy among
financial experts. A-Trader stands as an open system, giving
The paper delves into several crucial aspects of designing
users the tools to fashion their strategies and seamlessly inte-
decision support systems for stock traders through the lens
grate strategies created in other software environments.
of a multi-agent platform. Within the presented A-Trader sys-
This research offers several noteworthy contributions both
tem, agents autonomously generate buy-sell decisions using
to the scientific understanding of financial decision support
various methods and algorithms, which serve as the foun-
systems and the practical application of these systems in real-
dation for crafting investment strategies. Given the diversity
world trading scenarios, notably in the areas of:
of these decisions and strategies, the evaluation process is
overseen by a specialized program known as the Supervi-
sor Agent. This agent enables autonomous selection of the • Integration of Diverse Decision Sources: A-Trader inte-
most suitable strategy in near-real time, determining when grates a wide range of decision sources by enabling
to open or close long and short positions based on the best multiple agents to generate independent buy-sell deci-
strategy identified for a given period. The results of the sions. This diversity of sources provides a comprehensive
experiments described in this paper and previous experi- view of market dynamics and contributes to a more holis-
ments (see [36, 49]) highlight that the performance of specific tic decision-making process.
decisions or strategies fluctuates in response to the pre- • Agent supervision: The introduction of the Supervisor
vailing conditions in the FOREX market. Through many Agent serves as a pivotal contribution. This agent takes
experiments, it has been clearly demonstrated that no sin- on the task of evaluating the heterogeneity of decisions
gle agent or strategy consistently outperforms others across and strategies. It intelligently selects the best strategy
all periods. The introduction of an evaluation function fur- in response to the current market conditions, offering
ther enhances this process. A-Trader distinguishes itself with traders a pragmatic solution.
its remarkable flexibility in configuring variables and eval- • Dynamic Strategy Selection: The research highlights that
uation functions, providing a dynamic, data-driven platform no single agent or strategy consistently outperforms oth-
for user engagement. Investors can assess various strategies ers in all market conditions. This observation underscores
regarding returns and risks, allowing for tailored adjustments the need for an adaptive and dynamic approach to strat-
aligned with their unique requirements. In addition, A-Trader egy selection. Using an evaluation function empowers the
Supervisor Agent to automatically identify the best strat-
egy in near-real time, enhancing investment effectiveness
Table 4 Results of Friedman ANOVA test, POST-HOC (Dunn Bonfer-
roni) for period 3 and responsiveness to market changes.
• Flexibility in Evaluation Functions: A-Trader allows
p-value MyStrategy Consensus Deep learning
users to configure variables and evaluation functions, pro-
MyStrategy 0,006515 ≤ 0.000001 moting a data-driven approach to user engagement. This
Consensus 0,006515 ≤ 0.000001 flexibility ensures that investors can tailor their strategies
Deep learning ≤ 0.000001 ≤ 0.000001 based on their unique risk tolerance and performance cri-
teria preferences.

123
Multi-agent platform to support trading... 11705

• Risk Management Integration: A-Trader acknowledges Data Availability Data will be made available on request.
the inherent risk and uncertainty associated with finan-
cial investments in the FOREX market. By considering Declarations
a wide range of performance measures, including risk-
based metrics, the platform emphasizes the importance
Competing of interest The authors have no competing interests to
of risk management. This is a crucial scientific contribu- declare that are relevant to the content of this article.
tion, as it addresses a key challenge in real-world trading.
• Open System and Interoperability: A-Trader’s open sys- Ethical and informed consent for data used This article does not
tem architecture is a scientific breakthrough. It allows involve any studies with human participants or animals performed by
any of the authors.
users to seamlessly build their strategies and integrate
strategies from other software environments. This inter- Open Access This article is licensed under a Creative Commons
operability enhances the practical utility of the platform, Attribution 4.0 International License, which permits use, sharing, adap-
making it adaptable to the diverse needs of traders and tation, distribution and reproduction in any medium or format, as
investors. long as you give appropriate credit to the original author(s) and the
source, provide a link to the Creative Commons licence, and indi-
cate if changes were made. The images or other third party material
In a pragmatic sense, A-Trader offers traders, investors, in this article are included in the article’s Creative Commons licence,
unless indicated otherwise in a credit line to the material. If material
and market participants a sophisticated tool that leverages is not included in the article’s Creative Commons licence and your
multiple agents for decision support. Provides a more adapt- intended use is not permitted by statutory regulation or exceeds the
able and responsive approach to trading in the dynamic permitted use, you will need to obtain permission directly from the copy-
FOREX market. In addition, it is a pioneering platform right holder. To view a copy of this licence, visit http://creativecomm
ons.org/licenses/by/4.0/.
that bridges the gap between scientific research and prac-
tical trading strategies. The limitation of this approach is
the high computational complexity it entails. For example,
when A-Trader runs for a month, it processes a substan- References
tial amount of data, approximately 1TB. In addition, there
is a lack of direct communication between agents, and the 1. Rundo F (2019) Deep lstm with reinforcement learning layer for
Notification Agent acts as an intermediary to transmit sig- financial trend prediction in fx high frequency trading systems.
nals. Consequently, this agent is a critical component of Appl Sci 9(20). https://doi.org/10.3390/app9204460
2. Chen HJ, Chen SJ, Chen Z, Li F (2019) Empirical investigation of
system performance. The limitation of this research is that an equity pairs trading strategy. Manage Sci 65(1):370–389
we used only one pair of quotations in the experiments. These 3. Tadelis S (2016) Reputation and feedback systems in online plat-
challenges will be the focus of further research. The ongo- form markets. Annual Review of Economics 8(1):321–340. https://
ing research will include developing a directional change doi.org/10.1146/annurev-economics-080315-015325
4. Freitas FD, Freitas CD, De Souza AF (2013) System architecture
algorithm, an evolutionary approach to determine learning for on-line optimization of automated trading strategies. In: Pro-
parameters, and implementing cognitive agents based on fun- ceedings of the 6th workshop on high performance computational
damental analysis and expert opinions. Further research on finance. WHPCF ’13. Association for Computing Machinery, New
the application of spiking neural networks in a-Trader should York, NY, USA. https://doi.org/10.1145/2535557.2535563
5. Zhou S (2023) Forex automated trading system establishment and
also be performed. Overall, the contributions of this work optimization analysis. Inform Syst Econ 63–69. https://doi.org/0.
extend beyond the theoretical realm, demonstrating a com- 23977/infse.2023.040710
mitment to addressing the practical challenges traders and 6. Roostaee MR, Abin, AA (2023) Forecasting financial signal for
investors face in real-time decision making within financial automated trading: An interpretable approach. Expert Syst Appl
211:118570. https://doi.org/10.1016/j.eswa.2022.118570
markets. This multidimensional approach to financial deci- 7. Ismail MAH, Yasruddin ML, Husin Z, Tan WK (2022) Automated
sion support promises to enhance investment effectiveness trading system for forecasting the foreign exchange market using
and contribute to the broader field of algorithmic trading. technical analysis indicators and artificial neural network. In: 2022
IEEE 18th International colloquium on signal processing & appli-
Author Contributions Conceptualization: Jerzy Korczak, Marcin Hernes; cations (CSPA), pp 63–68. https://doi.org/10.1109/CSPA55076.
Methodology: Jerzy Korczak, Marcin Hernes; Formal analysis and 2022.9781856
investigation: Jörg Becker, Dariusz Król; Writing - original draft prepa- 8. Aru O, Okechukwu C (2023) development of an optimized intel-
ration: Marcin Hernes, Maciej Pondel, Dariusz Król; Writing - review ligent machine learning approach in forex trading using moving
and editing: Jerzy Korczak, Jörg Becker; Funding acquisition: Marcin average indicators. LAUTECH Journal of Engineering and Tech-
Hernes; Resources: Marcin Hernes, Maciej Pondel; Supervision: Jerzy nology 17(2):18–27
Korczak, Marcin Hernes. 9. Thompson JR (2013) Analysis of market returns using multifractal
time series and agent-based simulation. PhD thesis. AAI3575853
Funding This research was founded by the Ministry of Science and 10. Wah E, Wellman MP (2013) Latency arbitrage, market fragmenta-
Higher Education in Poland under the program "Regional Initiative of tion, and efficiency: A two-market model. In: Proceedings of the
Excellence" [No. 015/RID/2018/19]. fourteenth ACM conference on electronic commerce. EC ’13, pp.

123
11706 M. Hernes et al.

855–872. Association for Computing Machinery, New York, NY, 27. Hinton GE, Osindero S, Teh Y-W (2006) A fast learning algorithm
USA. https://doi.org/10.1145/2482540.2482577 for deep belief nets. Neural Comput 18(7):1527–1554. https://doi.
11. Ishikawa K, Nakata K (2021) Online trading models with deep org/10.1162/neco.2006.18.7.1527
reinforcement learning in the forex market considering transaction 28. Kuremoto T, Kimura S, Kobayashi K, Obayashi M (2014) Time
costs. arXiv:2106.03035 series forecasting using a deep belief network with restricted boltz-
12. Taleb NN (2018) Election predictions as martingales: an arbitrage mann machines. Neurocomputing 137:47–56. https://doi.org/10.
approach. Quantitative Finance 18(1):1–5. https://doi.org/10.1080/ 1016/j.neucom.2013.03.047
14697688.2017.1395230 29. Yang S, Chen B (2023) Snib: Improving spike-based machine
13. Korczak J, Hernes M, Bac M (2017) Collective intelligence learning using nonlinear information bottleneck. IEEE Transac-
supporting trading decisions on forex market. In: Nguyen NT, tions on Systems, Man, and Cybernetics: Systems 53(12):7852–
Papadopoulos GA, Je˛drzejowicz P, Trawiński B, Vossen G (eds) 7863. https://doi.org/10.1109/TSMC.2023.3300318
Computational Collective Intelligence. Springer, Berlin, Heidel- 30. Yang CBS (2023) Effective surrogate gradient learning with high-
berg, pp 113–122 order information bottleneck for spike-based machine intelligence.
14. Huang Z, Tanaka F (2022) Mspm: A modularized and scal- IEEE Transactions on neural networks and learning systems.
able multi-agent reinforcement learning-based system for financial https://doi.org/10.1109/TNNLS.2023.3329525
portfolio management. PLoS ONE 17(2):1–24. https://doi.org/10. 31. Yang S, Pang Y, Wang H, Lei T, Pan J, Wang J, Jin Y (2023) Spike-
1371/journal.pone.0263689 driven multi-scale learning with hybrid mechanisms of spiking
15. Shavandi A, Khedmati, M (2022) A multi-agent deep reinforce- dendrites. Neurocomputing 542:126240. https://doi.org/10.1016/
ment learning framework for algorithmic trading in financial j.neucom.2023.126240
markets. Expert Syst Appl 208:118124. https://doi.org/10.1016/ 32. Gerlein EA, McGinnity M, Belatreche A, Coleman S (2016) Eval-
j.eswa.2022.118124 uating machine learning classification for financial trading: An
16. He F-F, Chen C-T, Huang S-H (2023) A multi-agent virtual market empirical approach. Expert Syst Appl 54:193–207. https://doi.org/
model for generalization in reinforcement learning based trading 10.1016/j.eswa.2016.01.018
strategies. Appl Soft Comput 134:109985. https://doi.org/10.1016/ 33. Talebi H, Hoang W, Gavrilova ML (2014) Multi-scale foreign
j.asoc.2023.109985 exchange rates ensemble for classification of trends in forex mar-
17. Vadori N, Ardon L, Ganesh S, Spooner T, Amrouni S, Vann J, Xu M, ket. Procedia Computer Science 29:2065–2075. https://doi.org/10.
Zheng Z, Balch T, Veloso M (2024) Towards multi-agent reinforce- 1016/j.procs.2014.05.190
ment learning-driven over-the-counter market simulations. Math 34. Mayo M (2012) Evolutionary data selection for enhancing models
Financ 34(2):262–347. https://doi.org/10.1111/mafi.12416 of intraday forex time series. In: Di Chio C at al (eds) Applica-
18. Loginov A, Heywood MI (2014) On evolving multi-agent fx tions of evolutionary computation, Springer, Berlin, Heidelberg,
traders. In: Esparcia-Alcázar AI, Mora AM (eds) Applications of pp. 184–193
Evolutionary Computation. Springer, Berlin, Heidelberg, pp 203– 35. Agarwal S (2011) Toward a push-scalable global internet. In:
214 2011 IEEE Conference on computer communications workshops
19. Loginov A, Heywood MI (2013) On the utility of trading crite- (INFOCOM WKSHPS), pp 786–791. https://doi.org/10.1109/
ria based retraining in forex markets. In: Esparcia-Alcázar AI (ed) INFCOMW.2011.5928918
Applications of evolutionary computation. Springer, Berlin, Hei- 36. Korczak J, Hernes M, Bac M (2013) Risk avoiding strategy in
delberg, pp 192–202 multi-agent trading system. In: Ganzha M, Maciaszek MPL (ed.)
20. Kahneman D, Rosenfield AM, Gandhi L, Blaser T (2016) Reducing Proceedings of the 2013 federated conference on computer science
noise in decision making. Harv Bus Rev 94(12):18 and information systems, IEEE, Los Alamitos, CA, pp 1119–1126
21. Kočišová J, Horváth D, Kasanický T, Buša J (2012) Prediction 37. Korczak J, Hernes M, Bac M (2014) Performance evaluation of
of financial markets using agent-based modeling with optimiza- decision-making agents’ in the multi-agent system. In: 2014 Fed-
tion driven by statistical evaluation of historical data. In: Adam G, erated Conference on Computer Science and Information Systems,
Buša J, Hnatič M (eds) Mathematical modeling and computational pp 1171–1180. https://doi.org/10.15439/2014F188
science. Springer, Berlin, Heidelberg, pp 308–313 38. Longo JM (2014) Trading and Investment Strategies in Behavioral
22. Sarani D, Rashidi-Khazaee, DP (2024) A Deep Reinforcement Finance, Wiley Ltd, Hoboken, New Jersey. Chap. 27, pp 495–512.
Learning Approach for Trading Optimization in the Forex Mar- https://doi.org/10.1002/9781118813454.ch27
ket with Multi-Agent Asynchronous Distribution. https://arxiv.org/ 39. Shiller RJ (2012) Finance and the Good Society. Princeton Univer-
abs/2405.19982 sity Press, New Jersey, United States
23. Abraham A (2002) Analysis of hybrid soft and hard computing 40. Lento C (2009) The combined signal approach to technical analy-
techniques for forex monitoring systems. In: 2002 IEEE World sis: A review & commentary. SSRN Electron J. https://doi.org/10.
congress on computational intelligence. 2002 IEEE International 2139/ssrn.1410899
conference on fuzzy systems. FUZZ-IEEE’02. Proceedings, vol 2, 41. Hernes M, Nguyen NT (2007) Deriving consensus for hierarchical
pp 1616–1621. https://doi.org/10.1109/FUZZ.2002.1006749 incomplete ordered partitions and coverings. J Univ Comput Sci
24. Sher GI (2012) Forex trading using geometry sensitive neural net- 13(2):317–328
works. In: Proceedings of the 14th annual conference companion 42. Hernes M, Sobieska-Karpińska J (2016) Application of the con-
on genetic and evolutionary computation. GECCO ’12, pp 1533– sensus method in a multiagent financial decision support system.
1534. ACM, New York. https://doi.org/10.1145/2330784.2331032 Inf Syst E-bus Manag 14(1):167–185. https://doi.org/10.1007/
25. Khosravi H, Shiri ME, Khosravi H, Iranmanesh E, Davoodi A s10257-015-0280-9
(2009) Tactic- a multi behavioral agent for trading agent compe- 43. Korczak J, Hernes M (2017) Deep learning for financial time series
tition. In: Sarbazi-Azad H, Parhami B, Miremadi S-G, Hessabi forecasting in a-trader system. In: 2017 Federated conference on
S (eds) Advances in computer science and engineering. Springer, computer science and information systems (FedCSIS), pp 905–
Berlin, Heidelberg, pp 811–815 912. https://doi.org/10.15439/2017F449
26. Mozetic I, Gabrovsek P, Novak PK (2018) Forex trading 44. Hu D, Schwabe G, Li X (2015) Systemic risk management and
and twitter: Spam, bots, and reputation manipulation. CoRR investment analysis with financial network analytics: research
abs/1804.02233 opportunities and challenges. Financ Innov 1(1):2. https://doi.org/
10.1186/s40854-015-0001-x

123
Multi-agent platform to support trading... 11707

45. Hussain OK, Dillon TS, Hussain FK, Chang EJ (2013) Risk Assess- Jerzy Korczak is an expert in data
ment Phase: Financial Risk Assessment in Business Activities, science, computational intelligence,
pp 151–185. Springer, Berlin, Heidelberg. https://doi.org/10.1007/ image analysis, and recommenda-
978-3-642-28690-2_6 tion systems. He currently serves as
46. Lückoff P (2011) Mutual Fund Performance and Performance Per- a professor at the International Uni-
sistence. Gabler Verlag, Wiesbaden.https://doi.org/10.1007/978- versity of Logistics and Transport
3-8349-6527-1 in Wrocław, Poland, where he leads
47. Qiu Z (2016) Discussion of investment analysis method in the new research in business machine learning
round of the china stock bull market. In: Li M, Zhang Q, Zhang and intelligent management systems.
J, Li Y (eds) Proceedings of 2015 2nd international conference on With over 300 publications to his name
industrial economics system and industrial security engineering, and numerous research projects, his
Springer, Singapore, pp 311–317 work has garnered significant recog-
48. Yao Y-y, Zhang R-s (2016) Empirical research on efficiency mea- nition, evidenced by an h-index of 22
sure of financial investment in education based on se-dea. In: Cao and over 1,800 citations, according to
B-Y, Liu Z-L, Zhong Y-B, Mi H-H (eds) Fuzzy systems & opera- Google Scholar. Professor Korczak has
tions research and management, Springer, Cham, pp 389–402 more than 40 years of academic experience, including teaching and
49. Korczak J, Hernes M (2018) Performance evaluation of trading leadership in business-oriented AI projects. He has been an invited
strategies in multi-agent systems - case of a-trader. In: 2018 Fed- speaker at numerous conferences and events across Europe, US and
erated conference on computer science and information systems Asia. Previously, he was a professor and head of the Department of
(FedCSIS), pp 839–844 Information Technology at the University of Economics in Wrocław
50. Mancas D, Udristoiu S, Manole E, Lapadat B (2008) A comparison from 2006 to 2016. From 1986 to 2006, he was a professor of Infor-
of multi-agents competing for trading agents competition. WSEAS matics at Université Louis Pasteur in Strasbourg, France, where he
TRANS- ACTIONS on COMPUTERS 7(12):1916–1926 led the CNRS team on Image Data Mining at the Laboratory of Sci-
51. Calzi ML, Milone L, Pellizzari P (2010) Progress in Artificial Eco- ences of Image, Computer Science, and Remote Sensing (LSIIT, URA
nomics: Computational and Agent-Based Models. Springer, Berlin, CNRS 1871). During this time, he also served as the director of the
Heidelberg Research Team in Information Technology in Strasbourg.
52. Eiben AE, Smith JE (2015) Introduction to Evolutionary Com-
puting, 2nd edn. Springer, Berlin, Heidelberg, Natural Computing
Series. https://doi.org/10.1007/978-3-662-44874-8 Dariusz Krol is currently a Pro-
53. LeBaron B (2011) Active and passive learning in agent-based finan- fessor at Wrocław University of
cial markets. Eastern Economic Journal 37(1):35–43. https://doi. Science and Technology, Vice-
org/10.1057/eej.2010.53 Dean of General Affairs of the
Faculty of Information and Com-
munication Technology, and Head
of the Knowledge Engineer-
Publisher’s Note Springer Nature remains neutral with regard to juris- ing Group in the Department of
dictional claims in published maps and institutional affiliations. Applied Informatics. He has held
positions as Marie Curie Senior
Research Fellow at Bournemouth
University and DAAD Research
Marcin Hernes is an associate Fellow at the Friedrich-Alexander
professor, head of Department Universität. His research and
of Process Management, and teaching interests are oriented
chair of the Center for Intelligent toward knowledge engineering applications, data quality, compu-
Management Systems at Wro- tational intelligence, and cognitive technologies for adaptive and
claw University of Economics sustainable manufacturing systems. He has published over 150 peer-
and Business. His research has reviewed papers, co-authored three books, and co-edited four. He was
been concentrated on artificial an invited lecturer for many events throughout the UK, Europe, and
intelligence, knowledge manage- Asia in the last ten years. Prof. Król has 30 years of academic experi-
ment, decision support systems, ence and about 20 years as CEO and Head Leader in R&I projects. He
management systems, and cog- also works as a project evaluator for the European Commission. His
nitive architectures. He has prestigious contribution in the field was rewarded by IBM and granted
authored over 200 peer-reviewed by the European Commission, the Polish National Center for Science,
papers, published in international the Polish Ministry of Science and Higher Education, and DAAD. He
journals, and presented at con- has a great deal of hands-on experience with EU-funded projects and
ferences. Prof. Hernes is a member of IEEE, The Polish Artificial programs. Moreover, he has been elected to the Polish Accreditation
Intelligence Society, and Scientific Association of Business Informat- Committee in recognition of their professional standing.
ics. He was awarded the award of the Rector of Wroclaw University
of Economics and Business for scientific achievements several times.
Marcin Hernes is also a practitioner in management systems, coor-
dination and automation of production processes and multi-agent
decision support systems, and the author of dozens of computer appli-
cations in industrial companies and public administration entities.

123
11708 M. Hernes et al.

Maciej Pondel is a Doctor of Eco- Jörg Becker is head of the Depart-


nomics, associate professor, and ment of Information Systems of
Head of the Department of Busi- the University of Münster and of
ness Intelligence in Management the European Research Center for
at the Faculty of Management, Information Systems (ERCIS),
Wrocław University of Eco- an institutionalized network of
nomics. Tech Lead in the Data well known European (and non
& AI department at Unity Group. European) Research Institutions
He holds a degree in Computer in the field of Information Sys-
Science from the Faculty of Com- tems and Business Informatics.
puter Science and Management Jörg is Professor for Information
at Wrocław University of Science Systems and directs the Chair for
and Technology. Previously, he Information Systems and Infor-
worked as a programmer, project mation Management. He holds
manager, consultant, and prod- an honorary professorship at the
uct manager, where he was responsible, among other things, for the National Research University - Higher School of Economics (NRU-
development of the Upsaily system, which uses artificial intelligence HSE) in Moscow and is member of the North Rhine-Westphalian
techniques to analyze sales data. He has led numerous commercial Academy of Sciences, Humanities and the Arts. He was granted
as well as research and development projects. He has been involved doctorates honoris causa (Dr. h.c.) from the Universities of Turku
in the IT industry since 2000. His academic and practical expertise (Finland) and Voronesh (Russia). From 2008 to 2016, he served
focuses on artificial intelligence, machine learning, the application of the University of Münster as Pro-Rector for Strategic Planning and
machine learning in business management (particularly in sales and Quality Assurance and he was the CIO of the university. He acts
marketing), as well as databases, data warehouses, and Business Intel- as a chairperson of the National E-Government Competence Center
ligence systems and their role in digital transformation. He is also the NEGZ. He was advisor to former chancellor Angela Merkel con-
lead researcher in R&D projects related to the use of AI techniques in cerning all topics of E-Government. His research interests cover
medicine. He is the author of numerous scientific and business articles Information Modelling including Reference Modelling for Data and
and has been a speaker at both national and international conferences. Processes, Management Information Systems, Hybrid Value Creation,
A passionate advocate for innovation and the integration of science Business Process Management, E-Government, and Retail Informa-
and business. tion Systems. Jörg has published in renowned outlets, including MIS
Quarterly (MISQ), European Journal of Information Systems (EJIS),
Business & Information Systems Engineering (BISE), Information
Systems Frontiers (ISF), Information Systems Journal (ISJ), and Busi-
ness Process Management Journal (BPMJ). He has authored and
edited numerous books, including Retail Information Systems, Pro-
cess Management, Modernizing Processes in Public Administrations,
and Reference Modeling. He is editor-in-chief of Information Systems
and e-Business Management.

123

You might also like