0% found this document useful (0 votes)
8 views6 pages

Yang 2015

Uploaded by

fatemeh1725
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views6 pages

Yang 2015

Uploaded by

fatemeh1725
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

th

Proceedings of the 21 International Conference on


Automation & Computing, University of Strathclyde,
Glasgow, UK, 11-12 September 2015

Applying Feedback to Stock Trading:


Exploring A New Field of Research
T C Yang, Z G Li and Y N Shu
Department of Engineering and Design
University of Sussex
Brighton, UK
[email protected]

Abstract— Nowadays, feedback control is everywhere and abstract and propose a number of new research topics. A
affects everything. Recently, a novel idea of applying brief conclusion is given in Section 4.
feedback control to stock trading is proposed. Some
interesting results are published in recent IEEE/IFAC The work presented in [2-11] and here is an inter-
control conferences. Different from current statistical or disciplinary study crossing the areas of control and
artificial neural network based approaches, this opens a new finance. People in control community may not familiar
research field in analytical strategies for stock trading. In with some financial terms. For some background
this paper we follow the scheme of “Simultaneous Long-
knowledge, the interested readers are suggested to refer to
Short feedback control” and carry out a new study. In our
study, instead of one feedback gain for both long and short the Wikipedia or a book [12] (There were three ACC and
trading, different trading gains are applied. Based on recent CDC tutorial sessions on this subject [13-15]).
stock prices over one year (from 2014/3/27 to 2015/3/26),
we show our selected simulation results for two stocks. One II. SIMULTANEOUS LONG-SHORT (SLS) FEEDBACK
is the Apple Incorporated stock. The trend of its price over CONTROL
the year is increasing. The other is the NASDAQ-100 index
II.1 Notations and the Idealized Market [2]
and the trend of its price is decreasing. A number of new
research topics are also proposed in this paper. In consistent with and quoted from [4], in this paper
p(t) is used for the stock price, I(t) for the amount invested
Keywords- Feedback control, Stock trading
with I(t) < 0 being a short sale, g(t) and V(t) for the
cumulative trading profit or loss on [0, t] and account
I. INTRODUCTION
value respectively. When speaking of a “short sale”
The evolution of feedback control from an ancient above, we mean the following: When the trader has
technology to a modern field is a fascinating microcosm negative investment I(t) < 0, this means stock is borrowed
of the growth of the modern technological society. from the broker and is immediately sold in the market in
Nowadays, feedback control is everywhere and affects the hope that the price will decline.When such a decline
everything [1], from generation and distribution of occurs, this short seller can realize a profit by buying back
electricity, telecommunication, process control, steering of the stock and returning the borrowed shares to the broker.
ships, control of vehicles and airplanes, operation of Alternatively, if the stock price increases, the short seller
production and inventory systems, regulation of packet may choose to “cover” the trade, return the borrowed
flows in the Internet, modelling and control of economic stock to the broker and take a loss. The idealized market is
systems, to disrupting the feedback of harmful biological characterized by a number of assumptions:
pathways that cause disease. Recently, a novel idea of
applying feedback control to stock trading is studied and (A-1) Continuous and Costless Trading: It is assumed
some interesting results published [2-11]. Although such that the trader can react instantaneously to observed price
an idea is not completely new, the recent pinioning work variations with zero transaction cost; i.e., no brokerage
see [2], the first paper in this field and presented in the commissions or fees. That is, the amount invested I(t) can
2008 IFAC World conference was attributed to Prof be continuously updated as price changes occur.
Barmish, B. Ross (The author of a well-known book: Motivation for this assumption is derived in part from the
“New Tools for Robustness of Linear Systems” published world of high-frequency trading; e.g., with the help of
in 1993) and his team. Their work lays a foundation for programmed trading algorithms, flash traders working for
many future researches yet to follow. In this paper, in hedge funds can execute literally thousands of trades per
Section 2 we introduce Simultaneous Long-Short (SLS) second with minimal brokerage costs. In fact, even the
feedback control. Among the all work presented by Prof small trader using a high-speed internet connection can
Barmish’s team [2-11], this is a key stock trading scheme. easily execute many trades per minute. This assumption is
In Section 3, we present our work summarized in the also made in the celebrated Black-Scholes model; e.g., see
[16].
(A-2) Continuously Differentiable Prices: The stock i(t) < 0 represents margin interest owed.
price p(t) is continuously differentiable on [0, T], the time
(A-5-S) In this paper, in order to concentrate on the
interval of interest. It should be noted that this is the most
fundaments of the trading algorithm, we make a special
serious assumption differentiating the idealized market
assumption
from a real market. That is, this assumption rules out the
possibility that price gaps may occur following various m = r = 0. (2)
real market events such as earnings announcements or
(A-6) Simplified Collateral Requirement: In a
major news. In contrast to most of the finance literature,
brokerage account, associated with the granting of margin
instead of making predictions based on a geometric
is a collateral requirement on securities. For example, if
Brownian motion model for price, p(t) is treated in this
the account value is V, some clients are allowed to carry
paper as an uncertain external input against which the aim
2V in equities before forced liquidation of assets occur,
is to robustify the trading gain g(t).
larger clients may have larger upper bounds, etc. More
(A-3) Perfect Liquidity: It is assumed that the trader generally, our model assumes γ ≥ 1 is specified as part of
faces no gap between a stock’s bid and ask prices. That is, the trading scenario. Then, we only allow instantaneous
orders are filled instantaneously at the market price p(t). investments
We do not view this assumption as serious in the sense
that stocks trading large volume on major exchanges I ( t ) ≤ γV (t ) (3)
typically have bid-ask spreads which are small fractions of
a percent. for satisfaction of collateral requirements.
(A-4) Trader as a Price-Taker: It is assumed that the II.2 Dynamics and State Equations [4]
trader is not trading sufficiently large blocks of stock so as Consider an infinitesimal time increment dt over
to have an influence on the price. Note that this which both the trading gain g and the account value V are
assumption would be faulty in the case of a large hedge or updated. Letting dp be the corresponding stock price
mutual fund. For example, when a hedge fund dumps increment, the corresponding incremental trading gain is
millions of shares onto the market, the stock price simply the percentage change in price multiplied by the
typically declines during the course of the transaction. amount invested. Hence,
(A-5) Interest Rate and Margin: It is assumed that the
trader accrues interest on any uninvested account funds at
dp
dg = I (4)
the risk-free rate of return r. However, when “extra” funds p
are brought into the account via a short sale, consistent
During this same time period, the incremental change
with the standard practice of brokers, if these funds are
in the account value is the sum of the contributions from
“held aside” as cash, no interest is accrued. If the trader
both stock and idle or borrowed cash. That is,
opts to use this cash to obtain leverage via purchase of
additional stock, margin charges accrue at interest rate m. dV = dg + r (V − I )dt (5)
Another way that margin charges result is when a trader
has I(t) > V(t). That is, the trader is essentially being given with the starting point above, for the trading profit or
a loan by the broker and charged margin interest rate m for loss, the differential equation is
the use of the funds. To avoid distracting technical details
regarding the way brokers “mark to market” to calculate dg 1 dp
= I (t ) (6)
margin charges, the following model used in this paper is dt p dt
a simplification on the way margin accounts are typically
handled: When |I(t)| > V (t), margin charges a and the correspond account value equation is
compounded at interest rate m. Note that the absolute
dV dg
value used for I(t) takes care of I(t) < 0 when a short is = + r (V − I (t ) ) (7)
involved. Finally, for simplicity, we assume that both dt dt
interest and margin rates are the same. That is, m = r. This with these equations having initial conditions
is a type of efficient market assumption. In practice, it
would usually be the case that m > r with the difference m V0 = V (0) ≥ I (0) = I 0
– r being a function of the size of the trader. For example, (8)
g ( 0) = 0
a large brokerage house trading its own portfolio would
have virtually no spread between these two interest rates. As noted before, for the differential equations above,
With this assumption, we have a very simple equation we view the price variation p(t) as an external input. The
summarizing interest accruals and margin charges investment I(t) plays the role of the controller and is yet
accruals. That is, over time interval [0, t], the accumulated to be specified.
interest i(t) is:
Using notation:
t
i (t ) = ³0 (V (τ ) − I (τ ) )dτ (1)
1 dp II.3 Simultaneous Long-Short (SLS) Linear Feedback
ρ (t ) ≅ (9) Control [4]
p dt
To establish the main result, first to construct a
and substituting (9) and (6) to (7): controller which is a superposition of two linear
dV feedbacks as described by Eq. (18), one being a long
= ρ (t ) I (t ) + r (V (t ) − I (t ) ) (10) trade with I 0 , K > 0 and the other being a short trade
dt
with I 0 , K < 0 . These trades can be viewed as running
For this equation, consider time intervals of two types.
simultaneously in parallel. The amount invested in the
Type 1 Intervals: On such an interval [t1 , t 2 ] we have long trade is I L (t ) and the amount invested in the short
ρ (t ) ≥ r . Taking the controller to be of the form trade is I S (t ) . Hence, the net overall investment is

I (t ) = γ *V (t ) sgn ρ (t ) (11) I (t ) = I L (t ) + I S (t ) (19)

and, as time evolves, the relative amounts in each of these


with 0 ≤ γ ≤ γ , the resulting account value equation is
*
trades will change. It may well be the case that one of
these two trades will become “dominant” as time evolves.
dV
dt
[
= γ * ρ (t ) + r (1 − γ * ) V (t )] (12) For example, in a raging bull market, one would expect to
see get large I L (t ) and I S (t ) tending to zero. With K >
and the associated endpoint solution is readily calculated
0 and I 0 > 0 fixed, the two feedback controllers are
to be
defined by
( t2
)
V (t 2 ) = exp r (1 − γ * )(t 2 − t1 ) + γ * ³t ρ (τ ) dτ V (t1 )
1 I L (t ) = I 0 + Kg L (t ) (20)
(13)
I S (t ) = − I 0 − Kg S (t ) (21)
Type 2 Intervals: On such an interval, [t1 , t 2 ] , we
where g L (t ) and g S (t ) are the trading gains or losses
have ρ (t ) < r . In this case, taking the controller to be
for the long and short trades respectively. Hence, the
I (t ) ≡ 0 , the account value equation degenerates to overall investment and trading gains for the combined
trade are
dV
= rV (t ) (14)
dt I (t ) = K ( g L (t ) − g S (t )) (22)
with endpoint solution given by g (t ) = g L (t ) + g S (t ) (23)
V (t 2 ) = exp(r (t 2 − t1 ) ) V (t1 ) (15) which begins at I(0) = I0 and g(0) = 0. Refer to Eq. (4)
and (20), the individual trades satisfy the differential
From the analysis for the two types of intervals above,
equation
it follows that if the idealized market trader uses , the
inequality dg L
= ρ (t )( I 0 + Kg L ) (24)
* t2 dt
r (1 − γ * )(t 2 − t1 ) + γ ³t
1
ρ (τ ) dτ ≥ 0 (16)
dg S
is satisfied and it follows that = − ρ (t )( I 0 + Kg S ) (25)
dt
V (t 2 ) ≥ V (t1 ) (17)
with initial conditions g L (0) = 0 and g S (0) = 0 .
The cumulative trading profit or loss g(t) is
The setup above leads to many results which are
considered as the system output and a static feedback
consistent with common sense. For example, with K > 0
control law of the form I = f(g) with f being a continuous
function is used in [4]. That is, the amount invested I(t) and price p(t) increasing, will increase and | I S (t ) | will
in the stock is modulated as a function of the trading decrease. That is, the trader becomes “net long”. The
profits or losses g(t) accrued over [0, t]. In the sequel, the question then arises whether the trading gains from the
focus is on time-invariant linear feedback controls long position will be sufficient to offset losses from the
short leading to a net profit. The Arbitrage Theorem [4]
f ( g ) = I 0 + Kg (18) to follow answers this question and others in the
affirmative provided the so-called “adequate resource
with I 0 = I (0) being the initial investment. condition” below [4] is satisfied. Given that an idealized
market is assumed, this framework should be viewed as I L (k + 1) = (1 + Kρ (k )) I L (k )
one which shows us the limits of state feedback control.
I S (k + 1) = (1 − Kρ (k )) I S (k )
Adequate Resource Condition [4]: In the theorem
I (k + 1) = I L (k + 1) + I S (k + 1)
follow, it is assumed that the combination of initial
account value V (0) = V0 , feedback gain K and constant g L (k + 1) = g L (k ) + ρ (k ) I L (k ) (28)
and prices p(t) are such that the collateral requirement g S (k + 1) = g S (k ) + ρ (k ) I S (k )
| I (t ) |≤ γ V (t ) is assured over the time interval of g (k + 1) = g L (k + 1) + g S (k + 1)
interest. Equivalently, if the investment I(t) demands
more resources than are currently available in the
V ( k + 1) = V (k ) + g (k ) + r (V ( k ) − I (k ) )
account, the trader has the ability to respond to a margin
with r now denoting the one-period risk-free rate of
call by bringing in more funds.
return.
Arbitrage Theorem (see [4] for the proof): At all
More General Case: To handle the sign restriction
times t ≥ 0 , assume the adequate resource condition
conditions on I L (k ) and I S (k ) , the update equations are
I (t ) ≡ 0 is satisfied. Then, the Simultaneous Long-Short
modified to:
static linear feedback controller leads to trading profit
I L ( k + 1) = max{(1 + Kρ (k )) I L (k ), 0}
I ª§ p (t ) · K § p (t ) · − K º (29)
g (t ) = 0 «¨¨ ¸¸ + ¨¨ ¸¸ − 2 » (26) I S (k + 1) = min{(1 − Kρ (k )) I S (k ), 0}
K «¬© p (0) ¹ © p (0) ¹ »¼
and then build in the account collateral requirement by
satisfying g(t) > 0 for all non-zero price variations. modifying the total investment to be

II.4 Practical Implementation of SLS Controller [4] I ( k + 1) = min {I L ( k + 1) + I S ( k + 1) , γV ( k )} (30)


As emphasized in [2-11], the use of prices p(t) which Clearly, as already suggested in [4], how to choose
are continuously differentiable is an idealization. In real the feedback gain K in (28) is an issue to be further
markets, charts of prices at discrete times can appear investigated.
highly non-differentiable and discontinuous. This raises
questions about the efficacy of the static feedback SLS III. SELECTED SIMULATION RESULTS AND FUTURE WORK
controller in real-world markets. Motivated by the fact
Based on the known literatures [2-11], there is a great
that the SLS controller performs well in idealized
scope for further work. We have made a few attempts on
markets, it becomes a candidate for implementation and
different topics. The simplest new idea is to assign
back-testing in real markets. Hence, now consider that
different gains to the long and short parts of Simultaneous
trading occurs at discrete times and note that the inter-
Long-Short feedback control. We use K L and K S to
sample time can be either small such as one minute for a
high-frequency trader or large such a one day for a replace an unique K in (28): using K L for the long
mutual fund. trading part and K S for the short trading part. To limit
Let p(k), V(k), I(k) and g(k) denote the discrete-time the length of this paper, we presented some selected
counterparts of p(t), V(t), I(t) and g(t) respectively, simulation results summarized in the table below. The
introducing the one-period percentage change in stock corresponding eight plots are presented in the next page.
price
p ( k + 1) − p ( k ) Case KL KS Stock Gain g
ρ (k ) = (27)
p (k ) C1 1 1 A 2032.60 $
we consider various cases for the discrete-time model. C2 3 1 A 44246.02 $
C3 1 3 A -13525.42 $
Simplest Case: The simplest scenario occurs when we
assume no controller reset (see next section) and that long C4 3 3 A 28688.00 $
and short investments I L (k ) and I L (k ) maintain their C5 1 1 B 1626.98 $
C6 3 1 B -33132.42 $
proper sign; i.e., I L (t ) ≥ 0, I S (t ) ≤ 0 whereas ρ (k ) is
C7 1 3 B 63781.38 $
assured by the dynamics in continuous time, in the
discrete-time case, a large value of might lead to an C8 3 3 B 29021.99 $
undesirable sign reversal. If, in addition we assume no Stock A: Apple Incorporated, B: NASDAQ-100;
collateral requirements (say ρ is large), it follows from Data from 2014/3/27 to 2015/3/26
the continuous-time analysis that suitable dynamic update
equations are:
x 10
4 Case C1: Apple Incorporat x 10
4 Case C5: Nasdaq
1.5 2
Long Gain $
Short Gain $
Overall Gain $ 1
1
P*200-2e4 $
0
0.5

Dollar
Dollar

-1
0
-2
Long Gain $
-0.5 Short Gain $
-3
Overall Gain $
P*12e3-9e4 $
-1 -4
0 50 100 150 200 250 300 0 50 100 150 200 250 300
Feedback gain, Long 1, Short 1 (P: Price) Feedback gain, Long 1, Short 1 (P: Price)

4 Case C2: Apple Incorporat x 10


4 Case C6: Nasdaq
x 10 2
12
Long Gain $
10 Short Gain $
Overall Gain $ 0
P*2000-1.5e5 $
8
-2

Dollar
6
Dollar

4 -4

2 Long Gain $
-6 Short Gain $
0 Overall Gain $
P*20e3-17e4 $
-2 -8
0 50 100 150 200 250 300 0 50 100 150 200 250 300
Feedback gain, Long 3, Short 1 (P: Price) Feedback gain, Long 3, Short 1 (P: Price)

x 10
5 Case C7: Nasdaq
x 10
4 Case C3: Apple Incorporat 2.5
12
Long Gain $ 2
10 Short Gain $
Overall Gain $ 1.5
8 P*2000-1.5e5 $
1
6
Dollar

0.5
Dollar

4
0
2
-0.5 Long Gain $
0 Short Gain $
-1 Overall Gain $
-2 P*8e4-5e5 $
-1.5
0 50 100 150 200 250 300
-4
0 50 100 150 200 250 300 Feedback gain, Long 1, Short 3 (P: Price)
Feedback gain, Long 1, Short 3 (P: Price)
x 10
5 Case C8: Nasdaq
3
x 10
4 Case C4: Apple Incorporat Long Gain $
12 2.5 Short Gain $
Long Gain $ Overall Gain $
10 Short Gain $ 2 P*7e4-3.5e5 $
Overall Gain $
8 P*2000-1.5e5 $
1.5
Dollar

6 1
Dollar

4 0.5
2
0
0
-0.5
-2
-1
0 50 100 150 200 250 300
-4 Feedback gain, Long 3, Short 3 (P: Price)
0 50 100 150 200 250 300
Feedback gain, Long 3, Short 3 (P: Price)
In the all plots, in order to compare the relationships V. CONCLUSION
between long gain g L , short gain g S , oveall gian g This paper introduces a relatively new branch of
and price change in p, re-scaled p is plotted using blue technical analysis for stock trading. It involves the
broken lines. Observation of these plots cannot easily application of classical control theoretic concepts to stock
lead to some useful suggestions. This is only part of our and option trading. The key is to formulate the trading law
study so far. In the remain space of this paper, we as a feedback control on the price sequence. Simulation
disscuss some possible future research. results from real stock prices based on our initial work are
(1) Futher to the topic of how to choose the feedback briefly presented. More importantly, new research topics
gain K in (28), where K is a constant [4], to study not are proposed.
only different K L and K S values, but also how these
REFERENCES
values can be changed adaptively.
[1] K. J. Astrom and P. R. Kumar, "Control: A perspective,"
(2) Apart from the feedback control K, how to choose Automatica, vol. 50, pp. 3-43, Jan 2014.
an optimized initial value I 0 ? In general, how to modify [2] B. R. Barmish, "On trading of equities: a robust control
paradigm," Proceedings of the IFAC World Congress, Seoul,
the feedback scheme when some assumptions are not Korea vol. 1, pp. 1621-1626, 2008.
fully valid in a real trading world ? [3] S. Iwarere and B. R. Barmish, "A Confidence Interval Triggering
(3) Contrast to simultaneous long and short trading, in Method for Stock Trading Via Feedback Control," 2010 American
Control Conference, pp. 6910-6916, 2010.
financial trading literature, one of the key topics is
[4] B. R. Barmish, "On Performance Limits of Feedback Control-
‘‘triggering mechanism’’ for entering or exiting a long or Based Stock Trading Strategies," 2011 American Control
a short trade. The study of this topic can combined with Conference, pp. 3874-3879, 2011.
‘‘model-free’’ feedback control scheme as proposed in [2- [5] B. R. Barmish and J. A. Primbs, "On Arbitrage Possibilities Via
11]. Linear Feedback in an Idealized Brownian Motion Stock Market,"
2011 50th Ieee Conference on Decision and Control and
(4) In [9], a simple gain feedback controller is extend European Control Conference, pp. 2889-2894, 2011.
to a PI controller. From our point of view, it would be [6] B. R. Barmish and J. A. Primbs, "On Market-Neutral Stock
more useful to study a PD controller. In process control, Trading Arbitrage Via Linear Feedback," 2012 American Control
the main purpose of the I term in a PI controller is to Conference, pp. 3693-3698, 2012.
eliminate the steady-state error, but it will introduce [7] S. Malekpour and B. R. Barmish, "How Useful are Mean-Variance
Considerations in Stock Trading via Feedback Control?," 2012
delay. The D term in a PD controller is to ‘‘predict’’, Ieee 51st Annual Conference on Decision and Control, pp. 2110-
which is also a useful function in stock trading. 2115, 2012.
Broadly speaking, the work led by Prof Barmish, B. [8] S. Malekpour and B. R. Barmish, "A Drawdown Formula for
Stock Trading Via Linear Feedback in a Market Governed by
Ross and the work presented here belong to technical Brownian Motion," 2013 European Control Conference, pp. 87-
analysis, for example see [17]. Technical analysis is an 92, 2013.
approach to predicting future price movements based on [9] S. Malekpour, J. A. Primbs, and B. R. Barmish, "On stock trading
identifying patterns in prices, volume and other market using a PI controller in an idealized market: The robust positive
expectation property," Decision and Control 2013 IEEE 52nd
statistics. Technical analysis usually proceeds by Annual Conference on, pp. 1210-1216, 2013.
recording market activity in graphical form and then [10] S. Iwarere and B. R. Barmish, "On Stock Trading Over a Lattice
deducing the probable future trend from the pictured via Linear Feedback," in IFAC World Congress, 2014, pp. 7799-
history. The premise is that prices exhibit various 7804.
geometric regularities, which, once identified, inform the [11] S. Malekpour and B. R. Barmish, "The Conservative Expected
trader what is likely to happen next. This in turn allows Value: A New Measure with Motivation from Stock Trading via
Feedback‫څ‬," in IFAC World Congress, 2014, pp. 8719-8724.
the trader to run a profitable trading strategy. Prof [12] C. T. E., J. F. Weston, and S. Kuldeep, "Financial Theory and
Barmish, B. Ross’s work has opened a new promising Corporate Policy (4th Ed.)," Addison-Wesley, 2013.
field based on, not statistical models, but the principle of [13] J. A. Primbs and B. R. Barmish, "ACC 2011 Tutorial Session: An
feedback control. Therefore, many issues addressed in Introduction to Option Trading from a Control Perspective," in
[17] can be revisited. 2011 American Control Conference, ed, 2011.
[14] J. A. Primbs and B. R. Barmish, "ACC 2012 Tutorial Session: An
One of the important indicators of the market is Introduction to Hedged-Like Stock Trading from a Control
trading volumes of stocks. Financial academics and Theoretic Point of View," 2012 American Control Conference
(Acc), pp. 4496-4497, 2012 2012.
practitioners have long recognized that past trading
[15] B. R. Barmish, J. A. Primbs, S. Malekpour, and S. Warnick, "On
volume may provide valuable information about a the basics for simulation of feedback-based stock trading
security. However, there is little agreement on how strategies: An invited tutorial session," Decision and Control,
volume information should be handled and interpreted. 2013 IEEE 52nd Annual Conference on, pp. 7181-7186, 2013.
Even less is known about how past trading volume [16] F. Black and M. Scholes, "The Pricing of Options and Corporate
interacts with past returns in the prediction of future stock Liabilities," Journal of Political Economy, vol. 81, pp. 637-654,
1973.
returns. Stock returns and trading volume are jointly [17] Edwards, Robert D.; Magee, John; Bassetti, W.H.C. “Technical
determined by the same market dynamics, and are Analysis of Stock Trends, 9th Edition. American Management
inextricably linked in theory. Combined with feedback Association, 2007.
viewpoint, there are indeed many topics to be studied.

You might also like