Trading Agents
An important point is to have a description of the trading agents’ behaviour, which is as simple as possible, and with the minimal number of parameters which are still able to produce stylized facts of the collective FX market traders’ behaviour.
The simplicity is very important to allow for a detailed interpretation of the origin and nature of the stylized facts of real traders’ behaviour in isolation from complex trading behaviour.Initial Wealth Distribution
Since our intention in building models of the traders’ activity is to mimic real market traders’ behaviour, the trading agents are endowed with different amounts of cash, based on a power law distribution. Pareto (1897) showed that the income distribution in many countries follows a power-law distribution. In the follow-up to Pareto’s work, a number of studies supported Pareto hypothesis by providing evidence from empirical data (Steindl, 1965; Atkinson & Harrison, 1978; Persky, 1992).
The power-law distribution is employed in the simulation by converting a random number that is uniformly distributed into a number that is distributed along the power-law distribution. The power-law and the random variable are related via:
where p0 and p1 is the lower and upper bounds respectively from which the laws hold. C is a constant value define by:
Estimating the value of the scaling exponent for a power-law distribution is very important due to its role in characterising the distribution. The larger the scaling exponent, the steeper the curve, consequently implying more small scales that large ones. Caution in estimating the scaling exponent is essential; a number of experiments was carried out to decide on the more fitting scaling exponent for the model.
Trading Strategy
The trading agents’ behaviour is based on the zero-intelligence directional-change events trading strategy (DCT0) in which the trader commit himself to a fixed threshold (percentage) (Aloud, et al., 2010). DCT0 traders look into the price time series based on intrinsic time changes rather than physical time changes. The physical time changes are the changes that occur in time series from milliseconds through hourly to daily changes, in which the flow of time is discontinuous. Alternatively, the intrinsic time basic unit of the price time series is an event. An event is defined as the total price movements exceeding a defined threshold by the trader. These events identify crucial points, which formulate an opportunity to trade.
An event can take one of the two forms an upturn event or downturn event. An upward run is a distance between an upturn event and the next downturn event while a downward run is a distance between a downturn event and the next upturn event. An upturn (downturn) event terminates a downward (upward) run, and starts an upward (downward) run. During an upward run, a last high is constantly updated to the maximum of (a) the current market price p(t) and (b) the last high price ph. Similarity, during a downward run a last low is constantly updated to (a) the minimum of the current market price p(t) and (b) the last low price pl. A downturn event occurs when the absolute price change between the current market price p(t) and the last high price ph is lower than the threshold Axdc used by the trader: p(t)pl?(1-Axd)
At the beginning, the last high and last low are set to the initial market price. Whenever a trader detects an upward event, according to the used threshold, he will conclude that the market in on upward run, which could means an opportunity to trade. Similarity, a downturn event means a downturn run in which it is an opportunity to trade.
Two different groups of the trading agents are identified based on DCT0: contrary traders and trend-following traders.
A contrary trader opens a position (place an order) predicting that the price will move in the opposite direction. For example, a contrary trader may open a new long position when the price goes down according to the threshold used by the trader. Later, the contrary trader closes the position as soon as the price rises by the used threshold. In contrast, a trend-following trader takes advantage of market trend movements, assuming that the current market trend will continue. A trend follower opens a new long position when the price is rising while a short position is taken when the price is dropping. To illustrate, a trend follower enters into a new short (long) position if the current bid (ask) rate declines (go ups) by a percentage which is equal to, or above, the used threshold by the trader.The buying and selling orders placed by these two groups of traders are market orders. The market orders are orders for immediate execution at the current price on the market. To develop a complete investment strategy for the trading agents, we incorporate two types of limit order; profit-taking limit order and stop-loss limit order in which a trader must declare the price at which they wish to close their current open position. The profit taking limit order is an order to close a position to lock a certain profit realization. For example, to close a long position the profit taking limit order price must be higher than the purchasing price, whereas to close a short position, the profit taking limit order price must be less than the selling price. The stop-loss limit order is an order to closes a position once a specified loss threshold is reached to limit the loss potential on a position. In detail, a stop-loss limit order to close a long (short) position becomes a market order after the bid (ask) price is at, or below (above), a specified loss threshold price (stop price) defined by the trader.
Profit Objectives and Risk Appetites
Modelling the traders using some of the real traders’ behaviour characteristics generates, to a certain extent, realistic models of traders.
A trader’s profit objective and risk appetite characterizes his trading activity, which obviously affects the volume and flow of market trading activity. Based on that, using the individual OANDA traders’ transactions dataset, we map the traders’ profit objectives and risk appetites into the agent-based models of traders.This is done through tracking each trader’s transactions in each of his traded currency pairs in terms of tracing the number of currency units bought and sold sequentially by the transactions’ execution time. Consequently, we trace a trader’s different types of orders with regard to a given currency pair from the opening to the closing of a position. This allows us to define the traders’ profit and loss thresholds by which they decide to close their positions. The threshold represents the magnitude of price movements as a result of which traders decide to place a new order. From this micro-analysis we observe the following: (a) in the case of the traders’ profit objectives, the majority of traders place a new trade order based on small price movements compared with their previous order. Based on this observation, every trading agent is assigned a profit threshold by means of a continuous uniform distribution that is identified with a narrow range of thresholds values. (b) In contrast, the length of holdings on a losing position tends to be extensive. This indicates that many trading strategies of real traders involve a high degree of risk. This was mapped into the agent-based models of traders in which we defined the trading agents risk appetites to be four times their profit objectives.
Trading on Margin
Trading on margins allows a trader to place an order where the order size larger than the Net Asset Value (NAV) of his account which involves borrowing from the market-maker executing the transaction. Trading on margins depend on the leverage ratio used by the trader. A leverage ratio of x:1 is a margin requirement of y% (±) which means that if the trader decides to place an order, then the trader must have at least y% of the order’s size available as a margin.
Trading on margins involves a high risk so to manage the risk, trading on the margin makes use of a course of action referred to as a margin call. A margin call is a procedure to automatically close all of a trader’s open positions to prevent a trader from losing more than the amount of cash in his account. A margin call occurs once the net asset value of a trader’s account falls below the minimum margin needed to cover the size of his currently open positions.
Activation Initial Condition
To model a realistic trader’s behaviour, it is imperative that initially traders are active in the market at different times, just as is the case in reality. Otherwise, a high level of liquidity will occur at the beginning of the trading period, which in turn implies an extremely low level of liquidity at the end of the trading period. Accordingly, we set up the activation of initial conditions in modelling the traders’ behaviour. Such a condition controls when an individual trading agent will be active in the market for the first time. The activation of the initial condition is based on a small random probability, which is defined before the simulation starts, and remains constant during the simulation.
Trading Time Window
In modelling the trading time window for the trading agents, we take into account the effect of the main market centres’ trading hours and market holidays on the market trading activity of the FX market worldwide. Although the FX market does not imply a fixed trading time window as in the stock market, giving traders 24 hours a day to trade, the trading hours of the worldwide FX market main market centres have a significant effect on the FX market trading activity. The main market centres of the FX market worldwide have different business trading hours and traders’ preferences, which characterize and determine the flow and volume of trading activity in the FX market.
The trading hours of the main market centres of the worldwide FX market can be divided into four major trading sessions (Dacorogna, et al., 2001): the Sydney, Tokyo, London, and New York sessions.
The trading activity starts to increase during the opening hours of the FX market sessions, while during a market session’s closing hours, the trading activity declines. The trading activity increases sharply when two or more market sessions overlap. This is due to more traders participating in the market.Based on the critical role of the FX market sessions on FX market traders’ behaviour, each trading agent is assigned one of the FX market sessions, based on a continuous uniform distribution. The reason behind using uniform distribution assumption is that we want to assign equally the main FX market trading sessions to the trading agents. This is because traders from different geographical locations attempt to trade more frequency during most of the main FX market centres trading business hours, given that they spot many investment opportunities.
Nevertheless, the trading time window for the trading agent is not restricted to their trading sessions. They are able to place orders at any time during the day when their specified conditions are met. However, during the day, based on a very small probability, a trading agent is not allowed to place an order outside his session hours, except for closing an open position if the price movement reaches the expected profit or hits a stop loss limit. Under these conditions, a trading agent may place an order outside his session hours without any conditions.
The weekends in the FX market witness an extremely low level of trading activity due to the small number of market participants. B ased on this, in modelling the traders, we take into account the weekend effect on FX market traders’ behaviour. The trading agents are allowed to trade during the weekends, based on a small probability. Such a probability is defined before the simulation starts, and remains constant.
Random Trading
Several FX market traders place an order in response to factors other than price movements and events affecting the market. Based on this, we incorporate the role of random trading into the agents’ trading strategy. To demonstrate this, when a trading agent has no open position, and the price movements have not achieved the trading agent’s expectations based on a very small random probability, the trading agent can open a new position. Such random probability is defined before the simulation starts, and remains constant during the simulation.
7.2.
More on the topic Trading Agents:
- Experiment
- Challenges for Scaling Agent-Based Modeling
- THE EQUITY PRINCIPLE AND WATER TRADING
- Section 6 Emerging Trends
- Sometimes, bad things are the aggregate result of actions and omissions of more than one agent.
- and then further advanced and refined over time.
- Type 2 Diabetes
- FISHERIES TRADING
- SALINITY TRADING AND OFFSETS
- Agent-Based Simulation for Investigating Genetic and Cultural Transmission