1 Introduction

Financial markets are characterized by highly variable operating conditions, and financial decisions within those markets are therefore made under conditions of risk and uncertainty (Jajuga 2007). Making financial decisions is an ongoing process associated with multi-optionality due to the multicriterial nature of an investment decision, and subsequent decision-making situations occur chronologically near real-time. A decision-maker therefore faces the problem of choosing a satisfactory target variant for the decision, out of numerous options. The decision must be made near real-time. It is always fraught with risk—higher returns the decision-maker intends to obtain tend to be associated with more risk. The multi-optionality associated with decision-making entails a need for analyzing and evaluating considerable amounts of information, as well as drawing conclusions. Since these operations are time-consuming, and often impossible to perform by a decision-maker in real time, it is necessary to use automated information systems. Among these, there are multiagent financial decision support systems (MFDSS), consisting of several software agents. A software agent (in short—an agent) is an autonomous object which has a defined aim; it can communicate with other agents, take action, and react to changes within the environment of its operation.

The MFDSS allows automatic, rapid search for decision-relevant information and draws conclusions (Sobieska-Karpinska and Hernes 2010). This system also generates different variants of decisions. The rule is that each agent uses a different method of financial decision support (e.g., statistics, mathematics, behaviorism, artificial intelligence or experts’ opinion sentiment analysis), and that is why it may suggest variations of these decisions. To make a financial decision, it is necessary to choose from decisions presented by the agent, and opt for only one variant. Usually, the choice has to be made by the decision-maker, determining his/her level of satisfaction mainly related with rate of return and risk levels. Therefore, once more we are faced with the above-mentioned problem of selection. It may be helpful to automate the process. This can be accomplished for example by using certain criteria of evaluation; however, in case of their wrong or imprecise definition, there is increased risk of choosing an option which does not guarantee an adequate level of satisfaction. It is also possible to use the consensus method which enables one to determine the satisfactory variant on the basis of different decision variants. In the consensus variant, each party is taken into account, each party “loses” as little as possible, each party contributes to the consensus, all parties accept the consensus, and it is a representation of all parties of the conflict. A decision determined by this method does not have to be one of the decisions generated by one of the agents; it may be very similar to them. The consensus thus enables the determination of decisions in real time, which guarantees the achievement of a compromise at a lower level of risk, which in turn may lead to making a decision satisfactory for the decision-maker. The application of the consensus method, in order to determine the target solution presented to the user, shortens decision-making time because there is no need for analysis and reasoning or thinking about the selection of different versions of decisions generated by the system. It is characterized by a lower level of risk associated with this process, because if users had to make the final decision by themselves, they might choose a decision which would not bring a satisfactory result, and in the worst case, it could even result in a worse rate of return in comparison to the other variants of decisions.

This paper introduces the use of a consensus method in a multiagent decision support system, presents a verification of this method by using a prototype of the system, and demonstrates its effectiveness in practical applications, as well as investigates whether the use of the consensus method in a multiagent decision support system enables the generation of decisions that bring satisfactory benefits (an acceptable rate of return on investment) to investors. In order to perform this verification, a prototype of a MFDSS has been created, which provides decision support concerning the construction of a portfolio of shares taken by individuals investing in stock exchanges. In this case, it is possible to compare the results obtained by the method of consensus with the results of other methods of building a portfolio of shares. A verification conducted on historical stock prices will confirm their current prices and make it easier to determine the rate of return that would be achieved both by using the developed model and by employing other ways to build a portfolio of shares.

The paper has been divided into four parts. First, there is a review of the literature in the field of multiagent systems and consensus method; then, a MFDSS is characterized. The third part of the paper presents the strategy of the Supervisor Agent, which uses the consensus method. In the fourth part, the paper presents results of the verification of the consensus method.

2 Related works

Multiagent systems are considered in many works. For example (Mönch and Stehli 2006) present a framework for the implementation of multiagent-systems for production control of complex manufacturing systems. The system proposed by (Sycara et al. 2002) enabled the user to cooperate with multiple specialised agents which have access to financial models and supervise the operation of the system, the situation on the market, the environment and the pursuit of the user priorities on an ongoing basis. (Chiarella et al. 2006 ; Westerhoff 2011) describe a system where two groups of agents applying the methods of fundamental analysis and technical analysis shape market dynamics. A fundamental analysis is a method of evaluating a security that attems to measure its intrinsic value by examining related economic, financial and other qualitative and quantitative factors (Fundamental analysis 2015). A technical analysis a method of evaluating securities by analyzing statistics generated by market activity, such as past prices and volume (Technical analysis 2015). (Bohm and Wenzelburger 2005) present an evaluation of the shares portfolio optimisation strategy by three agents: rational agent, interference agent and technical analysis agent. Among numerous other studies on the application of multiagent systems, the overview of active and passive forms of learning of the agents operating on financial markets by B. LeBaron is also worth mentioning (LeBaron 2011 ).

There are several multiagent platforms. For example, JADE is maintained in two versions as an open-source platform (JADE 2013) and independently as a commercial platform—JADE 7 (JADE 2013). The commercial variety of JADE is positioned as a base framework, which supplies the basic mechanisms for business applications. It is characterised by a greater speed and scalability than the free product. Unfortunately, the professional JADE version is free of charge only for noncommercial use and its license does not permit modification of the source code. A platform serving as the basis for constructing a multiagent open system for the analysis of financial time series needs to be fast, light and simple to use. Security and possibility to modify/improve the engine are also important. Speed is not only related to a messaging protocol but it is also related to triggering immediate responses from agents, because agents should quickly process requested information. The lightness of the platform has low resource consumption related to receiving and sending information by agents. Unfortunately, JADE does not satisfy the necessary conditions to serve as the basis for the open multiagent system for analyzing financial time series despite the fact that they supply multiple tools and capabilities which would undoubtedly be extremely useful (Korczak et al. 2012).

Moreover, these systems do not include a Supervisor Agent, which evaluates the knowledge of processing agents to improve determination of decisions bringing users satisfactory benefits (rate of return) and decreasing the level of investment risk. A system satisfying the necessary conditions and comprising a Supervisor Agent is A-Trader, presented in (Korczak et al. 2012, 2013), but this system allows supporting decisions only on FOREX market and does not generate the portfolio of shares.

One Supervisor Agent strategy uses the consensus method. In studies by (Nguyen 2006; Sobieska-Karpińska and Hernes 2011; Hernes and Nguyen 2007) it is concluded that the consensus method can be employed to resolve conflicts of knowledge. Many authors carried out works on the consensus method. Initially, the consensus method referred to simple structures, such as linear order or partial order (Arrow 1963). Later, scholars began to deal with more complex structures, such as divisions, hierarchies, and n-trees (Daniłowicz and Nguyen 1988; Barthlemy 1992). Afterwards, the consensus method was developed for multi-valued and multi-attribute structures (Hernes and Nguyen 2004; Nguyen 2006) which accounted only for opinions of parties to the conflict, while disregarding the certainty level of such opinions. However, for the decision structure to fully correspond to the actual needs of decision-makers, it needs to include—apart from opinions—certainty levels of such opinions because economic decisions are most often made under conditions of risk or uncertainty. Definitions of such structures (Sobieska-Karpińska and Hernes 2010) and consensus algorithms with reference to the decisions structure accounting for certainty levels of agents’ opinions (Sobieska-Karpińska and Hernes 2012) are currently being developed in studies concerning the consensus method. Research was also performed to determine consensus where functional relationships occur between attributes of an agent’s knowledge structure (Zgrzywa 2007 ).

The consensus algorithm is implemented as a Supervisor Agent strategy in MFDSS which is presented in the next part of this paper.

3 Multiagent financial decision support system

The purpose of the MFDSS prototype is to support stock market investments by suggesting decisions to investors concerning the construction of a securities portfolio. The design of this prototype includes the following features (Sobieska-Karpińska and Hernes 2011):

  • Multiagent—the system consists of several agents,

  • Openness—the system can be extended without interfering with the existing resources,

  • Scalability—the ability to extend the system with any number of agents,

  • The use of cloud computing technology—it profitably affects the performance of system,

  • Hardware independence—in order to run the agents use desktops, laptops, and mobile devices,

  • Software independence—the agents’ algorithms can be implemented in any programming language (e.g., C++, Java, PHP),

  • Never-ending learning—the agent has the ability to fill in its knowledge-base at any time.

The MFDSS consists of following elements (Fig. 1):

Fig. 1
figure 1

Functional architecture of MFDSS

  1. 1.

    Processing agents—Buy/sell decision agents, intelligent programs, which, on the basis of data received from financial servers, take definite decision whether to buy or sell. Each agent has been implemented with a different method of computation and decision-making. Buy/sell decision agents send the decisions to a database (Microsoft SQL Server database).

  2. 2.

    The Supervisor Agent—the main component of the system, functions on the basis of the strategies, such as the consensus method, which allows it to make final decisions on the basis of separate decisions generated by individual agents (read from database), which are to be presented to the users. Consequently, it is possible to generate a satisfying rate of return decision and reduce the level of risk associated with investing in a financial instrument.

  3. 3.

    Users—mostly persons who invest in financial markets, or bots (automatic investors).

The level of satisfaction which should guarantee the use of the method of consensus as a Supervisor Agent strategy, is determined by the user (decision-maker) and can be implemented in the form of the system’s parameters. Each agent functioning in the system, as previously noted, can be created by using any programming language. A prerequisite for the inclusion of an agent in the system, however, is entry of the decision, generated by the agent, into the database in the form of a single structure.

Notice that each financial decision must be represented by using a concrete structure (the first stage of consensus determination). Such structure was defined in previous work (Sobieska-Karpińska and Hernes 2011). In our system, the financial decision consists of financial instruments, such as shares. The formal definition of this structure is the following:

Definition 1

Decision P about finite set of financial instruments E = {e 1, e 2,…, e N } is defined as a set:

$$P = \left\langle {\{ EW^{ + } \} ,\{ EW^{ \pm } \} ,\{ EW^{ - } \} ,Z,SP,DT} \right\rangle$$

where:

  1. 1.

    EW + = 〈e o , pe o 〉, 〈e q , pe q 〉,…,〈e p , pe p 〉.

    Couple 〈e x , pe x 〉, where: e x E and pe x ∊ [0,1] denote a financial instrument and this instrument’s participation in set EW +.

    Financial instrument e x  ∊ 〈e x , pe x 〉 is denoted by e + x when 〈e x , pe x 〉 ∊ EW +.

    The set EW + is called a positive set; in other words, it is a set of financial instruments that an agent should buy based on its knowledge or information.

  2. 2.

    EW ± = 〈e r , pe r 〉, 〈e s , pe s 〉,…,〈e t , pe t 〉.

    Couple 〈e x , pe x 〉, where: e x  ∊ E and pe x  ∊ [0,1] denote a financial instrument and this instrument’s participation in set EW ±.

    Financial instrument e x  ∊ 〈e x , pe x 〉 is denoted by e ± x when 〈e x , pe x 〉 ∊ EW ±.

    The set EW ± is called a neutral set; in other words, it is a set of financial instruments, with respect to which an agent has no knowledge or information whether to buy or sell them. If these instruments are held by an investor, they should not be sold, or if they are not in the possession of the investor, they should not be bought.

  3. 3.

    EW  = 〈e u , pe u 〉, 〈e v , pe v 〉,…,〈e w , pe w 〉.

    Couple 〈e x , pe x 〉, where: e x  ∊ E and pe x  ∊ [0,1] denote a financial instrument and this instrument’s participation in set EW .

    Financial instrument e x  ∊ 〈e x pe x 〉 is denoted by e x when 〈e x , pe x 〉 ∊ EW .

    The set EW is called a negative set; in other words, it is a set of financial instruments that an agent should sell based on its knowledge or information that they should be sell.

  4. 4.

    Z ∊ [0,1]—decision rate of return forecast.

  5. 5.

    SP ∊ [0,1]—degree of certainty of rate Z. It can be calculated on the basis of the level of risk related to the decision.

  6. 6.

    DT—date of decision.

The percent of a financial instrument’s participation in the positive, neutral or negative sets ranges from 0 to 1. However, the total percentage of all the financial instruments’ participation in a given set may be greater than 1 because it is possible that each financial instrument belongs to the set in 100 %. The following example presents this situation.

Example 1

Let set E = {a 1, a 2, a 3, a 4, a 5, a 6, a 7} be a set of shares.

Examples of structure of decision (stock portfolio):

$$\begin{aligned} D1 & = \left\langle {\left\{ {\left\langle {a_{1} ,0.2} \right\rangle ,\left\langle {a_{3} ,0.5} \right\rangle ,\left\langle {a_{5} ,0.3} \right\rangle } \right\},\left\{ {\left\langle {a_{2} ,1} \right\rangle } \right\},\left\{ {\left\langle {a_{4} ,1} \right\rangle ,\left\langle {a_{6} ,1} \right\rangle ,\left\langle {a_{7} ,1} \right\rangle } \right\},0.3,0.7,\;22{ - }09{ - }2013} \right\rangle \\ D2 & = \left\langle {\left\{ {\left\langle {a_{2} ,0.2} \right\rangle ,\left\langle {a_{3} ,0.8} \right\rangle } \right\},\emptyset ,\left\{ {\left\langle {a_{1} ,1} \right\rangle ,\left\langle {a_{4} ,1} \right\rangle ,\left\langle {a_{5} ,1} \right\rangle ,\left\langle {a_{6} ,1} \right\rangle ,\left\langle {a_{7} ,1} \right\rangle } \right\},0.6,0.3,\;14{ - }05{ - }2013} \right\rangle \\ \end{aligned}$$

In the first example, sets EW +, EW ±, EW  ≠ ∅. In the second example set EW ± = ∅. Note that in the sets EW ± and EW each instrument’s participation equals 1. The situation is explained as follows: if certain shares are to be bought, it should be determined what percentage of the amount allocated to the purchase of all shares is defined by individual shares. If the shares are not being sold or bought, then determining the place of these shares in the neutral set does not make sense, because all equally (fully) belong to this set (hence each share is marked 1—i.e., full participation). In the case of a negative set, the situation is the same as in the neutral set (although in the case of deciding that all the shares of a certain company should not be sold, the role of the shares should be mentioned in the negative set).

The aforementioned definition of a decision allows the formulation of conclusions drawn by the system’s agents as a single structure. It may happen that an agent will not “know” whether the decision element should be used or not (for example, it has too little information on the action). In that case, the EW ± set is necessary. The presented structure is complex, multi-valued, and populated by various types of data.

A situation often occurs in which the structures of a decision in the system differ, or the values of their attributes are different. This situation results in agents taking various, often contradictory decisions concerning buying and selling a financial instrument.

4 Supervisor Agent strategy: consensus method

The consensus method is used to resolve conflicts of various structures of data in different types of systems; for instance, experts’ knowledge conflicts, conflict in temporal databases, and conflicts in multiagent systems (Hernes and Nguyen 2004). The consensus method may also be used in financial decision support systems.

Determining consensus consists of three major stages (Fig. 2).

Fig. 2
figure 2

The stages of consensus determination

In the first stage it is necessary to carefully examine the structure of the set of all the variants generated by the MFDSS system, or to specify characteristics that represent these variants and the domain of values (this aspect was presented in the previous part of this paper). In the second stage it is necessary to define the distance functions among particular variants and to define a set of variants (a profile), on the basis of which consensus will be determined. The third stage is an elaboration of consensus determining algorithms—the determining of such a variant, and that the distance, between this variant (consensus) and the individual variants generated by MFDSS is minimal (according to different criteria). So, the consensus is not the average.

The consensus method was implemented as one of the main strategies of the Supervisor Agent in MFDSS. The consensus algorithm runs automatically after obtaining the decision advice from individual agents.

Consensus is determined on the basis of decisions generated by different agents working in a system. We call a set of such decisions a profile and define it as follows (Hernes and Nguyen 2007):

Definition 2

A set of financial instruments E = {e 1, e 2,…,e N } is given.

A profile A = {A (1), A (2),…, A (M)} is called a set of M decisions of finite set E (set of financial instruments), such that:

$$\begin{aligned} & A^{(1)} = \left\langle {\{ EW^{ + } \}^{(1)} ,\{ EW^{ \pm } \}^{(1)} ,\{ EW^{ - } \}^{(1)} , Z^{(1)} , SP^{(1)} , DT^{(1)} } \right\rangle , \\ & A^{(2)} = \left\langle {\{ EW^{ + } \}^{(2)} ,\{ EW^{ \pm } \}^{(2)} ,\{ EW^{ - } \}^{(2)} , Z^{(2)} , SP^{(2)} , DT^{(2)} } \right\rangle , \\ & \ldots \ldots \ldots \\ & A^{(M)} = \left\langle {\{ EW^{ + } \}^{(M)} ,\{ EW^{ \pm } \}^{(M)} ,\{ EW^{ - } \}^{(M)} , Z^{(M)} , SP^{(M)} , DT^{(M)} } \right\rangle . \\ \end{aligned}$$

The algorithm for determining consensus (for the profile consisting of financial decisions) is based on the theorem elaborated in (Sobieska-Karpińska and Hernes 2011).

The algorithm for determining consensus works this way: for each financial instrument in set E, it is checked how many times this instrument appeared in set EW +, EW ± and EW . If the instrument appeared in one of the sets more times than half of the number of all agents, it belongs to this set in the consensus. If it appeared in the given set as often as half of the number of all agents or less often than half of the number of all agents, it does not belong to the consensus.

If a given financial instrument belongs to a given set in the consensus, we move to another instrument of set E. Next, we determine an ascending order of values Z, SP, DT for the whole profile and estimate where, between the values in this order, the value that represents consensus occurs. The algorithm is done when all the financial instruments have been checked and the consensus for a DT value has been found.

Data:

The profile A = {A (1), A (2),…, A (M)} consists of M agents’ decisions.

Result:

Consensus CON = 〈CON +, CON ±, CON , CON Z , CON SP , CON DT 〉 according to A. The consensus is a decision generated by the Supervisor Agent. This decision consists of the same attributes as the decision of the agents (e.g., CON + mean consensus of the EW+ set), but the values of these attributes differ.

figure a

The computational complexity of this algorithm is O(3NM).

The presented algorithm of consensus determination coordinates a decision presented by the MFDSS system to the investor. The following is a simplified example of determining consensus:

Let there be a set of shares E = {a 1, a 2, a 3, a 4, a 5, a 6, a 7}.

The profile consisting of three shares portfolio (generated by three different agents) is the following:

$$\begin{aligned} A^{(1)} & = \left\langle {\left\{ {\left\langle {a_{1} ,0.2} \right\rangle ,\left\langle {a_{3} ,0.5} \right\rangle ,\left\langle {a_{5} ,0.3} \right\rangle } \right\},\left\{ {\left\langle {a_{2} ,1} \right\rangle } \right\},\left\{ {\left\langle {a_{4} ,1} \right\rangle ,\left\langle {a_{6} ,1} \right\rangle ,\left\langle {a_{7} ,1} \right\rangle } \right\},0.3,0.7,\;22{ - }09{ - }2010} \right\rangle \\ A^{(2)} & = \left\langle {\left\{ {\left\langle {a_{2} ,0.1} \right\rangle ,\left\langle {a_{3} ,0.7} \right\rangle ,\left\langle {a_{7} ,0.2} \right\rangle } \right\},\left\{ {\left\langle {a_{1} ,1} \right\rangle ,\left\langle {a_{4} ,1} \right\rangle } \right\},\left\{ {\left\langle {a_{5} ,1} \right\rangle ,\left\langle {a_{6} ,1} \right\rangle } \right\},0.2,0.9,\;22{ - }09{ - }2010} \right\rangle \\ A^{(3)} & = \left\langle {\left\{ {\left\langle {a_{5} ,1} \right\rangle } \right\},\left\{ {\left\langle {a_{2} ,1} \right\rangle ,\left\langle {a_{3} ,1} \right\rangle ,\left\langle {a_{4} ,1} \right\rangle ,\left\langle {a_{6} ,1} \right\rangle } \right\},\left\{ {\left\langle {a_{1} ,1} \right\rangle ,\left\langle {a_{7} ,1} \right\rangle } \right\},0.1,0.4,\;22{ - }09{ - }2010} \right\rangle \\ \end{aligned}$$

The consensus of this profile (determined by the Supervisor Agent) is as follows:

$$CON = \left\langle {\left\{ {\langle a_{3} , 0.5\rangle , \langle a_{5} , 0.5\rangle } \right\}, \left\{ {\langle a_{2} , 1\rangle , \langle a_{4} , 1\rangle } \right\},\left\{ {\langle a_{6} , 1\rangle , \langle a_{7} , 1\rangle } \right\}, 0.3, 0.7,\; 22{ - }09{ - }2010} \right\rangle .$$

Figure 3 presents the graphical user interface of the MFDSS Supervisor Agent. The decisions can be generated in real time or on the basis of historical data (it is necessary to select the date of the session and click the “Read data” button).

Fig. 3
figure 3

Supervisor Agent GUI

An agent reads decisions generated by individual agents and displays them on the screen. The window presents the contents of the positive set (“Buy”), a neutral set (“no Buy, no Sell”), and a negative set (“Sell”). In order for the contents of these files to fit on the screen, the securities (shares) of the individual companies are identified by symbols from a1 to a10. It also displays the rate of return (“R”) and the degree of certainty (“Sp”). Then, by pressing certain buttons (“Calculate”), consensus can be calculated, using an optimal algorithm which involves determining the consensus by checking all the possible solutions and the consensus based on the heuristic algorithm presented in this paper. The consensus based on the optimal algorithm is calculated only for the purpose of verification of strategies; these calculations are not conducted in practice. After the above-mentioned calculations, the distance from a consensus profile designated by the two algorithms is presented. Subsequently, there can be designated a consensus for a session from another day, and the action can be repeated.

The next part of the paper presents the verification of the use of the consensus method as the Supervisor Agent strategy in the MFDSS system.

5 Experimental results

Consensus method results were reviewed in the MFDSS regarding investments on the Warsaw Stock Exchange. In this case it is possible to compare the results obtained by means of the consensus method with results from other methods of building the portfolio. It should be noted that if a review is performed on historical stock prices, then—knowing their current prices—it is easy to determine their rate of return which would be achieved by applying both the developed model and other portfolio construction methods.

The aim of the conducted test was, among others, to check what average rate of return at what risk can be achieved in the examined period with the use of consensus method in comparison to other technical analysis methods, the buy-and-hold and random walk methods. Back-testing, which consists in checking a model on historical (past) data, was employed as the test method.

To perform a test, use the following assumptions:

  1. 1.

    Every day, an investor makes decisions to buy shares, sell shares, or make no changes.

  2. 2.

    The test was performed on the basis of ten companies’ shares: AMICA, BOS, BZWBK, COGNOR, LOTOS, NETIA, PEKAO, PKOBP, PUŁAWY, SYGNITY. These stocks were chosen because they are known on the Polish market to have large equity and they characterize different rates of return in the considered periods. The number of companies, as well as the number of agents, has been limited by calculation capability or efficiency. In real solutions, the number of companies is limited because an agent’s structure of knowledge is multi-attribute and multi-value.

  3. 3.

    Historical data were used, from the following three periods:

    • 11.04.2007–27.08.2007,

    • 01.08.2010–31.12.2010,

    • 01.07.2012–30.11.2012.

These periods were selected in such a way as to take account of the economic boom and bust time at the Warsaw Stock Exchange. For example, Fig. 4 presents quotations of AMICA in period 1.

Fig. 4
figure 4

Quotation of AMICA

Table 1 presents the rates of return of each stock in the particular periods using Buy and Hold method (buy at the beginning of the period, and sell at the end of the period). The quotation details are available on: http://bossa.pl/pub/metastock/mstock/metaall.zip.

Table 1 Rates of return
  1. 4.

    It is assumed that the percentage of each share in the positive set is the same, for example, if in the positive set there are two shares the contribution of each of them is 50 %. This assumption has an impact on the value of the stock portfolio; however, when it applies to all agents, it does not significantly affect the results, expressed as a percentage. Besides, this may occur in practice even for reasons of the limited amount of resources available for the purchase of shares.

  2. 5.

    The rate of return is calculated on the basis of changes in the value caused by the portfolio, allowing you to skip the initial value of the investment (according to the earlier-made assumption that percentage share of each security in the positive set is equal, it has been assumed that an investor buys/sells one share). which assumed. The rate of return of investment period is assumed as the level of usefulness of the decision.

  3. 6.

    As a measure of risk we used the average coefficient of variation. Because it is a relative measure, it allows you to measure risk in percentage. Average coefficient of variation is defined as the quotient of the average deviation and arithmetic average:

    \(V = \frac{s}{{\left| {E(r)} \right|}} \times 100\%\)

    where:

    V—average coefficient of variation,

    S—average deviation of the rates of return,

    E(r)—arithmetic average of the rates of return.

  4. 7.

    Difference 100 % minus average coefficient of variation is assumed as the degree of certainty of the decision.

  5. 8.

    The test assumes that the transaction costs are defined as the number of operations of buying and selling shares in a given period.

  6. 9.

    It is assumed that buy-sell transaction shall be made on the basis of the prices at the closing of a session.

  7. 10.

    The verification process makes use of data generated by agents which suggest investors’ decisions are based on technical analysis indexes (nine agents). The first agent implements indicator Moving Average Convergence Divergence (MACD), which is calculated using similarity and difference of moving averages. Agent no. 2 implements indicator relative strength index (RSI), which determines internal strength of securities. The value of RSI is from 0 to 100.The third agent implements indicator Rate of Change (ROC), the percent of changing the course of the current session in relation to the course before the kth session. The fourth agent implements indicator commodity channel index (CCI). This indicator does not determine the length of the cycles, but determines when these cycles begin and end. Agent no. 5 implements indicator on balance volume (OBV), which confirms or warns of trend change. Three successive agents implement moving averages (agent no. 6—short-period averages, agent no. 7—middle-period averages, and agent no. 8—long-period averages). The ninth agent implements price formation.

Data from each day of the first period were generated. Results of the analysis of each agent were saved. Next for these data consensus was determined. Table 2 presents rates of return achieved in particular periods.

Table 2 Rates of return in particular periods [%]

Throughout the analyzed periods, both profits and losses have been achieved by particular agents. In the first period only agent no 2 generated profit, the other agents (also Supervisor Agent) generated losses. All the agents generated profit in the second period. In the third period both profits and losses have been generated. Taking into account all the periods the particular agents’ rates of return are characterized by a high dispersion. For example Agent no 1 generated a high loss (−23.15 %) in the first period, a high profit (60.30 %) in the second period and a high loss (−36.35 %) in the third period. It was noted that despite the fact that both profits and losses occurred on particular days and in particular periods, taking into consideration all the periods (average rate of return) only one agent (agent no. 4, which was functioning on the basis of CCI) generated such decisions, which, taking into account the return on investment period, resulted in a loss. The greatest average rate of return 13.35 % was generated by agent 2 (implements RSI). The result obtained using the consensus method (10.23 %) is the third-largest rate of return over the investment period. Therefore, two agents generated better results from the results generated by applying the consensus method, while seven agents generated worse results (Fig. 5). Therefore, it can be said that 22.2 % of the portfolio construction method allows you to get better results from the results obtained from the use of consensus method, while 77.8 % of portfolio construction method allows you to get worse results. Compared with the method of Buy and Hold and Random Walk, both consensus method, as well as the most used methods, allowed to achieve a higher rate of return on investment. The use of consensus method also allows you to get a higher rate of return than the average rate of return of all agents, which during all the periods stood at 6.42 %.

Fig. 5
figure 5

The rate of return over the investment period

Analysis of decision risk (Fig. 6) indicates that the use of the consensus method allows you to invest with the lowest level of risk (average coefficient of variation was 8.62 %) among the analyzed portfolio construction methods (for other construction methods stock portfolio during the period considered the average value of the coefficient of variation was in the range of 8.68–37.81 %). The average level of risk for all portfolio construction methods used amounted to 14.83 %. Note that if an investor had to choose an agent to “listen to”, then, assuming that the probability of selection of the agents by a investor is the same, he could more often choose a decision (hint) of an agent that allows one to get a lower rate of return. Besides, the evaluated agents using simple indicators are characterized by a large variability and disparity in rates of return, confirming the value of the average coefficient of variation of the Supervisor Agent. Due to the turbulent economic environment, investing in financial instruments must be carried out in close to real time. First and foremost, however, the use of consensus algorithms allows investors to decrease the level of risk related to financial instrument investing. Therefore, it also increases the level of usefulness of the decisions, and this can bring users satisfying benefits.

Fig. 6
figure 6

Average of risk

Verification results also show that using the consensus method results in lower transaction costs than in case of other methods (except for Buy and Hold). The consensus method review performed in this experiment demonstrates that decisions suggested by the MFDSS are decisions which, from a time perspective, permit the achievement of results that are satisfying to the investor while at the same time minimizing the risk involved in investing, although it does not bring the highest rate of return on any given day. It needs to be noted that if investors were to independently choose whose agent’s advice to follow, then with the assumption that the probability of selecting a given agent is the same, they could more often choose a decision (suggestions) of an agent which results in a lower rate.

It was also observed that some agents achieve a better result on a particular day and in a particular period than the one achieved after employing consensus method but their operation is characterized by a considerable discrepancy in rates of return. On certain days the rate of return is high, and on others it is low or negative. In the results obtained with the use of consensus method the discrepancy in rates of return is significantly smaller (a low average coefficient of variation), they are more stable and, what follows, higher in the long run. It was additionally noticed that if investors were to independently choose from among the decisions made by agents, the time needed for analyzing these decisions would be longer than the time of determining the consensus automatically by the system. What also deserves emphasizing is that although for the portfolios generated by both the consensus method and by individual agents the percentage of negative rate of return from particular days is often higher than the percentage of positive rate of return from particular days, most portfolio construction methods permitted the achievement of a positive average rate of return on investment from the tested investment periods.

To sum up, it can be stated that decisions generated by the consensus algorithm permit a higher average rate of return at a lower risk in some investment periods in comparison to employing every portfolio construction method separately and a greater promptness in generating decisions than in the case where the decision-maker independently selects from among the decisions generated by individual methods. Also, the consensus determining agent generated higher rates of return than Buy and Hold or Random Walk benchmarks. Hence, the level of usefulness of a decision increases and owing to that, it can bring satisfying benefits (rate of return).

6 Conclusions

In conclusion, the decision-making process is very complex, especially when operating in conditions of risk and uncertainty. A decision-maker cannot be sure of the effects of his or her decisions. Decisions taken with the help of multiagent systems help to reduce the workload and make the process less time-consuming, but they do not eliminate the problem of choosing one variant of the financial decision, not to mention the levels of satisfaction and risks.

The authors are aware that the consensus method does not guarantee that a given decision will be optimal, but it does guarantee a certain level of satisfaction. Of course, when not using the consensus method, a situation could occur where one of the decisions generated by an agent is better than decisions made by the consensus algorithm, but there is no certainty that the decision-maker will choose the best option, not to mention the risk accompanying the choice. The verification conducted in this paper revealed that the use of the consensus method allows to take into consideration the levels of satisfaction and risk. The utilization of the consensus method made it possible to obtain a higher return on investment than the average return achieved by other agents. The average coefficient of variation, on the other hand, reached the lowest level (which is the lowest level of risk) in the case of the Supervisor Agent which uses consensus method.

The consensus method allows for skipping the analysis of the decisions of individual agents by an individual shareholder, therefore the final decision can be taken quickly (close to real time). It enables, among other things, to invest in shorter quotation periods, for example not day to day quotation but hour to hour quotation.

The verification process was based on historical data from different time periods (in which there were both periods of boom and bust), and in each of those periods similar results were achieved, therefore it is expected that similar findings will apply to current data.

The authors also recognize the need to integrate agents into the system, where they will be able, for example, to analyze the global and local economic, social and political situation, as well as opinions of experts and analysts, placed on websites or online forums. This will help to make decisions not only based on historical prices of securities (technical analysis), but also, for instance, on the basis of government information on the activities in the field of economic policy, reports on the economic situation of a particular company, or even with regard to moods and emotions of investors (fundamental analysis). It is not uncommon for the technical analysis indicators, such as those used by agents operating in MFDSS, to forecast rising prices of securities (e.g., shares), whereas the statements of politicians and experts on the economic situation may cause “panic” among investors and, consequently, a decrease in the prices of securities. Therefore, steps have been taken to incorporate the agents operating on the basis of fundamental and behavioral analysis into MFDSS. There are also plans to develop cognitive agents that have the ability to enable learning through empirical experience gained through direct interaction with the environment, which will enable decision-making based on unstructured or incomplete knowledge. The inclusion of cognitive agents into MFDSS and the utilization of the method of technical and fundamental analysis are therefore necessary due to the possibility of increasing the level of user satisfaction with the decisions suggested by the system.

The issues presented in this paper raise additional possibilities related to, among other things, extension of the functions of agents’ knowledge consistency measurement and agents’ decision evaluation function (which take into consideration also criteria such as the number of profitable consecutive transactions, gross profit and other risk measures; e.g., Sharpe ratio). Practical implications can also be related to integrating the MFDSS with existing trading platforms and including the consensus strategy into financial decision support systems functioning in the real world.