Does more intelligent trading strategy win? Interacting trading strategies: an agent-based approach

asset returns. The wealth dynamics for each agent group is analysed throughout trading period. Agents with a higher time complexity trading strategy outperform those with strategy (cid:70)(cid:82)(cid:80)(cid:83)(cid:68)(cid:85)(cid:76)(cid:81)(cid:74)(cid:3)(cid:87)(cid:75)(cid:72)(cid:76)(cid:85)(cid:3)(cid:192)(cid:81)(cid:68)(cid:79)(cid:3)(cid:90)(cid:72)(cid:68)(cid:79)(cid:87)(cid:75)(cid:17)


INTRODUCTION
The World Bank statistics reveal that the market capitalisation of all listed companies on stock exchanges in the world reaches a total of 94 trillion US dollars in 2020. 1 There have broad range of studies aiming to explain dynamics of asset prices and model this comthe capital market theory for asset pricing assumption were the most common approaches used. These approaches assume that prices are -tions have been challenged by both empirical Therefore, alternative approaches have been introduced, Kahneman and Tversky (1979) proposed the prospect theory as a part of irrationally assess gain and losses asymmetrically. Cont (2001) also present a set of stylbe explained by these traditional approaches. In this sense, agent-based models (ABMs) are introduced as a "paradigm shift" with more realistic assumptions as boundedly rational agents with heterogenous expectations. ABMs offer as emergent behaviour of system as result of interaction among system entities. Therefore, ABMs draw a wide attention and Jean-Claude Trichet, the former ECB president, writes that "We need to deal better with heterogeneity across agents and the interaction among those heterogeneous agents". 4 An ABM is a simulation to model a system consisting of interacting agents. Agents can have static or adaptive rules to initiate their interactions with other agents and environment. It has great importance in terms of providing bottom-up understanding of systems. model the interactions among market entities and agents can also apply range of sophisticated learning capabilities especially when continuous adaptation exists. 5 spective, traditional models fall short to explain the behaviour of market through extreme situ- 6,7 since there is no such classical approach to capture behaviour of crashing markets. In this sense, ABMs can capture such extreme moves when built with necessary components and optimal parameter calibrations.
Simulating stock markets has been growing market mechanism, wealth dynamics and price dynamics. 9, 10,11,12 The seminal paper of the Santa There is no simulation model can reproduce all known facts due to increasing complexity of model, hence models are kept simple in compliance to Ockham's razor principle which asserts to use minimal entity for explanations.
The trading strategies agents employ play simulation model. 17 These strategies can range from zero-intelligent agents 26 to very intelligent agents compared to earlier studies. 27 In a recent study, Llacay and Peffer (2018) used agents with realistic trading strategies that takes historical price into account. The method used to take trade action mainly relies on future price forecast which can be any method, for example, evolutionary techniques such as works. Agents can also employ social learning method where agents observe other traders and change their strategy accordingly. 9,28 this may lead a herding behaviour in the marthe herding behaviour as a reason for bubbles Considering main components of agentmethods are main agent diversifying component in the model. In this sense, considering existing studies, there are a few studies that takes realistic agent trading strategies since the earlier studies mainly employ agents with zero-intelligent and agents using fundamental value and genetic algorithms. In this study, we more realistic technical and fundamental trading strategies as well as machine learning approaches. The methods our agents use have been studied in the literature for price pre- the most of prediction methods use historical data and do back testing to measure the sucmethod interaction with market environment, and this assumes no price impact in the market. Considering this fact, we equipped our agents with realistic trading strategies and let them to interact with all market entities. With this, the agent's market effect is considered, and the model provides an insight into wealth dynamics of interacting agents. The model pro-market hyper-parameters such as price tick size.
We extend the GASM model by adding interacting intelligent agents and analyse market dynamics and wealth dynamics. We aim to make four main contributions to the agent-(1) reproduction and validation of the GASM strategies which are commonly used by practitioners (3) we analyse wealth dynamics of agent types hence, the effect of intelligence level on noise traders in the market.
The rest of the paper is structured as follow: Section 2 presents our simulation model. In Section 4, simulation results are given.
concludes the study.

PROPOSED MODEL
lar microstructure with GASM model, for a detailed description of the model structure. 40 The herding behaviour phenomena is modelled different from GASM model. Agents form cluster is activated with a given probability that all agents belong to the cluster are either seller or buyer.

2.1
Trader Types and LSTM 31 are used to predict future stock price for trading. In this sense, an environment erogeneity of traders in real market. The literature in testing trading methods usually take a strategy as a baseline and do back testing to compare performances. Therefore, agent-based not possible to mimic the entire complex real market dynamics. market is populated with six types of agents who are named as the method they are equipped with: Noise, Moving Average Convergence Divergence (MACD), Relative Strength Index (RSI), Bollinger Bands, ARIMA and LSTM. Agents will be named with the method they the amount of assets (cash) to be traded is random fraction of assets(cash) and the limit price is a draw from a interval that is attached to historical volatility. Agents rely on their signal function when taking trading decision.
have a great importance in keeping the market working since they act as a catalyser in the market and supply volume for intelligent traders. 8,35 is considered as a momentum indicator that gives signal of overbought or oversold. The method is developed by Wilder (1978) and the RSI value range from 0 to 100 and the RSI value is regarded as overbought if it is above 70 while it is oversold when it is below 30.
is a technical trader tool developed by Gerald Appel in late 1970s. It is mainly based on exponential moving average (EMA) which is a type of moving average that takes the more recent data points the greater weight. is a technical trader tool developed by John Bollinger in 1980s. It is volatility measure indicator that relies on the past price of asset and its volatility. The agents using ARMA(p, q) forecast with ARMA model is computed recursively. The ARIMA model use integrated data by differencing the raw data to meet the time series stationary. The ARIMA traders checks stationarity of stock price and do differencing till obtain a stationary series. The traders estimate ARIMA models with different lags to p and q the model with minimum Akaike information criterion (AIC). The forecast price values are predicted and that is fed into a decision-making process.
is recurrent neural net-Schmidhuber (1997). It is a machine learning method with deep networks and differs from feedforward neural networks with feedback connections since it can process sequences of data. The LSTM is widely used in predicting stock price movement and outperform baseline approaches. 31,39 The LSTM traders use simulation initialisation period stock price return to predict following 5-periods return so post orders accordingly.

MARKET INITIALISATION
At the beginning of simulation, the stock price p 0 is set to be $100. The wealth is equally distributed among agents, each get 1000 stock (inventory) and $100000 cash. The hyperparameters for market is set before simulation run as in Table 1.
There are total of 550 agent population of which 500 noise traders and 10 for each of RSI, MACD, Bollinger, ARIMA and LSTM traders. The tick size for asset price is one cent. Marchesi et al. (2003) extended the GASM model by populating the market with four different agents. Like this study, the most of agents are noise traders that enables the order matching mechanism working. The simulation time steps refer a trading day and simulation is consist of 5040 days which is approximately 20-year trading period since a year has average Agents are in a partially observable environment since they only can access asset price. Agent types use technical trading indicators, statistical model for time series, and a machine learning, deep learning. All intelligent agents they rely on signals for the forecast period. The stock market is closed form since there is The total wealth of agent agent at time step can be calculated as = + , where and are the cash amount and assets of agent at time step and p t asset price. wise. The wealth of a trader changes throughout simulation as a result of their interactions. The actions within market environment are based on the strategy trader employ to take buy or sell action. Building these strategies rely on the parameters that emulate realistic trading strategies, which is given in Table 2.
Market initial parameters.

SIMULATION MODEL AND RESULTS
In this section, the extended GASM model is simulated, and the result of the experiments to trade in the market for a given initialisation period hence, initial stock price is generated. different traders who are called "intelligent" agents since those agents predict future price move. The market behaviour emerges under agent interactions. The simulation is run with 500 noise traders and 10 intelligent traders for each method. Since the amount of asset to trade is a random friction of agent's wealth, having 10 agents for each method will decrease the effect of randomness on average. Several simulations with same parameters were run and all give similar outputs. Therefore, results here are a representative simulation model for those series The model keeps the GASM main structure, however, some parameters are tuned after several experiments and intelligent agents are added to the market. The population share of traders in the market are determined with experiments. A market with more than 10% of intelligent agent population leads stock Stock Market Simulation Loop Structure. price jumps and halt in price formation process. The decision-making process is two part which are trading decision and the amount to trade. The amount to trade is random fraction sion depends on the method agents use, trading signal functions is summarised in Table  3. It shows the tuning options on parameters for agent trading methods hence, mostly used realistic trading parameters are used to condition realistic trading strategies.

Price, return and volume analysis
approaches have assumption that stock returns than normal distribution. 3 In addition to this acteristics that are well documented in Warner and Brown (1985). Therefore, the price and other emergent features of simulated market Agent decision estimation window and decision making. Descriptives of price returns are in line with real world stock return features which has zero mean and have heavy-tailed distribution. The distribution is leptokurtic and left skewed with 11.65 kurtosis and -0.769 skewness measure. The price is not-stationary at lation parameters are tuned for different combinations of market and agent parameters. The most striking result is that increasing population of intelligent agents halts price formation so the market.

Validation
market model is measured with the number of stylized facts the simulation model is capable to reproduce. The validity of our built model cial market features. As a seminal work, Cont (2001) documented a list of stylized facts for markets have reproduce some these stylized facts but not all of them, so do ours. In addition to all market microstructure parameters, there are also six different types of agents interacting which increase the complexity of the stock market. The validation process is conducted for each fact given in Cont (2001).

Return autocorrelations
It is empirically showed that autocorrelation time scales could be exception. 3 There would be a price to be exploited otherwise, and this function (acf) values for simulation generated asset price returns indicates that there is a staafterwards. This is more like intraday small The slow decay behaviour in absolute return autocorrelation function is another real marfeature that is measured by squared returns  10 and 15, respectively. This is a sign of long dependence of volatile market conditions so the conditional volatility behaviour.

Volume/return corelations
It is expected to asset return has negative correlation with volume, however the simulation output short fall to meet this feature since the calculated correlation is = 0,03. Another as negative correlation between return and change in volatility. The simulation output was able to reproduce a weak with . The validity of our model with stylized facts is summarised on Table 5.
Testing all stylized facts given in Cont (2001) for asset price and volume outputs from simulation show that the model can replicate real market features and they are summarized in Table 5.

Wealth analysis
The literature in testing trading strategy methods relies on back testing mostly where the agent is assumed to have no market impact on market dynamics since they interact with market participants. This study aims to create a stock market testbed where agent interaction is considered, hence variety of sensitivity analysis can be applied. Satisfying some real market stylized facts, the agent-based model is capable of generate real market features. Therefore, the market is populated with different types of partial autocorrelation function.
List of stylized facts for asset returns that is used for simulation model validations.

Stylized fact
Testing Does our model meet?

Absence of return autocorrelations Autocorrelation plot Partially
Slow decay of autocorrelation in absolute returns Autocorrelation plot Squared return autocorrelation plot

Aggregational Gaussianity Skewness and Kurtosis No Corelation No
Leverage effect Corelation Partially agents who compete to increase their wealth at the end of trading period.
One of the question this study aims to answer is if computationally intelligent agents can beat the overall market. In the light of this with the signal they receive. The rules agent use to trade were summarised in Table 3. Based on these rules, agents entered market and start to trade. The average wealth of agent The agent named LSTM, which is a deep learning method, outperforms other agents by far. LSTM method is the most complicated and computationally costly method among others. Computation power can be considered as intelligence level in an interacting agent market. Therefore, it can be concluded that the more computational power the higher return. The number of days agents take long, and short positions is summarised in Table 5 Two agent group RSI and Bollinger are reluctant to take position since there is no up-down pattern in price long run. ARIMA and LSTM trade most of time since they take position based on their future price move predicagent types, agent wealth differs statistically of agent type pairs was tested at 1%, except Noise-MACD agent pairs, the rest of 14 pairs has different wealth over the trading period. A boxplot for each agent group is created that Although all agents belong to the same group use the same trading method, they differ in the amount to trade at each trading decision. Therefore, randomness in amount to trade decision give advantage to some traders. In this sense, each group has at least ten members and distribution checked at initial and homogenous. To measure this, the Gini coefinequality in wealth that ranges from 0 to 100. increase in it is a sign of inequality in wealth distribution. At the beginning of simulation all agents were endowed with same amount of small inequalities occur during trading period Average wealth of agent types in cash throughout trading period. type agents were kept, and it remains stable at is a measure of wealth inequality, the outliers -

DISCUSSION AND CONCLUSION
The study aims to gain a better understanding of trader interaction in stock markets and reproduce real market price features.
approach is employed to serve the purpose of this study since it takes agents' market impact into account. The model was able to reproduce real market "stylized facts", thus it is eligible to were able to equip agents with realistic trading into rivalry of different intelligence level in agents and supporting evidence to dominance of computationally powerful agents. It is evident that agent using deep learning approach get the highest return among others with the highest time complexity method.
with agent groups using no trading strategy, RSI, MACD, Bollinger, ARIMA and LSTM methods. Catalyser effect of noise traders is tested as the increase in population of intelligent agents halts market and that is ligence in agents helps market to move and provide liquidity to the market. are also in line with back testing on real data, Siami-Namini et al. (2018) compares performance of ARIMA and LSTM methods where the LSTM trader outperforms. This is also can be taken as validity measure whereas Llacay and Peffer (2018) use also face validation and sensitivity analysis to validate their market model extended with realistic trading strategies.
Our results are consistent with the previous work of Raberto et al. components is built and validity of empirical tic trading strategies compete alongside agent interactions in our bottom-up market model. The emergent behaviour of the market is a result of agent interactions which is hardly let agents to interact at micro level and analyse the behaviour of market dynamics under different parameter combinations. This can also be considered in a game theorical view since competence of different strategies resulted in price equilibria. Considering these aspects, help us to better understand market dynamics even in a competing strategies environment.
There are potential limitations of study that heterogeneity in agents is more diverse in real markets such as informed and uninformed Although our model mimic real market price features, fundamental value of an asset is the key for major investors and could be added as one trader type. A more powerful computation can ease time complexity of simulation when agents with complex trading strategy is considered such as deep learning method. market parameters, different combination of parameters can be applied when modelling interest in high-frequency trading and limit order book modelling 44 , therefore there are variety of direction to apply machine learning tools for future research.  -Get real: Realism metrics for robust limit order book market simulations. In