• No results found

A Multi-Agent Framework for Stock Trading

N/A
N/A
Protected

Academic year: 2021

Share "A Multi-Agent Framework for Stock Trading"

Copied!
28
0
0

Loading.... (view fulltext now)

Full text

(1)

A Multi-Agent Framework for Stock Trading

Shahram Rahimi, Raju Tatikunta, Raheel Ahmad, Bidyut Gupta Department of Computer Science,

Southern Illinois University Carbondale, IL – 62901

[rahimi, rtati, rahmad, bidyut]@cs.siu.edu

Abstract: TrAgent is a secure multi-agent environment which models a stock exchange such as the New York Stock Exchange and the procedure of trading securities on the trading floor. The model comprises the complete process from the initiation of a trading order until its execution and also deals with the security issues involved. The multi-agent paradigm is the framework for implementation of the system. The properties of intelligent software agents meet the characteristics of the actors on the trading floor and provide capabilities for efficient distributed computing. These characteristics include dynamic and flexible adoption to a changing scene, asynchronous and autonomous behavior, and efficient use of resources in a distributed environment. The main focus in this paper is on one of the important agents in TrAgent, the stock broker agent. Intelligence is provided to the stock broker agent in order to make decisions and give reasons on the profitability of a firm. This intelligence is formed using Fuzzy Expert System. The paper further discusses the implementation issues concerning different components of the model and their security framework.

Keywords: Multi-agent systems, stock-exchange modeling, fuzzy expert systems

1

Introduction

Software agent technology is an exciting paradigm which can be efficiently applied to many distributed and grid computing problems, particularly those that require dynamic behavior to reach a solution. Software agent technology has emerged as an enhancement of, if not an alternative to, traditional client/server model. Mobile agents can migrate to the desired remote peer and take advantage of local processing rather than relying on remote procedure calls (RPC) across the network, as in the case of client/server systems. It could therefore reduce the communication latency and bandwidth consumption in many applications particularly when the size of the data, required for computation, is large (Suri and Bradshaw (2000)).

Furthermore, agents are entities that function continuously and autonomously in a particular environment and are able to carry out activities in a flexible and intelligent manner that is responsive to the dynamically changing environment. One such environment is the stock exchange presented in

Lorie (1997)

. Trading of stocks and bonds takes place almost every second following certain rules and regulations. As a result of this trading, large amount of diverse trade information is continuously exchanged between many different actors involved in the trade such as brokers, specialists and clerks. There are stock exchanges in all important financial centers of the world. The model presented in this paper is based on the procedures carried out in the New York Stock Exchange (NYSE).

(2)

The stock exchange model is efficiently replicated using multi-agent technology. The agents are designed to represent the actors involved in the stock exchange and perform tasks on their behalf. These agents are capable of interacting with each other and with the external environment. They are also intelligent enough to make decisions based upon ever changing situations. TrAgent is a secure multi agent architecture encompassing stock exchange in which components, their specifics, the interactions between components, and their intelligence are defined and implemented.

While many multi-agent architectures for e-business have been proposed, only a small number directly deal with the complete stock exchange process and its comprehensive acts. Most of the current researches in this area focus on the development of a small group of agents to deal with a particular aspect of the market. Here are some of the more referenced works in this area: Garcia et al. (2000) describes a multi-agent system where agents monitor the stock market, extract information, and achieve established goals. The agents have different roles, e.g., trading and gathering information, and cooperate asynchronously to achieve their goals. Mikler and Mayes (1999) propose a distributed approach, using data mining concepts, to extract stock values from the Internet. Ying (1995) presents the initial steps for generating intelligent agents that can reason about supply and demand for goods and services and negotiate to reach satisfactory deals. Parkes and Huberman (2001) introduce a multi-agent architecture where individual agents receive an initial wealth, and follow an investment strategy to adjust their portfolio as they observe movements of the market over time. Ruddle (1999) presents a comprehensive model on the relation between the investor and broker and suggests mobile agents as the most appropriate technology for implementing the model. He especially comments on the importance of information gathering: “Information has no value unless it can be found and have corroboration and context. The process should, therefore, minimize the effort required by the user to find and present the correct information in appropriate formats.” Ruddle mainly focuses on the relationships between the investor (customer), the broker (service provider) and the sources of information. Zopounidis (1996) presents an application of FINEVA which is a multi-criteria knowledge-based decision support system in the assessment of corporate failure risk. The FINEVA system combines an expert system, a multivariate statistical method (principal component analysis), and the multi-criteria method UTA (Utilities Additives), to provide interactively, estimations concerning the performance and the viability of firms. The above works present only partial solutions for stock exchange markets, while this paper puts forward a multi-agent system that is capable of providing a base for a comprehensive Artificial Stock Market (ASM). Based on the authors’ knowledge, currently, there exists no multi-agent based system that entirely and expansively model stock exchange process from the initiation to completion of a request.

(3)

The rest of the paper is organized as follows: section 2 briefly discusses TrAgent architecture and the agents involved in the model, while section 3 discusses the implementation of TrAgent architecture including the intelligent components involved. Section 4 provides the detailed communication acts between the agents. Section 5 presents a secure multi-agent framework for the TrAgent model, and finally section 6 concludes the paper.

2

An Overview of the Multi-Agent Environment

TrAgent is a distributed architecture encompassing the stock exchange. The components involved in the model are characterized by their attributes, functionality, interactions, and responsibilities. In this section, the components of TrAgent are briefly introduced (for more details please refer to Bjursell et al (2002)). The implementation details and the communication protocols are discussed in sections 3 and 4.

Figure 1 provides an overview of the trading floor and its components. A simple trading scenario is utilized to better discuss the functionality and relationship of the major elements in the model. In this simple scenario a complete transaction takes place from which some details are left out intentionally for simplification. The sequence of the acts taking place in this trading scenario is as follow:

1. The investor places an order with a broker.

2. The broker sends the order to the firm’s clerk on the floor of the exchange. 3. The clerk gives the order to the firm’s floor broker.

4. The floor broker goes to the specialist’s post where the stock is traded and begins negotiating with the trading crowd.

5. The broker agrees on a price. 6. The order is executed.

7. The floor broker reports the trade to the clerk. 8. The clerk confirms the order with the broker. 9. The broker confirms the trade with the investor.

(4)

Figure 1. Trading floor and its components

2.1

Investor Agent

The investor is not a part of the actual exchange. However, the investor agent is critical as the representative of a real investor and the initiator of any transaction. The investor agent is provided with a list of firms, it is interested in, by the stock broker agents, ranked according to the profitability. Upon deciding on the firm the investor agent requests the stock broker agent to initiate the trade on its behalf. The investor agent can also have access to external information such as stock information and the latest quotes. When an order has been executed, the broker agent reports the result to the investor agent. Hence, the investor agent has to furnish methods interfacing with the brokers.

2.2

Stock Broker and Discount Broker Agents

A broker is a mobile agent that acts as an intermediary between the buyers and sellers in trading securities, commodities, and other stocks. There are two types of broker agents: a stock broker and a discount broker. The stock broker agent manages the transactions for the investor agent as well as provides analytical functions. On the other hand, the discount broker agent only acts as middle man to the trading floor. These broker agents ensure that investor agent orders are executed, and they relay orders to the floor broker agent that execute the orders.

An investor agent may require two services from the stockbroker: order a transaction or an analysis. In the latter case, the stockbroker agent performs the market evaluation and analysis. It then returns the results and goes back to being idle. In the former case, the stockbroker agent validates the order. Thereafter, a booth on the trading floor is contacted in order to access a floor broker agent. After the order is delegated to the floor broker

Trading Floor BrokerageFirm Stock Discount Brokers Brokers Investor Investor Investor TradingPost Specialists Booth FloorBrokers Stock Informatio BrokerageFirm Stock Discount Brokers Brokers

F

F

F

Booth FloorBrokers

F

F

Booth FloorBrokers

F

F

Booth FloorBrokers

F

F

F

F F S S

(5)

agent, the stock broker agent returns to its idle state. When a transaction has been executed, the stock broker agent receives the execution report, analyzes the result, and informs the investor.

In our current system, the stock broker does not predict any thing related to the future values of the firms, rather it assists the investor agent by providing it with an ordered list of firms in which the investor agent is interested. The firms in this list are ranked based on some profitability factors (described later). It is up to the investor to decide whether it is willing to sell or invest on a firm looking at the profitability ratios. The process of analyzing the profitability of a firm is a crucial task for the stock broker agent. This is the task for which the stock broker agent uses its intelligence, to decide whether the profitability of the firm is low, medium, high or very high based upon the profitability ratios.

The intelligent component of the stock broker agent is developed using fuzzy expert system. Every firm publishes its profitability ratios periodically. The stock broker agent collects these profitability ratios from each of the firms and feeds them as the input to its fuzzy expert system. The expert system then fires some rules based on the input and the corresponding output is obtained. After defuzzification, the output is used to produce decisions regarding the profitability of the firms. The details of the implementation of the fuzzy expert system will be discussed in section 3.

2.3

Floor Broker Agent

The workspaces around the perimeter of the trading floor where member firms and independent floor brokers receive orders are referred to as booths. Each booth includes one or more floor brokers. In TrAgent, the floor broker agent mainly acts as a reactive component, i.e. a certain input leads to specific actions.

Floor broker agents receive orders from stock broker agents. Upon receiving a buy order, the floor broker agent locates the trading post and executes the trade. The component must provide functionality for a stock broker agent to place orders, and also for other floor broker agents and specialist agents to negotiate trade. After a transaction is completed, the floor broker agent returns to the booth and reports the result of the trade and turns idle. A floor broker agent will stay idle until an order is received. Since a floor broker agent is at the booth and stocks are traded at trading posts, the floor broker agent has to find and move to the correct trading posts when receiving an order. After arriving at the post, a specialist agent is contacted. The floor broker agent then places the bid with the specialist agent and anticipates a response. If the bid is accepted, the floor broker agent prepares to move back to the booth and report the trade information to the stock broker agent. However, if that is not the case, the floor broker agent may place a new bid or wait for a better offer to come. The floor broker cannot leave the post unless the order is executed.

(6)

2.4

Specialist Agent

A specialist agent has numerous roles and responsibilities hence the class becomes large and complex to be described in details. Therefore, the functionality of simply trading one-on-one with a floor broker agent is outlined here: In order to trade, the specialist agent provides methods for negotiating prices with the floor broker agent. Functions for requesting trade information (e.g., price and quantity) are furnished as well. The specialist agent remains idle until a floor broker agent actually places a bid. If the specialist agent accepts the offer, it prepares the trade and reports the result to the floor broker agent. If the bid is rejected, the specialist agent waits for a new bid from the floor broker agent or records the order and attempts to match it with new incoming orders. The specialist agent also interacts with the floor official, as well as the trading information systems (e.g., SuperDot) to store and receive necessary information.

3

Design and Implementation of TrAgent

This section describes the design and implementation details of TrAgent, while the communication protocols are described in section 4. The TrAgent model is implemented in JADE (Java Agent Development Environment). The implementation of the model includes two major elements:

1) The design and implementation of the software agents involved in the system, their environment, and the communication protocols.

2) The realization of intelligence for the agents so that they can make decisions based upon the continually volatile situations.

The architecture of the system contains a main container and few other individual containers (also called agencies) for different groups of entities involved in the system (figure 2). All containers register themselves with the main container upon creation and reside on the same platform. A platform represents a particular stock exchange, and from the implementation perspective, it is the overall agents’ environment. The main container holds the Agent Management System (AMS) agent and the Directory Facilitator (DF) agent. AMS is the authoritative body of the platform which provides the naming service for all the agents residing on the platform. Equally important is the role of DF agent which provides a Yellow Pages service by which an agent can locate other agents providing the services it may require. Figure 2 illustrates the outline of the TrAgent architecture in JADE.

(7)

Figure 2. TrAgent Model in JADE

3.1

Investors Agent

Investor agents are created in the investor container, and are critical in the sense that only they initiate a transaction. Every investor agent uses the DF service to find a brokerage firm agent which provides the stock broker agent or discount broker agent to perform the required transactions. TrAgent only allows the investor agents to perform trade, i.e., buy/sell stock or ask for analysis.

3.2

Brokerage Firm, Stock Brokers and Discount Broker Agents

Brokerage firm, stock broker, and discount broker agents are created in the brokerage firm containers. There may be multiple brokerage firm containers in the system to represent different brokerage firms. The brokerage firm agent publishes its services with the DF service for investor agents to locate it and request its services. The brokerage firm receives the requests from investor agents and assigns the job to an available stock broker or discount broker agent by maintaining a list of all active stock brokers and discount brokers.

Stock broker and discount broker agents register only with one brokerage firm agent. These agents continually provide the brokerage agent with their status information, which can be either idle or busy. A stock broker agent manages the transactions for an investor agent and provides analysis of the firms, upon request. For analyzing the stock, the stock broker agent utilizes its fuzzy expert system, described below. A discount broker agent, on the other hand, does not provide any advice on the trading. Stock broker and discount broker agents need the service of a floor broker agent to perform the actual stock transaction. They use the DF service to find a booth clerk agent and to request from it a floor broker agent.

Investor Container Main Container AMS DF Brokerage Firm

Container Specialist Container Trading Post Container I1 I2 S1 S2 D1 D2 SP1 SP2 T BF Discount Broker Agents Brokerage Firm Agent

Stock Broker Agents Specialist Agents Trading Post Agent

Investor Agents

Floor Broker Agents

: Is registered with JADE Platform Booth Clerk Container F1 F2 BC

(8)

3.3

Intelligence for Stock Broker Agent

The objective of applying intelligence capabilities to the agents mentioned in the previous sections is to resemble the behavior of real world investors, stockbrokers, specialist, and any of the other actors involved in the trading process. The intelligent component that has been applied to stock broker agents is a fuzzy expert system (FES) (Zadeh (1965)). This kind of expert system constitutes an extension of the classical rule-based system since it deals with fuzzy rules instead of classical logical rules (Zadeh (1973)), and has been successfully applied to a wide range of problems dealing with uncertainty.

In our approach, a stock broker agent is the entity that provides the investor agent with an ordered list of the firms in which the investor agent is interested, ranking them according to their possible profitability. To do so, the FES receives inputs from stock brokers who belong to the firm and form its rules appropriately by combining their suggestions together. Each brokerage firm possesses a single FES in the current TrAgent’s design. Detailed discussion is presented in ensuing sections. Figure 3 illustrates the architecture of a FES.

3.3.1 Membership Functions

The Profitability of a firm depends on various criteria (see Zopounidis (1996) and Gold (1999)). In TrAgent, four major profitability ratios that influence the profit of the firms have been considered. These factors are “return on equity,” “return on assets,” “operational profit margin,” and “net profit margin.” The stock brokers collect these values from the firms in which it is interested. The stock broker agent then calculates the possible profitability of the firms based on these values, employing the FES, and then ranks them. The input parameters could belong to any of the four input fuzzy sets: NOT SATISFACTORY, MEDIUM, SATISFACTORY and VERY SATISFACTORY. Depending on their membership values, each parameter could belong to more than one fuzzy set.

In general, the approach adopted for acquiring the shape of a particular membership function depends on the application. For most fuzzy logic control problems the membership functions are linear -

usually triangular in shape. The membership functions for the input and output variables considered in our approach are also of triangular type. Deciding upon the ranges of the fuzzy sets for the input variables is a critical task. These ranges vary for different classes of the firms in different industries and there is no way to get a generalized range which works for any firm. In TrAgent, the ranges for the input and the output fuzzy sets for a particular industry are provided by the experts and then adjusted (discussed later). To do so an expert evaluates the statistical values of all the firms in a particular industry and provides with the ranges that are particular to the firms in that industry. Different stock broker agents in different firms could apply different

(9)

membership function ranges for their FES, depending on their analysis. As an example, one set of these ranges and their membership functions are shown in the Table 1.

Table 1. An example of the input fuzzy sets and their ranges

3.3.2 Fuzzification and Aggregation

Figure 3. The Mamdani-style fuzzy inference

Figure 3 illustrates the Mamdani-style FES architecture, developed for the stock broker agents in TrAgent. In the first stage, the crisp inputs—ROE (return on equity), ROA (return on assets), OPM (operational profit margin), and NPM (net profit margin)—are received for a particular company and the degrees to which these inputs belong to each fuzzy set are determined. The membership functions, described earlier, are used to associate grades to each linguistic term. The second stage is the decision making logic where the fuzzified inputs are applied to the antecedents of the fuzzy rules. The third stage is the aggregation of the rule outputs in which the process of unification of the outputs of the fired ruls takes place. The last step in the fuzzy inference process is defuzzification of the results. The process of defuzzification is described in section 3.3.3. The stock broker agent decides whether the profitability of a firm is low, medium, high or very high based upon this crisp

Return on Equity (A1): Return on Assets (A2):

A1 < 3% NSAT 1 < A1 < 9% MED 8 < A1 < 16% SAT A1 > 14% VSAT A2 < 6% NSAT 4 < A2 < 10% MED 8 < A2 < 15% SAT A2 > 13% VSAT

Operational Profit Margin (A3): Net Profit Margin (A4):

A3 < 6% NSAT 4 < A3 < 11% MED 8 < A3 < 16% SAT A3 > 13% VSAT A4 < 5% NSAT 3 < A4 < 12% MED 9 < A4 < 18% SAT A4 > 15% VSAT

Fuzzification Inference Engine INPUT ROE ROA OPM NPM Rule Base Defuzzification

(10)

value produced by the defuzzification stage. Fuzzy rules are generally generated heuristically. The rules in the rule-base of the FES are of the following form:

IF a1in A1 AND a2in A2 AND a3in A3 AND a4 in A4 THEN b in B

Where ‘ai’ is the linguistic variable representing an input to the fuzzy system while ‘Ai’ is the corresponding fuzzy set which represents a linguistic term being associated with a membership function (µAi) that specifies the degree to which aisatisfies Ai. The rule’s output is represented by ‘b’ and its fuzzy set by B.

As the number of the input variables and the fuzzy sets grow the size of the rule-base increases exponentially. That is, for 4 input variables with 4 membership functions for each, the total number of rules would be 256 rules (4*4*4*4). Since one of the main advantages of fuzzy systems is their capability to simplify the environment by dropping the number of the rules, this level of the rule-base complexity is not acceptable. In fact, some of these rules might be contradictory and some might not make sense. For example, if the net profit margin of a firm is “very satisfactory” the operational profit margin cannot be “not satisfactory”. Rules with such contradictory conditions can be eliminated, and since each fuzzy if-then rule is linguistically interpretable, they can easily be understood and filtered by human experts. Below, two of the rules used in the FES are illustrated:

Rule 1: IF ROE is SATISFACTORY ANDROA is SATISFACTORY ANDOPM is MEDIUM ANDNPM is NOT SATISFACTORY THEN Profitability is LOW

Rule 2: IF ROE is VERY SATISFACTORY AND ROA is VERY SATISFACTORY AND OPM is SATISFACTORY ANDNPM is SATISFACTORY THEN Profitability is HIGH

Based on the values of the input variables, and depending on the fuzzy sets these input variables belong to, the rules are evaluated and may be fired by the fuzzy inference engine. The aggregation of the rules which are fired is a two stage process in our model. Initially the Mamdani’s inference method is applied, where the minimum membership value of the antecedents is the degree of truth (Mamdani (1975)). The output membership function is then clipped off at a height corresponding to the rule antecedents, computed degree of truth. At this stage the output is still fuzzy in nature. As an example let us assume that the values for return on equity, return on assets, operational profit margin and net profit margin for a particular company are 4%, 8%, 15% and 18% respectively. The process of fuzzification, using these sample inputs as well as the computed

(11)

output, is illustrated in Table 2. Figure 4 graphically illustrates the rules and how they may be activated based on the example input values along with their corresponding output membership function.

Table 2. Illustration of the fuzzy inference and fuzzy output calculation

Figure 4. Illustration of the activation of the rules for an arbitrary set of inputs

3.3.3 Defuzzification

After aggregating all the fired rules in the rule-base, the obtained result is still a fuzzy set. However, for most applications such as this one, there is a need for a single action or “crisp” solution, to emanate from the inference process. This will involve the “defuzzification” of the solution set. The final output obtained for the example in section 3.3.2 is shown below as fuzzy set µh:

Input Output

ROE ROA OPM NPM LOW MED HIGH VHIGH

4% 8% 15% 18%

0.00 0.406 0.00 0.00

0.00 0.00 0.312 0.00

0.00 0.132 0.00 0.00

0.00 0.00 0.115 0.00

(12)

} / 312 . 0 , / 406 . 0 { MED HIGH h 

This fuzzy set needs to be defuzzified in order to produce the crisp output. There are various techniques available for defuzzification. The center of area method is used in the presented system. Figure 5 demonstrates the center of area method. Let us suppose the aggregated result is represented as a membership function µagg(Z) (darkened region in figure 5), where Z belongs to [Z0, Zq], and this interval is subdivided into q equal subintervals by the points Z1, Z2,……, Zq-1. The crisp value, Zc, according to this method is the weighted average of the numbers Zk (equation 1) (Garcia (2000)). The universe of discourse for the output variable is the profitability, and the profitability made for the sample values is 47%.

     1 1 1 1 ) ( )) ( . ( q k k agg q k k agg k c Z Z Z Z

(1)

Figure 5. Defuzzificatioin of the output using center of area method

3.3.4 Results and Analysis

The last and the most laborious task is to evaluate and tune the fuzzy expert system. A convenient way to examine the system is to look at a control surface. This is a 3D graph in which the inputs form the base of the graph, and the output is represented by the height of the graph above each input pair. The fuzzy logic toolbox in Matlab can generate such surface to analyze the system’s performance. Since the current FES has four inputs and one output, and Matlab fuzzy logic toolbox can generate only three dimensional graphs, thus the performance of our four-input one-output system can be observed on more than one three dimensional plots.

(13)

this class of figures, and with the help of the experts, we have modified the fuzzy sets and the rule base on the universe of discourse. After extensive modification of the fuzzy sets and the rules, the performance of the system for different pairs of inputs is visible in figures 6 to 9. Table 3 represents the performance of five firms, based on their profitability. The input values in this table are taken from money.excite.com on 24th August 2006. The profitability values are generated by the FES based on the ROE, ROA, OPM and NPM of the firms. Figure 10 illustrates the effect of the input values to the output profitability of each firm. An observation can be made in this figure that a decrease in ROE does not affect the profitability to a much extent but a small fall in NPM decreases the profitability greatly.

(14)

Figure 7. The effect of ROE and NPM on profitability

(15)

Figure 9. The effect of OPM and ROA on profitability

Table 3. The input values and the profitability for 5 sample companies

.

Firm ROA ROE OPM NPM Profit

ADP Inc. 18.92 3.86 12.39 12.41 62 Informatica Corp. 21.22 9.04 15.58 12.21 72.1

Sonic Solutions 21.16 13.26 16.73 11.71 75 Sapient Corp. 12.25 8.68 7.26 5.7 37.4 Pegasystems Inc. 0.72 0.59 1.13 3.13 13.8

(16)

Figure 10. Demonstrating the effect of the input values on profitability

3.4

Booth Clerk and Floor Brokers

The booth clerk agent and its floor broker agents are created inside the booth clerk container. Like Brokerage Firm agent, the booth clerk agent also publishes its services with the DF service. It serves requests from stock broker and discount broker agents for available floor broker agents. Similarly, floor broker agents only register with one booth clerk agent, which also provide their status information, idle or busy.

A floor broker agent stays idle until an order is received. Upon receiving a buy order, it locates the corresponding specialist agent and executes the trade. After a transaction is completed, the floor broker reports the result of the trade to the stock broker or the discount broker agent.

3.5

Specialists and Trading Post

The specialist agents and the trading post agent are created in separate containers (Figure 2). The trading post agent is solely responsible for providing stock information to the specialist agent and also to the stock broker agents. The trading post agent publishes and maintains the stock database. In addition, it publishes its services with the DF service when it starts execution.

Similarly, specialist agents register with the DF service so that the floor broker agents can locate them. They

0 10 20 30 40 50 60 70 80 AD P Inc . Infor mat ica Co rp. Soni c S olut ions Sapi ent Co rp. Pega syste ms Inc. Firms Va lu e s ROE ROA OPM NPM Output(Profitability)

(17)

to the floor broker agents. Figure 11 demonstrates the TrAgent agents that publish their services with the DF service to be accessed by other agents such as the investor, sock broker, discount broker, or floor broker to locate them when different services are required.

Figure 11. An illustration of the agents who publish their services

4

Communicative Acts

The communication paradigm adopted by TrAgent is asynchronous message passing. Each agent has a message queue where the Jade runtime environment posts messages sent by other agents. In TrAgent, message exchanged by the agents is specified by ACL language and follows FIPA, which is an international standard for agent interoperability (Bellifemine). JADE ACL messages are modeled after speech acts. These ACL messages utilize an extensive library of 22 communicative acts provided by JADE. These communicative acts allow representation of different communicative intentions between agents such as requesting, proposing, informing, querying, calling for proposal, accepting proposal, rejecting proposal, subscribing, and etc.

The following is a list of the essential communicative acts used in TrAgent:

ACCEPT_PROPOSAL: accept a previously submitted proposal  AGREE: agree to perform some action, possibly in the future  CANCEL: cancel some previously requested action

CFP: make a cal for proposals to perform a given action  CONFIRM: inform a receiver that a given proposition is true  DISCONFIRM: inform a receiver that a given proposition is false  FAILURE: inform another agent that an action was attempted but failed

DF

BF BC SP T

F

S D

: is registered with DF: Directory Facilitator for Platform

BF: Brokerage Firm Agent BC: Booth Clerk Agent SP: Specialist Agent

JADE Platform

T : Trading Post Agent S1: A Stock Broker Agent D1: A Discount Broker Agent F1: A Floor Broker Agent

(18)

INFORM: inform a receiver that a given proposition is true

NOT_UNDERSTOOD: informs a receiver that sender did not understand  QUERY_IF: ask another agent whether a given proposition is true  REQUEST: requests a receiver to perform some action

PROPOSE: submit a proposal to perform a certain action

QUERY_REF: ask another agent for the object referred to by a referential expression  REFUSE: refuse to perform a given action

REJECT_PROPOSAL: reject a proposal during a negotiation

REQUEST_WHEN: request a receiver to perform some action when some given proposition

becomes true

REQUEST_WHENEVER: request a receiver to perform some action as soon as some proposition is

true and thereafter each time the proposition becomes true again

SUBSCRIBE: a persistent intention to notify the sender of a value, and to notify again whenever the

value changes

The communication acts have been fully exploited for the purpose of agent interaction within TrAgent model. All messages exchanged between different agents are tagged with one of the communicative acts. Tables 3 to Table 9 explain the communications that takes place between agent pairs in TrAgent. Figure 12 depicts the initialization phase and sequence of the communicative acts between the agents in unified modeling language.

Table 3. Communication details of the Investor

From:Investor

To: Brokerage Firm

1. Ask for a Stock Broker (CFP)

2. Accept the Stock Broker (ACCEPT_PROPOSAL)

3. Reject the Stock Broker (REJECT_PROPOSAL)

To: Stock Broker

1. Send Stock Order details (Trade) (PROPOSE)

(19)

Table 4. Communication details of the Brokerage Firm

From:Brokerage Firm To: Investor

1. If any IDLE Stock Broker found, send the name of the Stock Broker (PROPOSE)

2. Else Send the Stock Broker unavailability message (INFORM) Table 5. Communication details of the Stock Broker

From:Stock Broker

To: Brokerage Firm

1. Send the status as IDLE when created (SUBSCRIBE)

2. Send the status as IDLE when it completes the investors job (SUBSCRIBE)

3. If Stock Broker gets killed send the message to remove itself from the available Stock Brokers list (SUBSCRIBE)

To: Booth Clerk

1. Ask for a Floor Broker (CFP)

2. Accept the Floor Broker (ACCEPT_PROPOSAL)

3. Reject the Floor Broker (REJECT_PROPOSAL)

To: Floor Broker

1. Send the Stock Order details [Trade] (PROPOSE)

To: Trading Post

1. Send the Stock details (Analysis) (REQUEST)

To: Investor

1. Trade Confirmation (CONFIRM)

2. Trade Rejection (DISCONFIRM)

Table 6. Communication details of the Booth Clerk

From:Booth Clerk To: Stock Broker

1. If any floor brokers available send the stock broker with the name of the available Floor Broker (PROPOSE)

(20)

Table 7. Communication details of the Floor Broker

From:Floor Broker To: Booth Clerk

1. Send the status IDLE when created (SUBSCRIBE)

2. Send the status as IDLE when it completes the Stock Brokers job

(SUBSCRIBE)

3. If Floor Broker gets killed send the message to remove itself from the available Floor Brokers list (SUBSCRIBE)

To: Specialist

1. Send Stock Order Details (PROPOSE)

To: Stock Broker

1. Trade Confirmation (CONFIRM)

2. Trade Rejection (DISCONFIRM)

Table 8. Communication details of the Specialist

From:Specialist To: Trading Post

1. Sends Stock Details [Query] (REQUEST)

2. Sends Stock Order Details [Update] (REQUEST-WHENEVER)

To: Floor Broker

1. Trade Confirmation (CONFIRM)

2. Trade Rejection (DISCONFIRM)

Table 9. Communication details of the Trading Post

From:Trading Post To: Specialist

1. Reply Query Results (INFORM)

To: Stock Broker

(21)

Figure 12a. The initialization phase of the communicative acts between the agents

(22)

Figure 12b. The sequence diagram of the communicative acts between the agents

5

Implementation of the Security Aspects

As mentioned earlier, TrAgent is developed on JADE agent platform. Currently, JADE does not provide strong security features; however, the basic security requirements are provided. JADE has no specific built-in form of security unless the security add-on is installed. To install the security add-on features, the version 2.6.1 or the later versions are required. The JADE platform with the security add-on features is also called secure JADE or JADE-S (Jade Board (2005)) (the JADE Version 2.6.1 with security plug-in is the JADE-S version 1 and the JADE Version 3.2 and current version 3.3 with security plug-in is the JADE-S version 2.)

The JADE-S platform provides some security features that have been utilized to implement adequate security infrastructure for TrAgent. JADE-S provides four basic security features: authentication, permission, signature and encryption. In the following subsections, discussion on how these features are utilized in TrAgent model is

(23)

5.1

Authentication

In JADE-S, every component (agent, container, and platform) is owned by an owner. Every platform can assign user accounts to the agents, who require access to them, so that the agents can be identified and allowed to be registered with the platform. As mentioned before, in TrAgent every platform represent a stock market. Each platform keeps a password file that stores the entire users’ information. Any agent who desires to register with a platform must first have a valid identity, assigned to it by a valid platform in the environment. This means an agent could be registered with multiple platforms to provide interconnectivity among them when desired (figure 14). This mechanism can protect the platforms from being attacked by some unknown or unexpected agents. As such, in TrAgent model, agents are grouped into different platforms as discussed earlier (figure 13), and because of the security concerns, the number of user accounts are set to be at its minimum in each platform.

Brokerage Agent

BoothClerk Agent (Owner: the Booth)

Owner: Investor1

Owner:

Brokerage Firm The Booth The Trading Post

TradingPost Agent (Owner: the Trading Post)

Owner: Investor2 Investor Agent Investor Agent Stock Brokers Agents Discount Brokers Agents

Floor Broker Agents (Owner: Different Brokerage Firms)

Specialist Agents (Owner: Different

Firms)

(24)

Figure 14. Agent ‘A’ was originated in Container-2, and then registered with Main Container

Saying that, there exist couple of weaknesses in the current version of JADE-S authentication mechanism. One problem is that the user accounts are set only when starting a platform. In other words, the user accounts cannot be modified during the runtime. To modify a user account file, the platform must be shut down and restarted again. This imposes a serious limitation to our application. In TrAgent, the user accounts in a platform may need to be dynamically modified, especially in the booth platform and the trading post platform. If a new brokerage firm is added into the TrAgent system, one of the booth platforms should generate a user account for the brokerage firm, since there will be a floor broker agent that represents this new brokerage firm. Another limitation is that the user accounts and passwords are stored in a plaintext format, which could be risky if it is exposed to some malicious users. If the file is disclosed by some malicious agents, then various security attacks could be performed against the platform as well as the agents in that platform. For example, the malicious user can easily create some malicious agents, using the stolen account information, and cause some harm to the platform. As the worst case, the malicious user may even steal the identity of the administrator account and get full control of the platform as well as the agents in it. Thus an encrypted file will be a better alternative to store the user accounts and passwords.

5.2

Permission

In JADE-S, an entity’s behavior can be limited by assigning the entity certain permissions. Permissions can be assigned to users, agents and codes (an agent is also called a “principle,” which means any entity that can take actions and hold responsibility for them.) There are different classes of permissions: platform permission, a user can create or kill a platform; container permission, a user can create or kill a container; agent permission, a user can create, kill, suspend, or resume an agent; AMS permission, a user can register, deregister, or modify an AMS; message permission, a user can be allowed or prohibited to sending messages to another user. In

(25)

policy files. There are two kinds of policy files: the main container policy file and the regular container policy file. These policy files determine what permissions a principle has in the container. In TrAgent, minimum permissions are assigned to each agent. The kind of permissions an agent is given depend on its rule in the operation of the stock exchange model.

One limitation of current version of JADE-S is that permissions may not be assigned dynamically during the runtime. This limitation is similar to that in the authentication. To modify the permissions of the agents, the old platform must be shut down and restarted again using the new policy file. To overcome this drawback and dynamically assign or modify permissions, delegation mechanism may be utilized. Using the delegation mechanism, one agent can share its permissions with another agent, which provides for implementation of dynamic permission management in TrAgent. The second limitation is that mobility related permissions are still missing. As a consequence, TrAgent currently does not provide this class of permission management.

5.3

Encryption, Signature, and Mobility

The discussion on encryption, signature and mobility is made together since the current version of JADE-S does not provide flexible and comprehensive mechanisms for these features. Regarding encryption, JADE-S provides limited number of basic algorithms for the users. This set of encryption algorithms provides adequate protection for the integrity and confidentiality of the messages when attacks are not very sophisticated. Similarly, a user can add a signature to a message to improve the security. However for both cases, the user does not have access to the keys, neither symmetry nor asymmetry, and does not have a flexible way to handle the way the messages are encrypted or signed. Some other external tools, such as Java tool-kit, can be used to create a flexible way to handle the encryption and signature. These external tools are necessary if a feasible implementation of the secure stock exchange model is desired.

Regarding mobility, the current JADE-S only supports intra-platform mobility. In other words, agents cannot migrate from one platform to another. This is a limitation to our TrAgent model. In addition, the current JADE-S does not support permissions for mobility. Thus, in order to implement the TrAgent model in JADE-JADE-S, the agents that need to migrate must be in one platform and still suffer the security threats of receiving unexpected incoming agents or not utilizing the mobility features at all. Therefore, the current version of JADE-S does not provide us a suitable way to implement the mobility features of the model. ▪

In summary, the current version of JADE-S provides only limited security features that are used to implement the TrAgent model in a secure environment. However, as mentioned above, there are some limitations in the current version of JADE-S among which some cause serious drawbacks for the development of the system. To

(26)

have a practical and satisfactory implementation, some other external tools can be employed together with JADE-S to provide a better scheme. However, regarding features such as mobility, we hope the future version of JADE-S incorporates significant improvement, such as providing inter-platform mobility and allowing mobility-related permissions.

6

Conclusion

This paper presented a multi-agent architecture encompassing the stock exchange, from when an investor issues a market evaluation request or a trade order until the transaction has been executed and reported. The majority of recent literature suggests the use of mobile agents and artificial intelligence mainly as a tool for surveying the market and supporting in decision making. However, no system known to the authors has comprehensively modeled the actual stock market as it is today. The aim was to provide a model for trading which can be used as a platform to:

 study the flow of trading, to implement strategies,  study future stock exchange technology, and  provide a foundation for an artificial stock market.

The basics of the stock exchange and the procedures in trading were first presented. The implementation of the components of the stock market was reviewed as to their functionalities and capabilities. Then the intelligent component of the stock broker agents was introduced in detail and examples of the implementation were illustrated. Thereafter, the interaction among the components, and the activities during the trading process, and finally, the security issues were discussed. Regarding the stock broker agents’ fuzzy expert system, we

presented a methodology for adjusting the ranges for the input and the output fuzzy sets by utilization of 3-dimentional diagrams that illustrate the effect of a pair of inputs on the profitability.

Developing strategies and models for investments in stocks and other securities excites many. This area is really two-fold: first to develop the models and secondly realize them using artificial intelligence. The stock exchanges were rapid to introduce computers and networks in their daily operations; however, they assigned the technology to communication and not decision-making. Developing software components for autonomous decision-making is difficult; clear unambiguous ontologies are lacking and strategies are difficult to implement due to their complexity. This field requires considerable research; especially, to realize the strategies using artificial intelligence and mobile agents. The presented work is a stepping stone towards these objectives.

(27)

Reference

Bellifemine, F., Caire, G., Poggi. A., and Rimassa, G., JADE: A White Paper, http://jade.tilab.com/ Bjursell, J., Rahimi, S., and Wang, C.F., “Modeling the Stock Exchange Market Using Mobile Agent

Technology and its Security Issues,” International Journal of Education and Information Technology, Vol. 1, No. 1, pp. 28-38, September 2004.

Daniel, Y. S., “Automated Bargaining Agents”. In S. Weld Department of Computer Science and Engineering, FR-35 University of Washington Seattle, WA 98195, January 1995.

Garcia, A., Gollapally, D., Tarau, P., and Simari, G., "Deliberative stock market agents using Jinni and defeasible logic programming," Proc. of the ECAI Workshop on Engineering Societies in the Agents' World, Berlin, Germany, pp 126–139, August 2000.

Gold, S. C., and Lebowitz, P., “Computerized stock screening rules for portfolio selection,” Financial Services Review, vol. 8, no. 2, pp. 61-70, 1999.

JADE Board, “Jade Security Add-On Guide,” Technical paper, JADE 3.3, Retrieved from http://jade.tilab.com/doc/SecurityAdminGuide.pdf, Feb. 2005.

Lorie, J. M., The Stock Market: Theory and Evidence, McGraw-Hill College, 1997.

Nedovic, L., and Devedzic, V., “Expert System in Finance – A Cross-section of the field,” Expert Systems with Applications journal, vol23, no.1, pp. 49-66, 2002.

Parkes, D. C., Huberman, B. A., “Multiagent Cooperative Search for Portfolio Selection,” Games and Economic Behavior, vol. 35, pp 124-165, 2001.

Mamdani, E. H., and Assilian, S., “An experiment in linguistics synthesis with a fuzzy logic controller,” International journal of Man-Machine Studies, vol. 7, no. 1, pp. 1-15, 1975.

Mikler, A. R., and Mayes, J. T., “Distributed data mining - an application for wos. In Distributed Computing

(28)

Ruddle, M., “The application of mobile agents to share trading,” M.S. thesis, Dept of Electrical and Electronic Engineering, University of London, http://www.ee.ucl.ac.uk, 1999.

Suri, N., Bradshaw, J.M., Breedy, M.R., Groth, P.T., Hill, G.A., and Jeffers, R., “Strong mobility and fine-grained resources control in NOMANDS,” Proc. of the 2nd Intl. Symposium on Agents Systems and Applications and the 4th Intl. Symposium on Mobile Agents, vol. 1882 of LNCS, pp. 2-15, 2000.

Zadeh , L. A., “Fuzzy sets,” Information and Control, vol. 8, pp. 328-353, 1965.

Zadeh, L. A., “Outline of a new approach to the analysis of complex systems and decisions processes,” IEEE Transactions on Systems, Man, and Cybernetics, vol. 3, no. 1, pp. 28-44, 1973.

Zopounidis, C., Doumpos, M., and Matsatsinis, N.F., “Application of the fineva multicriteria knowledge-based decision support system to the assessment of corporate failure risk,” Foundation of Computing and Decision Sciences, vol. 21, no. 4,1996.

Figure

Figure 1. Trading floor and its components
Figure 2. TrAgent Model in JADE
Table 1. An example of the input fuzzy sets and their ranges
Table 2. Illustration of the fuzzy inference and fuzzy output calculation
+7

References

Related documents