You are on page 1of 17

For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015.

Dynamical Models of Stock Prices Based on


Technical Trading Rules
Part I: The Models
Li-Xin Wang

 agent-based models (Tesfatsion and Judd, 2006), and technical


Abstract—In this paper we use fuzzy systems theory to convert analysis (Kirkpatrick and Dahlquist, 2011).
the technical trading rules commonly used by stock practitioners The random walk model is the benchmark and starting point
into excess demand functions which are then used to drive the of the mainstream academic research on stock dynamics in
price dynamics. The technical trading rules are recorded in
finance and economy. At least two Nobel Prizes were awarded
natural languages where fuzzy words and vague expressions
to the researches that used the random walk model as the
abound. In Part I of this paper, we will show the details of how to
transform the technical trading heuristics into nonlinear dynamic starting point: the 1997 Nobel Prize of Economics to the option
equations. First, we define fuzzy sets to represent the fuzzy terms pricing model of Black and Scholes (Black and Scholes, 1973),
in the technical trading rules; second, we translate each technical and the 2003 Nobel Prize of Economics to the ARCH model of
trading heuristic into a group of fuzzy IF-THEN rules; third, we Engle (Engle, 1982). The basic assumption of the random walk
combine the fuzzy IF-THEN rules in a group into a fuzzy system; model is that price changes (returns) are random and
and finally, the linear combination of these fuzzy systems is used independent, so that past prices are useless in predicting the
as the excess demand function in the price dynamic equation. We future price changes. The advantage of the random walk model
transform a wide variety of technical trading rules into fuzzy
is that it is a good first-approximation to real stock markets and
systems, including moving average rules, support and resistance
provides a simple model based on which other important
rules, trend line rules, big buyer, big seller and manipulator rules,
band and stop rules, and volume and relative strength rules. problems in finance and economy, such as option pricing (Hull,
Simulation results show that the price dynamics driven by these 2009) and volatility modeling (Engle, 1982; Bollerslev, Chou
technical trading rules are complex and chaotic, and some and Kroner, 1992; Fouque, Papanicolaou and Sircar, 2000;
common phenomena in real stock prices such as jumps, trending Andersen, Bollerslev and Diebold, 2010), can be studied in a
and self-fulfilling appear naturally. mathematically rigorous fashion. A problem of the random
walk model is that it does not provide a framework to study the
Index Terms—Fuzzy systems; stock markets; technical analysis; microstructures of the price formation mechanism.
chaos; agent-based models.
The agent-based models overcome this problem by
following a bottom-up approach to model directly the
I. INTRODUCTION
operations of different types of traders such as fundamentalists
Understanding the dynamics of stock prices is one of the and chartists (Hommes, 2006). There is a large literature of
hardest challenges to human intelligence 1. There are mainly agent-based models for stock prices (Tesfatsion and Judd,
three approaches to studying the dynamic changes of stock 2006), ranging from simple heuristic models (e.g., Kyle, 1985)
prices 2 : the random walk model (Bachelier, 1900), the to sophisticated switching among different types of traders (e.g.,
Lux, 1998). The advantage of the agent-based computational
approach is that different types of traders and various trading
details can be incorporated into the models and extensive
Manuscript received January 11, 2014; revised March 4, 2014; accepted simulations can be performed to study the resulting price
April 21, 2014.
dynamics. The main problem of the existing agent-based
Li-Xin Wang is with the Department of Automation Science and models is that there are too many parameters and too many
Technology, Xian Jiaotong University, Xian, P.R. China (e-mail:
lxwang@mail.xjtu.edu.cn). degrees of freedom such that it is difficult to determine the
causes for the price features observed. This complexity also
1
Quoting Newton’s famous saying: “I can predict the motions of the
makes it very hard to calibrate the models to real stock prices.
heavenly bodies, but not the madness of people.” (Wikiquote: Isaac Newton.)
2
Fundamental analysis (Graham and Dodd, 1940) studies the static or As concluded in Hommes 2006: “Simple and parsimonious
equilibrium values of stock prices and therefore will not be discussed here.
For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015. 2

heterogeneous agent models can thus help to discipline the defined in the following sections of this paper). The ’s are
wilderness of agent-based modeling.” time-varying coefficients (representing the evolving market
The third approach to studying the dynamic changes of stock reality (Lo, 2004)), and means the i’th excess
prices is technical analysis that summarizes the trading demand is not present at time t. The ’s can be
heuristics from stock practitioners over hundreds of years of determined based on stock price data , and
real stock trading experiences in human civilization (Lo and we will show the details in Part III of this paper. To convert the
Hasanhodzic, 2010). The foundation of technical analysis is the technical trading rules into excess demand functions, we first
belief that prices follow trends so that past price information is define fuzzy sets to characterize the words used in the technical
useful in predicting the future price values. The mainstream trading rules so that these technical rules become fuzzy
academics do not view technical analysis as a serious scientific IF-THEN rules in the framework of fuzzy systems theory. Then,
discipline and claim that “chart-reading must share a pedestal standard fuzzy logic principles are employed to combine these
with alchemy” (Malkiel, 2012). While the academics stand firm fuzzy IF-THEN rules into fuzzy systems which are the excess
on the Efficient Markets Hypothesis (Fama, 1970) and believe demands in the price dynamic equation (1).
that stock prices are unpredictable, the practitioners are using Part I of this paper is organized as follows. In Sections II, III,
technical trading rules to “ride the trends” to make a lot of IV, VI and VII, we will convert a number of popular technical
money (Lo and Hasanhodzic, 2009). Some open-minded trading rules into excess demand functions, including moving
academics studied the performance of some technical trading average rules, support and resistance rules, trend line rules,
rules and gave positive conclusions (e.g., Brock, Lakonishok band and stop rules, and volume and relative strength rules. To
and LeBaron, 1992; Gencay, 1998; Sullivan, Timmermann and make the picture more complete, in Section V we will
White, 1999; Lo, Mamaysky and Wang, 2000). A main formulate the typical actions of the big buyers and big sellers
criticism of technical analysis is that most technical rules (the institutional traders who manage large sums of money) and
require subjective judgment because the rules are expressed in the manipulators in terms of fuzzy IF-THEN rules. Simulations
terms of natural languages where fuzzy words and vague will be performed in these sections to illustrate the typical price
descriptions are everywhere. For example, one such trading trajectories of these models. Some concluding remarks will be
rule might be: “If the momentum of the uptrend is too strong, drawn in Section VIII.
over-bought may have occurred so that a trailing stop should be In Part II of this paper, we will analyze the price dynamic
placed somewhere below the current price to secure some model (1) with moving-average rules in details to show the
profits.” How strong is “too strong”? Where is “somewhere”? stability, volatility, short-term predictability, return
What amount should be placed at the trailing stop? This is independency, fat-tailed return distribution and other properties
where the academics leave the practitioners (Gigerenzer, 1996; of the model. In Part III of this paper, we will show how to
Gigerenzer and Gaissmaier, 2011), and this is where fuzzy detect big buyers and big sellers in Hong Kong stock market
systems theory (Zadeh, 1971) comes to play, as we will do in based on the price dynamic model (1) and develop two trading
this paper. strategies (called follow-the-big-buyer and ride-the-mood) to
The basic idea of this paper is to use fuzzy systems theory to beat the benchmark buy-and-hold strategy.
convert the technical trading rules into excess demand (demand
minus supply) functions which are then used to drive the price II. MOVING AVERAGE RULES
dynamics. Specifically, consider a stock whose price at time
point t is , where t=0,1,2,…. Suppose there are M groups of The most commonly-used trading rules by technical traders are
traders who are trading this stock from t to t+1, and the traders based on price moving averages of different lengths. The basic
in a group are using the same technical trading rules. By philosophy behind these rules is that the price may be on a trend
converting the technical trading rules for a group, say group , if a shorter moving average is crossing a longer moving average.
into a single excess demand function , we obtain the More specifically, one such trading heuristic is as follows.
price dynamical model as follows:
Heuristic 1: A buy (sell) signal is generated if a shorter
moving average of the price is crossing a longer moving
average of the price from below (above). Usually, the larger the
difference between the two moving averages, the stronger the
buy (sell) signal. But, if the difference between the two moving
where the coefficient accounts for the strength of the averages is too large, the stock may be over-bought (over-sold),
traders in group for the relative change of price from t to t+1, so a small sell (buy) order should be placed to safeguard the
and the denotes variables computed from the past prices and investment.
other information available at time t (the ’s will be precisely
For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015. 3

We now translate this heuristic into an excess demand demand (demand minus supply) and it can be positive (demand >
function using fuzzy systems theory. The moving average of supply) or negative (demand < supply). Define seven fuzzy sets
the stock price with length n is defined as “Buy Small (BS)”, “Buy Medium (BM)”, “Buy Big (BB)”,
“Sell Small (SS)”, “Sell Medium (SM)”, “Sell Big (SB)” and
“Neutral (N)” for ed with membership functions shown in Fig.
2. For example, the membership function of BM (Buy Medium)
is
and

is the log-ratio (relative change) of the price moving average of The numbers 0.1, 0.2 and 0.4 in Fig. 2 indicate, respectively,
length-m to the price moving average of length-n where m<n. 10%, 20% and 40% of the buying or selling power of the
The common choices of (m,n) are (1,5), (1,10), (5,20), (5,50), traders who use Heuristic 1 as their trading strategy. So “Buy
etc. (when m=1, is the current price ). A positive Small”, “Buy Medium” and “Buy Big” means using around
implies a rising mode of the stock, whereas a negative 10%, 20% and 40% of the buying power, respectively. The
signals the weakness of the stock price. sell-side is just the mirror of the buy-side. You can of course
To translate Heuristic 1 into the language of fuzzy systems choose other numbers to reflect the preference of different
theory, we first define fuzzy sets to clarify the meaning of the traders.

linguistic descriptions for the price percentage change



such as “ is positive and large”, “ is negative and
NL NM NS AZ PS PM PL
small”, etc. Specifically, on the universe of (all values
can possibly take, which we assume to be ),
define seven fuzzy sets: “Positive Small (PS)”, “Positive
Medium (PM)”, “Positive Large (PL)”, “Negative Small (NS)”,
“Negative Medium (NM)”, “Negative Large (NL)”, and
“Around Zero (AZ)”, whose membership functions are given in
Fig. 1. For example, the membership function of fuzzy set PS
(Positive Small) is x

-3w -2w -w 0 w 2w 3w

Fig. 1: Membership functions of fuzzy sets Positive Small (PS), Positive


Medium (PM), Positive Large (PL), Negative Small (NS), Negative Medium
and for PL (Positive Large), the membership function is (NM), Negative Large (NL) and Around Zero (AZ).


SB SM SS N BS BM BB

where w is a positive constant. The value of w determines how


small is small, how medium is medium, and how large is large
when we use these words to describe the price changes. For
example, w =0.01 means that a change somewhere around 1%
from to (n>m) means “small” in the trader’s mind,
and, “medium” means around 2%, “large” means around and ed
above 3%. We will see later that w is an important parameter to
-0.4 -0.2 -0.1 0 0.1 0.2 0.4
shape the dynamics of the price changes.
Next, we define fuzzy sets to specify the meaning of the Fig. 2: Membership functions of fuzzy sets Buy Small (BS), Buy Medium
linguistic descriptions about the buy (sell) signals. Let ed be (BM), Buy Big (BB), Sell Small (SS), Sell Medium (SM), Sell Big (SB) and
the strength of the buy or sell signal, where ed stands for excess Neutral (N) for excess demand ed.
For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015. 4

With the fuzzy sets defined in Figs. 1 and 2, we can now (t=101 to t=500) were generated by the price dynamical model
convert Heuristic 1 into the following seven fuzzy IF-THEN (9). We see from Fig. 3 that although there is only one group of
rules which we call Rule 1 Group: traders who were using the same trading rules (7), the resulting
price dynamics were complex and chaotic. Comparing the
Rule 11: IF is Positive Small (PS), THEN is Buy Small (BS) random walk prices to with the fuzzy-rule-driven
Rule 12: IF is Positive Medium (PM), THEN is Buy Big (BB) prices to , we see that the big pictures look quite
similar for these two fundamentally different models: one is
Rule 13: IF is Positive Large (PL), THEN is Sell Medium (SM)
random and the other is deterministic.
Rule 14: IF is Negative Small (NS), THEN is Sell Small (SS) (7)
(m,n)=(1,5), w=0.01, a1=0.2
20
Rule 15: IF is Negative Medium (NM), THEN is Sell Big (SB)
15 random walk Rule 1 group
Rule 16: IF is Negative Large (NL), THEN is Buy Medium (BM)
10
Rule 17: IF is Around Zero (AZ), THEN is Neutral (N)

5
0 50 100 150 200 250 300 350 400 450 500
The meaning of these rules is explained as follows: Rule 11 and
Rule 12 (Rule 14 and Rule 15 ) follow the uptrend (downtrend), 20

Rule 13 (Rule 15) exits (enters) the stock when it is over-bought


15 random walk Rule 1 group
(over-sold), and Rule 17 takes no action if the price is
oscillating horizontally. Clearly, these rules do what Heuristic 1 10

suggests.
5
With Heuristic 1 being transformed into the fuzzy IF-THEN 0 50 100 150 200 250 300 350 400 450 500

rules in Rule 1 Group, our final task is to convert these rules 20

into the excess demand function. Using fuzzy logic principles


(Zadeh, 1973) and fuzzy systems theory (Zadeh , 1971; Wang, 15 random walk Rule 1 group

1997), we combine the seven fuzzy IF-THEN rules in Rule 1 10

Group (7) into the following standard fuzzy system:


5
0 50 100 150 200 250 300 350 400 450 500

Fig. 3: Three simulation runs of price generated by the random walk model
(10) (t=1 to t=100) and the Rule-1-Group-driven price dynamic model (9)
(t=101 to t=500) with (m,n)=(1,5), w=0.01 (1%), ,
where , , , , and .
, , are the fuzzy sets shown in Fig. 1, and
, , , , , We now make a few remarks about what to look for from the
, are the centers of the fuzzy sets BS, BB, SM, simulated price curves (Figs. 3 to 12). Why is technical analysis
SS, SB, BM and N shown in Fig. 2, respectively. Substituting so popular among traders? One explanation is that we humans
(8) into (1), we obtain the price dynamic equation: have a very good vision system, and price curves provide a very
convenient framework for our vision system. “A picture is
worth a thousand words.” The trading-heuristic-driven price
dynamic models proposed in this paper produce very complex
that shows how the price evolves if considering only the traders and chaotic price trajectories. In fact, whenever we made a new
who use Heuristic 1 (Rule 1 Group) as their trading strategy. simulation of the price dynamic model with randomly chosen
We now simulate the price dynamic equation (9) with initial condition, we got a totally different price series (the three
(m,n)=(1,5), w=0.01 (1%) and ; three simulation price trajectories in each Figs. 3 to 12 were chosen randomly
runs were performed and the resulting price series are from the simulations). This is consistent with the evolving
shown in Fig. 3, where the first 100 (t=1 to t=100) were market reality (Lo, 2004). Therefore, revealing specific
generated by the random walk model: characters of the models is not the main purpose of illustrating
these simulated price trajectories; rather, we would like to give
the reader the “big picture” or some “feeling” about what price
series the models would produce. This is quite different from
with being independent Gaussian random variables of mean our usual simulations for engineering systems where some
0 and variance 1, and ; the remaining fixed phenomenon occurs whenever and wherever we do the
For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015. 5

experiment. The detailed properties of the model will be


analyzed in Part II of this paper, where we will make some
concrete conclusions.

III. SUPPORT AND RESISTANCE RULES


and
Support and resistance are important reference points of past
prices that the technical traders are looking at when they make
buy or sell decisions. We first define support and resistance
points. A peak is the price such that and
, that is, a peak is a price point that is larger than its
two neighbors. A resistance point , defined as: respectively. Since we are only interested in breakup ( )
and breakdown ( ) in Heuristic 2, we define fuzzy sets
Positive Small (PS), Positive Medium (PM) and Positive Large
(PL) as shown in Fig. 1 for , and fuzzy sets Negative Small
is the highest peak in the time interval . Similarly,
(NS), Negative Medium (NM) and Negative Large (NL), also
a trough is the price such that and ,
shown in Fig. 1, for . With these fuzzy sets and those
and a support point , defined as:
defined in Fig. 2 for the buy (sell) actions, we translate
Heuristics 2 into the following six fuzzy IF-THEN rules which
we call Rule 2 Group:

is the lowest trough in the time interval . When Rule 21: IF is Positive Small (PS), THEN is Buy Small (BS)
the n in (11) and (12) are set equal to the current time t, the Rule 22: IF is Positive Medium (PM), THEN is Buy Big (BB)
resistance (support) point is the highest peak (lowest trough) in
Rule 23: IF is Positive Large (PL), THEN is Sell Medium (SM)
the entire history of the price.
The basic philosophy of the technical trading rules based on Rule 24: IF is Negative Small (NS), THEN is Sell Small (SS) (15)
support and resistance points is that the support (resistance) Rule 25: IF is Negative Medium (NM), THEN is Sell Big (SB)
point is the lowest (highest) price in recent history where the
Rule 26: IF is Negative Large (NL), THEN is Buy Medium (BM)
buyers (sellers) were becoming stronger than the sellers
(buyers), so that if this support (resistance) price is broken, then
a downtrend (uptrend) might be establishing. So we have the Combining these rules into a standard fuzzy system we get
following heuristic:

Heuristic 2: A buy (sell) signal is generated if the current


price breaks the resistance (support) point
from below (above). The buy (sell) signal is weak if the where , , ,
breakup (breakdown) is small because a small breakup , , , are the fuzzy sets shown in
(breakdown) often ends up with a throwback (pullback). When Fig. 1, and , , , ,
the breakup (breakdown) becomes reasonably large, the trend is
, are the centers of the fuzzy sets BS, BB, SM, SS,
more or less confirmed so that a strong buy (sell) is
SB, BM shown in Fig. 2, respectively. This is
recommended. If the breakup (breakdown) is too large, the
stock may be over-bought (over-sold), so a small sell (buy) the excess demand function from all traders who use Heuristic
order should be placed to prepare for a possible reversal. 2 (Rule 2 Group) as their trading strategy.
Substituting of (8) and of (16)
We now convert this trading heuristic into excess demand into the general model (1), we obtain the price dynamic
function using fuzzy systems theory, similar to what we equation
did in the last section. Define the log-ratios of the current price
to the resistance point and the support point
as
For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015. 6

which shows how the price changes when two groups of traders points and traders were jumped in to catch up the trends, which
are trading in the time interval (t,t+1), where one group of caused the jumps in price. Fig. 5 shows three simulation runs of
traders use Rule 1 Group (7) and the other use Rule 2 Group the price dynamic equation:
(15). Fig. 4 shows the price for three simulation runs with
parameters (m,n)=(1,5), n*=100, w=0.01, and
, where the first 100 (t=1 to t=100) were generated
by the random walk model (10) with and , with parameters n*=100, w=0.01, , and
and the remaining (t=101 to t=500) were generated by the , where the first 100 prices come from the pure random
price dynamic model (17). walk model (10) and the remaining prices are generated by (18).
Comparing the price trajectories in Figs. 3 and 4 we see that From Fig. 5 we see that there are indeed many jumps in the
there were some big jumps when Rule 2 Group was added. prices and these jumps are caused by the in (18).
These jumps occurred when the prices crossed the support or
n*=100, w=0.01, a2=0.5
resistance lines. 30

25
(m,n)=(1,5), n*=100, w=0.01, a1=0.2, a2=1
30
20 random walk random walk + Rule 2 group
25 15

10
20 random walk Rule 1+2 groups
15 5
0 50 100 150 200 250 300 350 400 450 500
10

5
30
0 50 100 150 200 250 300 350 400 450 500
25

30 20 random walk random walk + Rule 2 group


25 15

20 random walk Rule 1+2 groups 10

15 5

10 0 50 100 150 200 250 300 350 400 450 500

5
0 50 100 150 200 250 300 350 400 450 500 30

25

30 20 random walk random walk + Rule 2 group


25 15
20 random walk Rule 1+2 groups 10
15
5
10 0 50 100 150 200 250 300 350 400 450 500

5
0 50 100 150 200 250 300 350 400 450 500

Fig. 5: Three simulation runs of price generated by the random walk model
(10) (t=1 to t=100) and the random walk plus Rule-2-Group model (18) (t=101
Fig. 4: Three simulation runs of price generated by the random walk model to t=500) with n*=100, w=0.01, , and .
(10) (t=1 to t=100) and the Rule-1-plus-Rule-2-Group-driven price dynamic
model (17) (t=101 to t=500) with (m,n)=(1,5), n*=100, w=0.01, ,
, and .
Another trading heuristic related to support and resistance
points concerns the traders who missed the buying (selling)
We know that the real stock prices exhibit jumps that the opportunity at the last low (high) price. These traders have a
random walk model cannot capture. The mathematical finance strong tendency to buy (sell) when the price is getting around
literature dealt with this problem by adding a jump random the support (resistance) point once again; this gives us the
process to the random walk model (10) (e.g. Merton, 1976) or following heuristic:
by modeling the volatility as a random variable (e.g.
Bollerslev, Chou and Kroner, 1992; Bouchaud and Potters, Heuristic 3: For those traders who felt regret to miss the
2003; Fouque, Papanicolaou and Sircar, 2000). The problem of buying (sell) opportunity at the last low (high) price, the chance
these random approaches is that they cannot explain why the comes again when the price is getting around the support
jumps occurred at those particular locations. So it will be (resistance) point one more time, so buy (sell) medium (not big
interesting if we can show that jumps occur when we add the because the price may break across the support (resistance) line
excess demand of Rule 2 Group to the random walk model this time, and not small because you don’t want to miss this
(10), because in so doing we can explain why the jumps opportunity too much).
occurred at those particular locations: the reason is that the
previous support or resistance lines were broken at these time
For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015. 7

This heuristic is transformed into the following Rule 3 IV. TREND LINE RULES
Group:
Trend lines are lines that connect peaks or troughs and extend
Rule 31: IF is Around Zero (AZ), THEN is Sell Medium (SM) into the future. There are two types of trend lines: uptrend line
and downtrend line. An uptrend (downtrend) line is established
Rule 32: IF is Around Zero (AZ), THEN is Buy Medium (BM) (19)
if the line connecting the troughs (peaks) is pointing upwards
(downwards). More specifically, let and (
and the excess demand function from the Rule-3-Group traders
is the following fuzzy system: and ) be the two lowest (highest) troughs (peaks) in the
time interval [t-n, t-1] with t1<t2, i.e.,

where ( , are defined in (13),


(14)), and AZ, SM and BM are shown in Figs. 1 and 2 (0.2 and
-0.2 in (20) are the centers of BM and SM, respectively).
Adding all three excess demand functions (8), (16)
and (20) to the general model (1) and simulating the
resulting price dynamic equation, we got Fig. 6 where the where min2 (max2) means “take the two smallest (largest)”,
parameters were chosen as: (m,n)=(1,5) in , the n’s in and t1, t2 (t1<t2) are the time points at which these two lowest
and equal n*=100, w=0.01, and , (highest) prices are located. If ,
and here again the first 100 were generated by the random
then the line connecting and ( and ) is
walk model (10) with and , and the
pointing upwards (downwards), so an uptrend line is
remaining (t=101-500) were generated by the price dynamic
constructed as
equation (1) with M=3.

(m,n)=(1,5), n*=100, w=0.01, a1=0.2, a2=a3=1


30

25

20 random walk Rule 1+2+3 groups


15

10

5
0 50 100 150 200 250 300 350 400 450 500

where , and a downtrend line is


30

25

20 random walk Rule 1+2+3 groups


15

10

5
0 50 100 150 200 250 300 350 400 450 500

30

25

20 random walk Rule 1+2+3 groups where , time t is the horizontal-axis and
15
price is the vertical-axis.
10

5
The basic logic behind the trading heuristics related to trend
0 50 100 150 200 250 300 350 400 450 500 lines is that it is usually difficult to break through a trend line
because the existence of a trend line means that a trend has
already been in place, so a breakdown (breakup) across the
Fig. 6: Three simulation runs of price generated by the random walk model
(10) (t=1 to t=100) and the price dynamic model (1) (t=101 to t=500) with the uptrend (downtrend) line will most likely end up with a
three excess demand functions , and from Rule 1, Rule 2 and Rule pullback (throwback). This gives the following heuristic:
3 Groups.
Heuristic 4: If the current price is getting closer to an
uptrend (downtrend) line from above
For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015. 8

(below), a buy (sell) order should be placed to bet on the


(m,n)=(1,5), n*=100, w=0.01, a1=0.2, a4=1
continuation of the uptrend (downtrend). 30

25

20 random walk Rule 1+4 groups


Define
15

10

5
0 50 100 150 200 250 300 350 400 450 500

30

25

20 random walk Rule 1+4 groups


15

10

5
0 50 100 150 200 250 300 350 400 450 500

30

25

20 random walk Rule 1+4 groups


and Heuristic 4 becomes the following Rule 4 Group: 15

10

Rule 41: IF is Positive Small (PS), THEN is Buy Medium (BM) 5


0 50 100 150 200 250 300 350 400 450 500
Rule 42: IF is Negative Small (NS), THEN is Sell Medium (SM) (27)

Fig. 7: Three simulation runs of price generated by the random walk model
The excess demand function from the Rule-4-Group traders is (10) (t=1 to t=100) and the price dynamic model (1) (t=101 to t=500) with the
the following fuzzy system: two excess demand functions and from Rule 1 and Rule 4 Groups.

amount, then a trend reversal may have been happening so that


a small to large sell (buy) order is recommended.

This heuristic is transformed into the following Rule 5


where , and are Group:
the membership functions of the fuzzy sets PS and NS shown in
Fig. 1, and 0.2 and -0.2 are the centers of the fuzzy sets BM and Rule 51: IF is Negative Medium (NM), THEN is Sell Small (SS)
SM shown in Fig. 2. Rule 52: IF is Negative Large (NL), THEN is Sell Big (SB) (29)
Fig. 7 shows three simulation runs of the Rule-1+4-Groups
Rule 53: IF is Positive Medium (PM), THEN is Buy Small (BS)
case with parameters (m,n)=(1,5), n*=100, w=0.01,
, and , where the first 100 Rule 54: IF is Positive Large (PL), THEN is Buy Big (BB)

prices came from the pure random walk model (10) and the
remaining prices were generated by (1) with all other ’s and the excess demand function from the Rule-5-Group traders
except and equal to zero. Comparing Fig. 7 with is the following fuzzy system:
Fig. 3, we see that more trending happened when the
Rule-4-Group traders were added. Originally the Rule-4-Group
traders just anticipate that a trend may be coming and act
according to their guess, but their actions cause the trend to
really happen; this is self-fulfilling, a typical phenomenon in
real markets.
Another trading heuristic related to trend lines is about trend
reversal. Experience has shown that if an established trend line
was broken by a relatively large amount, then the trend might where or ( and are defined in
have been reversed. This gives the following trading heuristic: (25) and (26)), PM, PL, NM and NL are fuzzy sets shown in Fig.
1, and 0.1, 0.4, -0.1 and -0.4 are the centers of fuzzy sets BS,
Heuristic 5: If the current price is under (above) the uptrend BB, SS and SB shown in Fig. 2, respectively.
(downtrend) line for a medium to large Fig. 8 shows three simulation runs of the Rule-1+5-Groups
case with parameters (m,n)=(1,5), n*=100, w=0.01,
, and , where the first 100
For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015. 9

prices came from the pure random walk model (10) and the Rule 61: IF is Positive Small (PS), THEN is Sell Small (SS)
remaining prices were generated by (1) with all other ’s Rule 62: IF is Positive Medium (PM), THEN is Sell Medium (SM)
except and equal to zero. Again we see
Rule 63: IF is Positive Large (PL), THEN is Sell Big (SB) (31)
self-fulfilling phenomenon in Fig. 8: the big jumps in prices
were generated by the Rule-5-group traders who took actions to Rule 64: IF is Around Zero (AZ), THEN is Neutral (N)
anticipate the end of the old trends and these actions ended the
old trends. and Heuristic 7 into the following Rule 7 Group:
(m,n)=(1,5), n*=100, w=0.01, a1=0.2, a5=1
30 Rule 71: IF is Negative Small (NS), THEN is Buy Small (BS)
25
Rule 72: IF is Negative Medium (NM), THEN is Buy Medium (BM)
20 random walk Rule 1+5 groups
15
Rule 73: IF is Negative Large (NL), HEN is Buy Big (BB) (32)
10

5 Rule 74: IF is Around Zero (AZ), THEN is Neutral (N)


0 50 100 150 200 250 300 350 400 450 500

30 The excess demands and from Rule 6 Group and Rule


25
7 Group are
20 random walk Rule 1+5 groups
15

10

5
0 50 100 150 200 250 300 350 400 450 500

01 PS
02 PM
0 PL
30

25
PS PM PL AZ
20 random walk Rule 1+5 groups
15

10 where and
5
0 50 100 150 200 250 300 350 400 450 500

Fig. 8: Three simulation runs for the case of Rule-1-Group plus Rule-5-Group.

V. BIG BUYER, BIG SELLER AND MANIPULATOR RULES


where , respectively. Figs. 9 and 10 show three
Big buyers and big sellers are institutional traders who manage
simulation runs of the Rule-1+6-Groups and Rule-1+7-Groups
large sums of money and usually want to buy or sell a large
cases, respectively, with parameters (m,n)=(1,5), w=0.01,
amount of stocks. Since the amount of stocks offered or asked
, and ,
around the trading price is usually very small, the large buy or
where the first 100 prices came from the pure random walk
sell order has to be cut into small pieces and implemented
model (10) and the remaining prices were generated by (1).
incrementally over a long period of time (Bouchaud, Farmer
From Fig. 9 (Fig. 10) we see that the prices are in a general
and Lillo, 2008; Aldridge, 2013). A reasonable strategy for a
declining (rising) mode when the big sellers (buyers) are
big buyer (seller) is to buy (sell) if the price is decreasing
presented, although the big sellers (buyers) sell (buy) only
(increasing); this gives us the following heuristics: Heuristic 6
when the price is increasing (decreasing).
for big sellers, and Heuristic 7 for big buyers:
The study of trading behavior cannot be complete without
Heuristic 6: For a big seller, sell if the price of the stock is considering a very important market force: the manipulators.
increasing: the stronger the increase, the larger the sell order. Manipulators are big capitalized traders who use
Keep neutral if the price is decreasing or moving horizontally. pump-and-dump (Bradshaw, Richardson and Sloan, 2003),
spoofing3, layering3 (Kirilenko and Lo, 2013) or other
Heuristic 7: For a big buyer, buy if the price of the stock is
decreasing: the larger the decrease, the larger the buy order. 3
“Spoofing” involves intentionally manipulating prices by placing an order
Keep neutral if the price is increasing or moving horizontally. and then canceling it shortly thereafter, at which point the spoofer
consummates a trade in the opposite direction of the canceled order. “Layering”
involves placing a successive sequence of limit orders to give the appearance of
With defined in (3) and the fuzzy sets in Figs. 1 and 2, a change in demand or supply; after a trade is consummated at the manipulated
we translate Heuristic 6 into the following Rule 6 Group: price, the layered limit orders are canceled.
For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015. 10

the order book) to attract the attention of trend-followers; and in


(m,n)=(1,5), w=0.01, a1=0.2, a6=0.02
30 Phase 3 the manipulator trades like a big seller using Heuristic 6,
25
i.e., selling the stocks collected in Phase 1 around the new
20 random walk Rule 1+6 groups
15
higher prices. Although manipulation is illegal in all stock
10 markets (Kyle and Viswanathan, 2008), it is common practice
5
in almost all markets around the world for hundreds of years
0 50 100 150 200 250 300 350 400 450 500
(Leinweber and Madhavan, 2001).
30

25 15

20 random walk Rule 1+6 groups


Phase 3: manipulator = big seller
15

10 14

5
0 50 100 150 200 250 300 350 400 450 500

13

30

25

20 random walk Rule 1+6 groups 12


Phase 2: manipulator = clear the ask-side of order book
15

10

5 11

0 50 100 150 200 250 300 350 400 450 500


Phase 1: manipulator = big buyer

10

Fig. 9: Three simulation runs for the case of Rule-1-Group plus Rule-6-Group
(big sellers).
9
0 50 100 150 200 250 300 350 400 450 500

(m,n)=(1,5), w=0.01, a1=0.2, a7=0.02


30

25 Fig. 11: A typical operation cycle of manipulators: the pump-and-dump


20 random walk Rule 1+7 groups process.
15

10
Since the manipulator trades like a big buyer (seller) in Phase
5
0 50 100 150 200 250 300 350 400 450 500 1 (Phase 3), the excess demand function equals ( ) in
these phases. For Phase 2 (the pushing-up phase), the strategy is
30

25
the following treading heuristic:
20 random walk Rule 1+7 groups
15 Heuristic 8: Buy the stock with big money within very short
10
time to clear the ask (sell) side of the order book quickly.
5
0 50 100 150 200 250 300 350 400 450 500
which, when expressed in terms of fuzzy IF-THEN rules, is the
30
following Rule 8 Group:
25

20 random walk Rule 1+7 groups


Rule 8: Whatever the ’s are, the is Buy Big (BB) (35)
15

10

5 Putting these three phases together, we obtain the following


0 50 100 150 200 250 300 350 400 450 500
excess demand function for the manipulator:

Fig. 10: Three simulation runs for the case of Rule-1-Group plus Rule-7-Group
(big buyers).

01 NS
02 NM
0 NL
strategies (Leinweber and Madhavan, 2001; Fan, 2010; Jiang,
2013) to move the price up or down very quickly to create a NS NM NL AZ
mood of optimistic or fear as a trap for other traders. Fig. 11
illustrates a typical working cycle of the pump-and-dump 01 PS
02 PM
0 PL
process: in Phase 1 the manipulator trades like a big buyer using
PS PM PL AZ
Heuristic 7, i.e., collecting a large sum of stocks at relatively
(36)
low prices; in Phase 2 the manipulator uses strong capital to
push the stock price up very quickly (by clearing the ask-side of
For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015. 11

where in Phase 1 and in Phase 3. Fig. 11 which, when combined into a fuzzy system, give the following
is in fact a simulation run of (1) with and , where Phase excess demand function:
2 is from t=200 to t=220.

VI. BAND AND STOP RULES


01
Bands are envelopes around a moving average with variable
size. The basic idea of using bands is that since most prices are
contained within the band, a breakout across the boundaries of
the band is an indication of the start of a new trend. The most
widely used band is the Bollinger Band (Bollinger, 2002) that where or . Fig. 12 shows
adds and subtracts the moving estimate of two standard three simulation runs of the random walk plus Rule-9-Group
deviations of returns to a moving average. Specifically, let model:

with n=5, w=0.01, , and , where the


be the return and assume the returns are zero-mean; the moving
first 100 prices came from the random walk model (10) and the
estimate of the standard deviation of the returns is
remaining prices were generated by (43). We see again the
self-fulfilling phenomenon: more trending occurred in the
model (43) part than in the pure random walk part in Fig. 12,
due to the actions for the anticipation of the new trends after the
price broke out the band and these actions themselves caused
The upper and lower boundaries of the Bollinger Band are the trends.
and , respectively, where is the n=5, w=0.01, a9=0.2
30
price moving average defined in (2). The trading heuristic 25

based on the Bollinger Band is the following: 20 random walk random walk + Rule 9 group
15

Heuristic 9: When the price is moving out of the Bollinger 10

5
Band , it is a sign of the start of a 0 50 100 150 200 250 300 350 400 450 500

new trend, so a buy (if the price is above the Band) or sell (if the 30
price is below the Band) order should be in place. 25

20 random walk random walk + Rule 9 group


Define 15

10

5
0 50 100 150 200 250 300 350 400 450 500

ln
30

25

20 random walk random walk + Rule 9 group


15

10

ln 0 50 100 150 200 250 300 350 400 450 500

Fig. 12: Three simulation runs of random walk plus Rule-9-Group model (43).

then Heuristic 9 becomes the following Rule 9 Group:


If you asked an investment expert what is the most important
Rule 91: IF is Positive Small (PS), THEN is Buy Small (BS)
element in an investment system, the answer would very likely
be: stops. Indeed, making profits is not harmful, whether it is
Rule 92: IF is Positive Medium (PM), THEN is Buy Big (BB)
big or small, but you must protect your portfolio from large
Rule 93: IF is Negative Small (NS), THEN is Sell Small (SS) (41) losses. There are usually two types of stops people use to
Rule 94: IF is Negative Medium (NM), THEN is Sell Big (SB) protect their capital: protective stops that set hard limits to the
For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015. 12

maximum losses allowed and clear the position when the hard If the denominator of (45) equals zero, then . The
limits are reached, and trailing stops that protect profits from final excess demand function from Rule-10-Group is the
deteriorating back into a loss. There are many types of weighted average of the ’s with weights :
protective and trailing stops, such as Hard Money Stops,
Breakeven Stops, Technical Point Stops, Volatility Stops,
Trend Line Stops, Adaptive Stops, Time Stops, Signal Stops,
etc. (Kirkpatrick and Dahlquist, 2011). The following heuristic
summarizes a typical protective stop and a typical trailing stop:

Heuristic 10: Protective Stop: If a position has a loss


approaching 20% and more, it means something was seriously
wrong in our previous analysis when we purchased the stock, so
where meaning that the amount of this stock in
the position should be quit as soon as possible. Trailing Stop: If
a position has accumulated good profits and the price has the portfolio is non-zero.
dropped around 10% or more from the recent high, then the
position should be quit gradually to cash out the profits. VII. VOLUME AND STRENGTH RULES

The rules in the last five sections used only the past price
To translate Heuristic 10 into fuzzy IF-THEN rules, let
information of the same stock. In this section we consider the
be the amount of a stock in the portfolio purchased at price trading rules that use not only its own past prices but also other
( ) and max be the information such as volume and the prices of other stocks in the
maximum of the last n prices of the stock. Then Heuristic 10 market. Since the key of technical trading is “follow the trend”,
becomes the following Rule 10 Group: the indicators considered in this section are used to confirm a
trend or to give early warning for a possible trend reversal.
Rule 101: IF is Not Around Zero ( and is Negative Large We start with volume. A useful volume indicator is the
(NL), THEN is Sell Big (SB) on-balance volume defined as follows:
Rule 102: IF is Not Around Zero ( and is Positive (P)

and is Negative Large (NL), THEN is Sell Big (SB)


Rule 103: IF is Around Zero ( , THEN is Neutral (N) (44) where is the traded volume of the stock from t-1 to t and
is the sign function that equals 1 if
, equals -1 if and equals 0 if
where P is the union of PS, PM and PL, is the complement
. The on-balance volume is a measure of the
of , and the parameter w in the NL’s (see Fig. 1) of Rule 101
accumulated money inflow into the stock. Therefore it is an
and Rule 102 are set to 10% and 5%, respectively. Combining
early warning of trend reversal if the trend of price and the
the three rules of (44), we obtain the following excess demand
trend of are in opposite directions; this gives the
function for the stocks purchased at price :
following trading heuristic:

Heuristic 11: If the price is in an uptrend (downtrend) but


the on-balance volume is in a downtrend (uptrend), then
as soon as the price shows a small sign of decreasing
(increasing), a sell (buy) is recommended to bet on the reversal
of the price trend.

Similar to the variables defined in constructing the price


trend lines in (21)-(24), we define

min2
For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015. 13

Lastly, we consider the trading heuristics concerning how a


stock performs comparing to the whole market. Let be
some index that measures the overall performance of the
market, e.g., it could be the S&P500 for the US stock market or
the Shanghai&Shenzhen 300 for China stock market. The
to be the two lowest (highest) troughs (peaks) of the in
relative strength of a stock with price is defined as
the time interval [t-n, t-1], where t1, t2 (t1<t2) are the time
points at which these two lowest (highest) are located.
Let

If is rising (declining), it means the stock outperforms


(underperforms) the market average. Since the market has the
tendency of stronger getting stronger and weaker getting
weaker (Jegadeesh and Titman, 1993), a breakup (breakdown)
of the downtrend (uptrend) line, if accompanied by a rising
(declining) , is a strong sign of trend reversal. This gives us
the following trading heuristic:
be the slopes of the lines connecting to and
to , respectively, we can now transform Heuristic 12: If the price is in an uptrend (downtrend) but its
Heuristic 11 into the following Rule 11 Group: relative strength is in a downtrend (uptrend), then as soon
as the price shows a small sign of decreasing (increasing), a sell
Rule 111: IF is NS and is Negative (N), THEN is SM (buy) is recommended to leave (enter) this weak (strong) stock.
Rule 112: IF is PS and is Positive (P), THEN is BM (52)
Define the log-ratio of to its n-leg moving average as
where the fuzzy set Negative (Positive) is the union of the fuzzy
sets NS, NM and NL (PS, PM and PL) with membership
function ( ). ln
Recalling the definition of and in (25) and (26), we
see that “ is NS” means “the price has just broken the
Heuristic 12 gives the following Rule 12 Group:
uptrend line from above” and “ is PS” means “the price has
just broken the downtrend line from below”. Furthermore, Rule 121: IF is NS and is Negative (N), THEN is SM
“ is N” (“ is P”) confirms the breakdown (breakup) so Rule 122: IF is PS and is Positive (P), THEN is BM (56)
that Sell Medium (Buy Medium) is executed. The excess
demand function from the Rule-11-Group traders is the and its excess demand function is
following fuzzy system:
=

02 PS P
02 NS N

PS P NS N
where if the denominator of (57) equals zero. The
If the denominator of (53) equals zero, then . price dynamics driven by can be simulated if we consider
Since volume data are not available for our price models (it is a multi-stock simulation model; however, we will leave it to
our current research topic to build dynamical models for another paper concentrating on this very important topic:
volumes based on technical trading rules), we will not perform interactions among multiple stocks.
simulations for Rule 11 Group. For real stocks where volume
data are available, the Rule-11-Group rules can be incorporated VIII. CONCLUDING REMARKS
into the price dynamic model (1) in the same manner as the
rules in other groups. Stock prices are generated by the actions of stock traders, and
according to a survey of 692 fund managers in five countries
For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015. 14

(Menkhoff, 2010), the vast majority of the fund managers rely The price dynamical models proposed in this paper are
on technical analysis4. The main contribution of this paper is to totally deterministic, so a natural question is how these models
build a bridge between the fuzzy, linguistic world of technical compare with the mainstream stochastic models that provide
analysis and the rigorous, mathematical world of nonlinear measures of unpredictable uncertainties 6 ? To answer this
dynamic equations, as illustrated in Fig. 13. In Part I of this question, let’s see how the mainstream stochastic models
paper, we developed the details of transforming twelve handle the unpredictable uncertainties: these models usually
common trading heuristics into nonlinear dynamical equations have a simple deterministic part (linear or simple ad-hoc
and simulated these models to illustrate how simple technical nonlinear functions of state variables), and leave the real
trading rules can produce complex price patterns. There have important part of the (unknown) dynamics to the noise term
been a huge number of technical trading rules accumulated (representing unpredictable uncertainties); then, they assume
during the long history of technical analysis (Lo and that the noise term is zero-mean and i.i.d. (or make other
Hasanhodzic, 2010) and more rules are being proposed comparable assumptions in order for the mathematics to march
constantly to adapt to the evolving market conditions5; by using forward beautifully). We know a key characteristic of financial
the methods of this paper we can transform these linguistic systems is evolving (time-varying, non-stationary7; Lo, 2004).
descriptions of trading wisdoms into dynamical equations and How can one faithfully assume a key part of an evolving,
observe exactly what price trajectories and patterns these non-stationary dynamics (the unpredictable uncertainties) to be
heuristic rules can produce. Furthermore, these dynamical zero-mean (a time-invariant constant)? Furthermore, the i.i.d.
equations allowed us to study the price dynamics generated by assumption implies that the traders are drunkards (Malkiel,
the technical trading rules in a mathematically rigorous fashion 2012) --- the move in one step has no relation to the moves of
(as we will do in Part II of this paper) and push technical the previous steps. Real traders are betting in real money, they
analysis forward in the direction from an art to a science. are serious, they are watching the evolving markets closely and
Practically, these models provide us a framework to detect the making decisions accordingly, they are socially connected and
hidden operations in the market so that trading strategies can be influence each other, and they are not some random noise from
developed to beat the benchmark Buy-and-Hold strategy (as we the background as in an electronic circuit model. So, we will
will do in Part III of this paper). ultimately have to roll up our sleeves to dig deep into the origin
of the price formation machine 8 to build a deterministic,
Technical analysis Dynamical systems theory cause-effect model for the key dynamics; the models proposed
(fuzzy, linguistic world) Fuzzy systems (precise, mathematical world)
in this paper are a trial in this direction.
The main difference between Natural Sciences and Social
Trend following; Equilibrium; Sciences is that we know the basic laws governing the motions
Contrarian; Stability; of the objects in Natural Sciences such as the Newton’s Laws,
Stop-loss; Lyapunov exponent; whereas the basic objects in Social Sciences are human beings
Band rules; Strange attractors;
and we do not have the “Newton’s Laws for human subjects.”
That is, we lack a deep underpinning for understanding the
Oscillators; Fractal dimensions;
mechanisms at the origin of the dynamical behavior of financial
Pattern rules; Emergence;
markets (Mirowski, 1989; Kirman, 1989; Malevergne and
Sornette, 2006). Our current stage of understanding social
systems is quite similar to “the blind monks touching the
elephant”. In our pursuit for the basic laws of stock markets, we

6
“The human brain is wonderful at spotting patterns. It's an ability that is one
Fig. 13: The “main story” this paper is trying to tell: A bridge is being built
of the foundation stones of science. When we notice a pattern, we try to pin it
across the gulf between the fuzzy, linguistic world of technical analysis which
down mathematically, and then use the maths to help us understand the world
is rich in trading wisdom on one side and the precise, mathematical world of
around us. And if we can't spot a pattern, we don't put its absence down to
dynamical systems theory which is rich in rigorous tools on the other side.
ignorance. Instead we fall back on our favourite alternative. We call it
randomness.” --- Ian Stewart (Stewart, 2004).
7
4
Traders come and go (Foucault, Pagano and Roell, 2013), and different
More specifically, for the forecasting horizon of weeks, the relative traders use different trading strategies, which results in different price patterns
importance is 29.4 for Technical Analysis, 28.4 for Order Flow, and 1.4 for at different time points, meaning that the returns are non-stationary.
8
Fundamental Analysis for US fund managers; for German fund managers, By which we mean both the mechanical setup of the limit order book
these numbers are 60 for Technical Analysis, 22.6 for Order Flow, and 6.7 for dynamics (Gould, Porter, Williams, McDonald, Fenn and Howison, 2013;
Fundamental Analysis; see Fig. 2 in Menkhoff 2010 for more data. Bouchaud, Farmer and Lillo, 2008; Cont, Kukannov and Stoikov, 2014) and the
5
According to Schmidt 2011, a search on Amazon.com using the key words investors’ mindset (Keynes, 1935; Graham, 1973; Lynch, 1989; Soros, 2003;
technical analysis for new books that were printed between January 2001 and etc.) including their “obstinate passion” for technical analysis (Menkhoff and
September 2010 yielded 468 entries --- roughly one new book every week. Taylor, 2007).
For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015. 15

should listen carefully to what the real traders say about their price dynamics, which is what we are going to do in Part II of
crafts (e.g. Livermore, 1940; Lynch, 1989; Soros, 2003; this paper (Part II can be found at arXiv:1401.1891), next.
Lindsey and Schachter, 2007; Lo and Hasanhodzic, 2009),
because human traders are the “atoms of stock markets.” As Participating function
one of the most successful speculators in modern finance,
George Soros has a Theory of Reflexivity which, in his own
words (page 2 of Soros, 2003), is described as follows:

The concept of reflexivity is very simple. In a M (t )


situations that have thinking participants, there is a
two-way interaction between the participant’s ln( pt )
thinking and the situation in which they  Delay
participate. On the one hand, participants seek to
understand reality; on the other hand, they seek to
bring about a desired outcome. The two functions
a1(t)
work in opposite directions: in the cognitive Reflexivity
function reality is the given; in the participating
Other information
function, the participants’ understanding is the
constant. The two functions can interfere with
ed1
each other by rendering what is supposed to be Rule-1-Group traders
given, contingent. I call the interference between
the two functions “reflexivity.”
Other information
To represent our price dynamical model (1) in the framework
of Soros’s Reflexivity Theory, we plot the block diagram of ed M
Rule-M-Group traders
model (1) in Fig. 14, where we view the excess demand of
each trader group as the cognitive function in Soros’s
reflexivity theory and the time-varying relative strength
as the participating function. According to the concept of
reflexivity cited above, the input to the cognitive function Cognitive function
is the reality --- the price history and other information, and the
output is which can be viewed as the dollar amount to trade Fig. 14: The block diagram representation of the price dynamical model (1)
the stock: a positive means to buy the stock with with interpretation of the function blocks in terms of George Soros’s Theory of
Reflexivity.
dollars, and a negative means to sell the stock to cash out
| | dollars. The impact of the dollar amount on the price ACKNOWLEDGMENT
dynamics is through the participating function whose
The author would like thank the anonymous reviewers for
exact value cannot be specified by the Rule-i-Group traders
their very insightful and inspiring comments that helped to
alone, because the impact depends on the actions of other improve the paper.
traders that are beyond the control of the Rule-i-Group traders.
In this framework, reflexivity means the interference between REFERENCES
and the internal mechanism of --- the fuzzy trading
rules and their parameters m, n and w; this gives us some hints [1] Aldridge, I., High-Frequency Trading: A Practical Guide to Algorithmic
Strategies and Trading Systems (2nd Edition), John Wiley & Sons, Inc.,
for possible directions of future research.
New Jersey, 2013.
Indeed, in Part III of this paper we will develop two trading [2] Andersen, T.G., T. Bollerslev and F.X. Diebold, “Parametric and
strategies --- Follow-the-Big-Buyer and Ride-the-Mood --- Nonparametric Volatility Measurement,” in Y. Ait-Sahalia and L.P.
based on the estimation of the ’s and test the strategies Hansen (ed.), Handbook of Financial Econometrics: Tools and
Techniques, Vol. 1, pp. 67-138, Elsevier: North-Holland, 2010.
over the top 20 blue-chip stocks in the Hong Kong Stock
[3] Atsalakis, G. and K. Valavanis, “Surveying Stock Market Forecasting
Exchange to show the superior performance of these trading Techniques - Part II: Soft Computing Methods,” Expert Systems with
strategies over the benchmark Buy-and-Hold strategy (Part III Applications 36: 5932-5941, 2008.
can be found at arXiv:1401.1892). But before we do this, we [ ] Bachelier, L., “Theorie de la speculation.” Thesis. Annales Scientifiques
de l’Ecole Normale Superieure, 1990. III-17, 21-86. Translated by
would better first analyze the price dynamical model (1) in
Cootner (ed.) as “Random character of Stock Market Prices.”
detail to get a basic understanding for the key properties of the (Massachusetts Institute of Technology, 1964: 17-78).
[5] Black, F. and M. Scholes, “The Pricing of Options and Corporate
Liabilities,” Journal of Political Economy 81: 637-659, 1973.
For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015. 16

[6] Bollerslev, T., R.Y. Chou and K.F. Kroner, “ARCH Modeling in Finance: [31] Kirilenko, A.A. and A.W. Lo, “Moore’s Law versus Murphy’s Law:
A Review of the Theory and Empirical Evidence,” Journal of Algorithmic Trading and Its Discontents,” Journal of Economic
Econometrics 52: 5-59, 1992. Perspectives, 27: 51-72, 2013.
[7] Bollinger, J., Bollinger on Bollinger Bands, McGraw-Hill, New York, [32] Kirkpatrick, C.D. and J. Dahlquist, Technical Analysis: The Complete
2002. Resource for Financial market Technicians (Second Edition), Pearson
[8] Bouchaud, J.P., D. Farmer and F. Lillo, “How Markets Slowly Digest Education, New Jersey, 2011.
Changes in Supply and Demand,” in T. Hens, K. Schenk-Hoppe, eds., [33] Kirkpatrick, C.D. and J. Dahlquist, Study Guide for the Second Edition of
Handbook of Financial Market: Dynamics and Evolution, Elsevier: Technical Analysis: The Complete Resource for Financial market
Academic Press: 57-160, 2008. Technicians, Pearson Education, New Jersey, 2013.
[9] Bouchaud, J.P. and M. Potters, Theory of Financial Risks: From Statistical [34] Kyle, A.S., “Continuous Auction and Insider Trading,” Econometrica53:
Physics to Risk Management (2nd Edition), Cambridge University Press, 1315-1335, 1985.
Cambridge, 2003. [35] Kyle, A.S. and S. Viswanathan, “Price Manipulation in Financial
[10] Bradshaw, M.T., S.A. Richardson and R.G. Sloan, “Pump and Dump: An Markets: How to Define Illegal Price Manipulation,” American Economic
Empirical Analysis of the Relation Between Corporate Financing Review 98:2, 274-279, 2008.
Activities and Sell-side Analyst Research,” SSNR 410521, 2003. [36] LeBaron, B., S.H. Chen and S. Sunder, “The Future of Agent-Based
[11] Brock, W.A. J. Lakonishok and B. LeBaron, “Simple Technical Trading Research in Economics: A Panel Discussion,” Eastern Economic Journal
Rules and the Stochastic Properties of Stock Returns,” Journal of Finance 34: 550-565, 2008.
47: 1731-1764, 1992. [37] Leinweber, D.J. and A.N. Madhavan, “Three Hundred Years of Stock
[12] Cont, R., A. Kukannov and S. Stoikov, “The Price Impact of Order Book Market Manipulations,” The Journal of Investing 10: 7-16, 2001.
Events,” J. Financial Econometrics 12: 47-88, 2014. [38] Lindsey, R.R. and B. Schachter, How I Became a Quant: Insights From
[13] Elton, E.J., M.J. Gruber, S.J. Brown and W.N. Goetzmann, Modern 25 of Wall Street’s Elite, John Wiley & Sons, New Jersey, 2007.
Portfolio Theory and Investment Analysis (7th Edition), John Wiley & [39] Livermore, J., How to Trade in Stocks, (McGraw-Hill, 2001), 1940.
Sons, Inc., 2007. [40] Lo, A.W., “The Adaptive Market Hypothesis: Market Efficiency from an
[14] Engle, R.F., “Autoregressive Conditional Heteroskedasticity with Evolutionary Perspective,” The Journal of Portfolio Management 30:
Estimates of the Variance of U.K. Inflation,” Econometrica 50: 987-1008, 15-29, 2004.
1982. [41] Lo, A.W. and J. Hasanhodzic, The Heretics of Finance: Conversations
[15] Fama, E., “Efficient Capital Markets: A Review of Theory and Empirical with Leading Practitioners of Technical Analysis, Bloomberg Press, New
Work,” Journal of Finance 25: 383-417, 1970. York, 2009.
[16] Fan, J.J., Follow the Banker (in Chinese), China Machine Press, Beijing, [42] Lo, A.W. and J. Hasanhodzic, The Evolution of Technical Analysis:
2010. Financial Prediction from Babylonian Tablets to Bloomberg Terminals,
[17] Foucault, T., M. Pagano and A. Roell, Market Liquidity: Theory, John Wiley & Sons, Inc., New Jersey, 2010.
Evidence, and Policy, Oxford University Press, 2013. [43] Lo, A.W., H. Mamaysky and J. Wang, “Foundations of Technical
[18] Fouque, J.P., G. Papanicolaou and K.R. Sircar, Derivatives in Financial Analysis: Computational Algorithms, Statistical Inference, and Empirical
Markets with Stochastic Volatility, Cambridge University Press, 2000. Implementation,” Journal of Finance 55: 1705-1765, 2000.
[19] Gencay, R., “The Predictability of Security Returns with Simple [44] Lux, T., “The Socio-Economic Dynamics of Speculative Markets:
Technical Trading Rules,” Journal of Empirical Finances 5: 347-359, Interacting Agents, chaos, and the Fat Tails of Return Distribution,”
1998. Journal of Economic Behavior & Organizations 33: 143-165, 1998.
[20] Gigerenzer, G., “On Narrow Norms and Vague Heuristics: A Reply to [45] Lux, T. and M. Marchesi, “Scaling and Criticality in A Stochastic
Kahneman and Tversky (1996),” Psychological Review 103: 592-596, Multi-Agent Model of A Financial Market,” Nature 397: 498-500, 1999.
1996. [46] Lynch, P., One Up on Wall Street: How to Use What You Already Know
[21] Gigerenzer, G. and W. Gaissmaier, “Heuristic Decision Making,” Annual to Make Money in the Market, Simon & Schuster Paperbacks, New York,
Review of Psychology 62: 451-482, 2011. 1989.
[22] Gould, M.D., M.A. Porter, S. Williams, M. McDonald, D.J. Fenn and S.D. [47] Malevergne, Y. and D. Sornette, Extreme Financial Risks: From
Howison, “Limit Order Books,” Quantitative Finance 13: 1709-1742, Dependence to Risk Management, Springer-Verlag Berlin Heidelberg,
2013. 2006.
[23] Graham, B., The Intelligent Investor (Revised Edition), Harper Business, [48] Malkiel, B.G., A Random Walk Down Wall Street (10 th Edition), W.W.
1973. Norton & Co., New York, 2012.
[24] Graham, B. and D. Dodd, Security Analysis (6th Edition), (McGraw-Hill, [49] Menkhoff, L., “The Use of Technical Analysis by Fund Managers:
New York, 2009), 1940. International Evidence,” Journal of Banking & Finance 34: 2573-2586,
[25] Hommes, C.H., “Heterogeneous Agent Models in Economics and 2010.
Finance,” in L. Tesfatsion and K.L. Judd, eds., Handbook of [50] Menkhoff, L. and M.P. Taylor, “The Obstinate Passion of Foreign
Computational Economics Vol. 2: Agent-Based Computational Exchange Professionals: Technical Analysis,” Journal of Economic
Economics, Elsevier B.V.: 1109-1186, 2006. Literature XLV: 936-972, 2007.
[26] Hull, J.C., Options, Futures, and Other Derivatives (7th Edition), Pearson [51] Merton, R.C., “Option Pricing When Underlying Stock Returns Are
Education, Inc., 2009. Discontinuous,” Journal of Financial Economics 3: 125-144, 1976.
[27] Jegadeesh, N and S. Titman, “Returns to Buying Winners and Selling [52] Mirowski, P., More Heat Than Light: Economics as Social Physics,
Losers: Implications for Stock Market Efficiency,” Journal of Finance 48: Physics as Nature’s Economics, Cambridge University Press, 1989.
65-91, 1993. [53] Schmidt, A.B., Financial Markets and Trading: An Introduction to
[28] Jiang, X.S., Reveal the Secrets of Main Force Manipulation (in Chinese), Market Microstructure and Trading Strategies, John Wiley & Sons, New
Tsinghua University Press, 2013. Jersey, 2011.
[29] Keynes, J.M., The General Theory of Employment, Interest and Money, [54] Soros, G., The Alchemy of Finance, John Wiley & Sons, New Jersey,
(BN Publishing, 2009), 1935. 2003.
[30] Kirman, A., “The Intrinsic Limits of Modern Economic Theory: The [55] Stewart, I., “In the Lap of the Gods,” NewScientist, 25 Sept. 2004.
Emperor Has No Clothes,” Economic Journal 99:126-139, 1989.
For referencing please quote: IEEE Trans. on Fuzzy Systems 23(4): 1127-1141, 2015. 17

[56] Sullivan, R., A. Timmermann and H. White, “Data-Snooping, Technical


Trading Rule Performance, and the Bootstrap,” The Journal of Finance
54: 1647-1691, 1999.
[57] Tesfatsion, T. and K.L. Judd, eds., Handbook of Computational
Economics Vol. 2: Agent-Based Computational Economics, Elsevier B.V.,
2006.
[58] Wang, L.X., A Course in Fuzzy Systems and Control, Prentice-Hall, New
Jersey, 1997.
[59] Zadeh, L.A., “Toward a Theory of Fuzzy Systems,” in Aspects of
Network and System Theory, eds. R.E. Kalman and N. DeClaris, Rinehart
and Winston, New York, 1971.
[60] Zadeh, L.A., “Outline of a New Approach to the Analysis of Complex
Systems and Decision Processes,” IEEE Trans. on Systems, Man, and
Cybern. 3: 28-44, 1973.

Li-Xin Wang received the Ph.D. degree in 1992


from the Department of Electrical Engineering –
Systems, University of Southern California (won
USC’s Phi Kappa Phi’s highest Student
Recognition Award). From 1992 to 1993 he was a
Postdoc Fellow with the Department of Electrical
Engineering and Computer Science, University of
California at Berkeley. From 1993 to 2007 he was
on the faculty of the Department of Electronic and
Computer Engineering, The Hong Kong University of Science and
Technology. In 2007 he resigned from his tenured position at HKUST to
become an independent researcher and investor in the stock and real estate
markets in Hong Kong and China. He returned to academia in Fall 2013 by
joining the faculty of the Department of Automation Science and
Technology, Xian Jiaotong University, after a fruitful hunting journey
across the wild land of investment to achieve financial freedom. His
research interests are dynamical models of asset prices, market
microstructure, trading strategies, fuzzy systems, and opinion networks.

You might also like