Proceedings of the th nternational Conference on Automation & Computing, University of trathclyde, Glasgow, UK, - eptember 5 Applying Feedback to tock Trading: Exploring A New Field of Research T C Yang, Z G i and Y N hu Department of Engineering and Design University of ussex Brighton, UK t.c.yang@sussex.ac.uk Abstract Nowadays, feedback control is everywhere and affects everything. Recently, a novel idea of applying feedback control to stock trading is proposed. ome interesting results are published in recent EEE/FAC control conferences. Different from current statistical or artificial neural network based approaches, this opens a new research field in analytical strategies for stock trading. n this paper we follow the scheme of imultaneous ong- hort feedback control and carry out a new study. n our study, instead of one feedback gain for both long and short trading, different trading gains are applied. Based on recent stock prices over one year (from 4/3/7 to 5/3/6), we show our selected simulation results for two stocks. One is the Apple ncorporated stock. The trend of its price over the year is increasing. The other is the NADAQ- index and the trend of its price is decreasing. A number of new research topics are also proposed in this paper. Keywords- Feedback control, tock trading. NTRODUCTON The evolution of feedback control from an ancient technology to a modern field is a fascinating microcosm of the growth of the modern technological society. Nowadays, feedback control is everywhere and affects everything [], from generation and distribution of electricity, telecommunication, process control, steering of ships, control of vehicles and airplanes, operation of production and inventory systems, regulation of packet flows in the nternet, modelling and control of economic systems, to disrupting the feedback of harmful biological pathways that cause disease. Recently, a novel idea of applying feedback control to stock trading is studied and some interesting results published [-]. Although such an idea is not completely new, the recent pinioning work see [], the first paper in this field and presented in the 8 FAC World conference was attributed to Prof Barmish, B. Ross (The author of a well-known book: New Tools for Robustness of inear ystems published in 993) and his team. Their work lays a foundation for many future researches yet to follow. n this paper, in ection we introduce imultaneous ong-hort () feedback control. Among the all work presented by Prof Barmish s team [-], this is a key stock trading scheme. n ection 3, we present our work summarized in the abstract and propose a number of new research topics. A brief conclusion is given in ection 4. The work presented in [-] and here is an interdisciplinary study crossing the areas of control and finance. People in control community may not familiar with some financial terms. For some background knowledge, the interested readers are suggested to refer to the Wikipedia or a book [] (There were three ACC and CDC tutorial sessions on this subject [3-5]).. MUTANEOU ONG-HORT () FEEDBACK CONTRO. Notations and the dealized Market [] n consistent with and quoted from [4], in this paper p is used for the stock price, for the amount invested with < being a short sale, g and V for the cumulative trading profit or loss on [, t] and account value respectively. When speaking of a short sale above, we mean the following: When the trader has negative investment <, this means stock is borrowed from the broker and is immediately sold in the market in the hope that the price will decline.when such a decline occurs, this short seller can realize a profit by buying back the stock and returning the borrowed shares to the broker. Alternatively, if the stock price increases, the short seller may choose to cover the trade, return the borrowed stock to the broker and take a loss. The idealized market is characterized by a number of assumptions: (A-) Continuous and Costless Trading: t is assumed that the trader can react instantaneously to observed price variations with zero transaction cost; i.e., no brokerage commissions or fees. That is, the amount invested can be continuously updated as price changes occur. Motivation for this assumption is derived in part from the world of high-frequency trading; e.g., with the help of programmed trading algorithms, flash traders working for hedge funds can execute literally thousands of trades per second with minimal brokerage costs. n fact, even the small trader using a high-speed internet connection can easily execute many trades per minute. This assumption is also made in the celebrated Black-choles model; e.g., see [6].
(A-) Continuously Differentiable Prices: The stock price p is continuously differentiable on [, T], the time interval of interest. t should be noted that this is the most serious assumption differentiating the idealized market from a real market. That is, this assumption rules out the possibility that price gaps may occur following various real market events such as earnings announcements or major news. n contrast to most of the finance literature, instead of making predictions based on a geometric Brownian motion model for price, p is treated in this paper as an uncertain external input against which the aim is to robustify the trading gain g. (A-3) Perfect iquidity: t is assumed that the trader faces no gap between a stock s bid and ask prices. That is, orders are filled instantaneously at the market price p. We do not view this assumption as serious in the sense that stocks trading large volume on major exchanges typically have bid-ask spreads which are small fractions of a percent. (A) Trader as a Price-Taker: t is assumed that the trader is not trading sufficiently large blocks of stock so as to have an influence on the price. Note that this assumption would be faulty in the case of a large hedge or mutual fund. For example, when a hedge fund dumps millions of shares onto the market, the stock price typically declines during the course of the transaction. (A-5) nterest Rate and Margin: t is assumed that the trader accrues interest on any uninvested account funds at the risk-free rate of return r. However, when extra funds are brought into the account via a short sale, consistent with the standard practice of brokers, if these funds are held aside as cash, no interest is accrued. f the trader opts to use this cash to obtain leverage via purchase of additional stock, margin charges accrue at interest rate m. Another way that margin charges result is when a trader has > V. That is, the trader is essentially being given a loan by the broker and charged margin interest rate m for the use of the funds. To avoid distracting technical details regarding the way brokers mark to market to calculate margin charges, the following model used in this paper is a simplification on the way margin accounts are typically handled: When > V, margin charges a compounded at interest rate m. Note that the absolute value used for takes care of < when a short is involved. Finally, for simplicity, we assume that both interest and margin rates are the same. That is, m = r. This is a type of efficient market assumption. n practice, it would usually be the case that m > r with the difference m r being a function of the size of the trader. For example, a large brokerage house trading its own portfolio would have virtually no spread between these two interest rates. With this assumption, we have a very simple equation summarizing interest accruals and margin charges accruals. That is, over time interval [, t], the accumulated interest i is: t i( = ( V ( τ ) ( τ ) ) dτ () i < represents margin interest owed. (A-5-) n this paper, in order to concentrate on the fundaments of the trading algorithm, we make a special assumption m = r =. () (A-6) implified Collateral Requirement: n a brokerage account, associated with the granting of margin is a collateral requirement on securities. For example, if the account value is V, some clients are allowed to carry V in equities before forced liquidation of assets occur, larger clients may have larger upper bounds, etc. More generally, our model assumes γ is specified as part of the trading scenario. Then, we only allow instantaneous investments ( γv ( (3) for satisfaction of collateral requirements.. Dynamics and tate Equations [4] Consider an infinitesimal time increment over which both the trading gain g and the account value V are updated. etting dp be the corresponding stock price increment, the corresponding incremental trading gain is simply the percentage change in price multiplied by the amount invested. Hence, dp dg = (4) p During this same time period, the incremental change in the account value is the sum of the contributions from both stock and idle or borrowed cash. That is, dv = dg + r( V ) (5) with the starting point above, for the trading profit or loss, the differential equation is dg dp = ( (6) p and the correspond account value equation is dv dg = + r( V ( ) (7) with these equations having initial conditions V = V ( ) () = (8) g() = As noted before, for the differential equations above, we view the price variation p as an external input. The investment plays the role of the controller and is yet to be specified. Using notation:
dp ρ ( (9) p and substituting (9) and (6) to (7): dv ( V ( ( ) ) = ρ ( ( + r t () For this equation, consider time intervals of two types. Type ntervals: On such an interval [ t ], t we have ρ ( r. Taking the controller to be of the form ( = γ V ( sgn ρ( () with γ γ, the resulting account value equation is dv [ γ ρ( + r( γ )] V ( = () and the associated endpoint solution is readily calculated to be have t ( r( γ )( t + γ ρ( τ ) d ) V ( t ) V ( = exp τ (3) Type ntervals: On such an interval, [ t ], t, we ρ ( t ) < r. n this case, taking the controller to be (, the account value equation degenerates to dv = rv (4) with endpoint solution given by ( r( t t )) V ( ) V ( t ) = exp t (5) From the analysis for the two types of intervals above, it follows that if the idealized market trader uses, the inequality r( γ )( t t ) + γ ρ( τ ) dτ (6) t t is satisfied and it follows that V t ) V ( ) (7) ( t The cumulative trading profit or loss g is considered as the system output and a static feedback control law of the form = f(g) with f being a continuous function is used in [4]. That is, the amount invested in the stock is modulated as a function of the trading profits or losses g accrued over [, t]. n the sequel, the focus is on time-invariant linear feedback controls f ( g) + Kg (8) = with = () being the initial investment. t.3 imultaneous ong-hort () inear Feedback Control [4] To establish the main result, first to construct a controller which is a superposition of two linear feedbacks as described by Eq. (8), one being a long trade with, K > and the other being a short trade with, K <. These trades can be viewed as running simultaneously in parallel. The amount invested in the long trade is and the amount invested in the short trade is. Hence, the net overall investment is ( = ( ( (9) + and, as time evolves, the relative amounts in each of these trades will change. t may well be the case that one of these two trades will become dominant as time evolves. For example, in a raging bull market, one would expect to see get large and tending to zero. With K > and > fixed, the two feedback controllers are defined by ( = Kg ( () + ( = Kg ( () where g and g are the trading gains or losses for the long and short trades respectively. Hence, the overall investment and trading gains for the combined trade are ( = K( g ( g ( ) () g( = g ( g ( (3) + which begins at () = and g() =. Refer to Eq. (4) and (), the individual trades satisfy the differential equation dg = ρ ( + Kg ) (4) ( dg = ρ ( ( + Kg ) (5) with initial conditions g ( ) = and g ( ) =. The setup above leads to many results which are consistent with common sense. For example, with K > and price p increasing, will increase and will decrease. That is, the trader becomes net long. The question then arises whether the trading gains from the long position will be sufficient to offset losses from the short leading to a net profit. The Arbitrage Theorem [4] to follow answers this question and others in the affirmative provided the so-called adequate resource condition below [4] is satisfied. Given that an idealized
market is assumed, this framework should be viewed as one which shows us the limits of state feedback control. Adequate Resource Condition [4]: n the theorem follow, it is assumed that the combination of initial account value V () = V, feedback gain K and constant and prices p are such that the collateral requirement ( γ V ( is assured over the time interval of interest. Equivalently, if the investment demands more resources than are currently available in the account, the trader has the ability to respond to a margin call by bringing in more funds. Arbitrage Theorem (see [4] for the proof): At all times t, assume the adequate resource condition ( is satisfied. Then, the imultaneous ong-hort static linear feedback controller leads to trading profit K K p( p( g ( = + (6) K p() p() satisfying g > for all non-zero price variations..4 Practical mplementation of Controller [4] As emphasized in [-], the use of prices p which are continuously differentiable is an idealization. n real markets, charts of prices at discrete times can appear highly non-differentiable and discontinuous. This raises questions about the efficacy of the static feedback controller in real-world markets. Motivated by the fact that the controller performs well in idealized markets, it becomes a candidate for implementation and back-testing in real markets. Hence, now consider that trading occurs at discrete times and note that the intersample time can be either small such as one minute for a high-frequency trader or large such a one day for a mutual fund. et p(, V(, ( and g( denote the discrete-time counterparts of p, V, and g respectively, introducing the one-period percentage change in stock price p( k + ) p( ρ = (7) p( we consider various cases for the discrete-time model. implest Case: The simplest scenario occurs when we assume no controller reset (see next section) and that long and short investments ( and ( maintain their proper sign; i.e., (, ( whereas ρ ( is assured by the dynamics in continuous time, in the discrete-time case, a large value of might lead to an undesirable sign reversal. f, in addition we assume no collateral requirements (say ρ is large), it follows from the continuous-time analysis that suitable dynamic update equations are: ( k + ) = ( + Kρ( ) ( k + ) = ( Kρ( ) ( k + ) = g ( k + ) = g g ( k + ) = g g( k + ) = g ( k + ) + + ρ( + ρ( ( k + ) + g ( k + ) ( k + ) V ( k + ) = V + g( + r( V ( ) (8) with r now denoting the one-period risk-free rate of return. More General Case: To handle the sign restriction conditions on ( and (, the update equations are modified to: ( k + ) = max ( k + ) = min {( + Kρ( ), } {( Kρ( ), } (9) and then build in the account collateral requirement by modifying the total investment to be { ( k + ) + ( k + ), γv ( )} ( k + ) = min k (3) Clearly, as already suggested in [4], how to choose the feedback gain K in (8) is an issue to be further investigated.. EECTED MUATON REUT AND FUTURE WORK Based on the known literatures [-], there is a great scope for further work. We have made a few attempts on different topics. The simplest new idea is to assign different gains to the long and short parts of imultaneous ong-hort feedback control. We use K and K to replace an unique K in (8): using K for the long trading part and K for the short trading part. To limit the length of this paper, we presented some selected simulation results summarized in the table below. The corresponding eight plots are presented in the next page. Case K K tock Gain g C A 3.6 $ C 3 A 4446. $ C3 3 A -355.4 $ C4 3 3 A 8688. $ C5 B 66.98 $ C6 3 B -333.4 $ C7 3 B 6378.38 $ C8 3 3 B 9.99 $ tock A: Apple ncorporated, B: NADAQ-; Data from 4/3/7 to 5/3/6
.5 x 4 Case C: Apple ncorporat.5 -.5 ong Gain $ hort Gain $ P-e4 $ - 5 5 5 3 Feedback gain, ong, hort (P: Price) x 4 Case C: Apple ncorporat 8 6 4 ong Gain $ hort Gain $ P-.5e5 $ - 5 5 5 3 Feedback gain, ong 3, hort (P: Price) x 4 Case C3: Apple ncorporat 8 6 4 - ong Gain $ hort Gain $ P-.5e5 $ 5 5 5 3 Feedback gain, ong, hort 3 (P: Price) x Case C4: Apple ncorporat 4 ong Gain $ hort Gain $ 8 P-.5e5 $ 6 4-5 5 5 3 Feedback gain, ong 3, hort 3 (P: Price) x 4 Case C5: Nasdaq - - ong Gain $ -3 hort Gain $ Pe3-9e4 $ 5 5 5 3 Feedback gain, ong, hort (P: Price) x 4 Case C6: Nasdaq - ong Gain $ -6 hort Gain $ Pe3-7e4 $ -8 5 5 5 3 Feedback gain, ong 3, hort (P: Price).5 x 5 Case C7: Nasdaq.5.5 -.5 ong Gain $ hort Gain $ - P8e4-5e5 $ -.5 5 5 5 3 Feedback gain, ong, hort 3 (P: Price).5.5.5 -.5 3 x 5 Case C8: Nasdaq ong Gain $ hort Gain $ P7e4-3.5e5 $ - 5 5 5 3 Feedback gain, ong 3, hort 3 (P: Price)
n the all plots, in order to compare the relationships between long gain g, short gain g, oveall gian g and price change in p, re-scaled p is plotted using blue broken lines. Observation of these plots cannot easily lead to some useful suggestions. This is only part of our study so far. n the remain space of this paper, we disscuss some possible future research. () Futher to the topic of how to choose the feedback gain K in (8), where K is a constant [4], to study not only different K and K values, but also how these values can be changed adaptively. () Apart from the feedback control K, how to choose an optimized initial value? n general, how to modify the feedback scheme when some assumptions are not fully valid in a real trading world? (3) Contrast to simultaneous long and short trading, in financial trading literature, one of the key topics is triggering mechanism for entering or exiting a long or a short trade. The study of this topic can combined with model-free feedback control scheme as proposed in [- ]. (4) n [9], a simple gain feedback controller is extend to a P controller. From our point of view, it would be more useful to study a PD controller. n process control, the main purpose of the term in a P controller is to eliminate the steady-state error, but it will introduce delay. The D term in a PD controller is to predict, which is also a useful function in stock trading. Broadly speaking, the work led by Prof Barmish, B. Ross and the work presented here belong to technical analysis, for example see [7]. Technical analysis is an approach to predicting future price movements based on identifying patterns in prices, volume and other market statistics. Technical analysis usually proceeds by recording market activity in graphical form and then deducing the probable future trend from the pictured history. The premise is that prices exhibit various geometric regularities, which, once identified, inform the trader what is likely to happen next. This in turn allows the trader to run a profitable trading strategy. Prof Barmish, B. Ross s work has opened a new promising field based on, not statistical models, but the principle of feedback control. Therefore, many issues addressed in [7] can be revisited. One of the important indicators of the market is trading volumes of stocks. Financial academics and practitioners have long recognized that past trading volume may provide valuable information about a security. However, there is little agreement on how volume information should be handled and interpreted. Even less is known about how past trading volume interacts with past returns in the prediction of future stock returns. tock returns and trading volume are jointly determined by the same market dynamics, and are inextricably linked in theory. Combined with feedback viewpoint, there are indeed many topics to be studied. V. CONCUON This paper introduces a relatively new branch of technical analysis for stock trading. t involves the application of classical control theoretic concepts to stock and option trading. The key is to formulate the trading law as a feedback control on the price sequence. imulation results from real stock prices based on our initial work are briefly presented. More importantly, new research topics are proposed. REFERENCE [] K. J. Astrom and P. R. Kumar, "Control: A perspective," Automatica, vol. 5, pp. 33, Jan 4. [] B. R. Barmish, "On trading of equities: a robust control paradigm," Proceedings of the FAC World Congress, eoul, Korea vol., pp. 6-66, 8. [3]. warere and B. R. Barmish, "A Confidence nterval Triggering Method for tock Trading Via Feedback Control," American Control Conference, pp. 69-696,. [4] B. R. Barmish, "On Performance imits of Feedback Control- Based tock Trading trategies," American Control Conference, pp. 3874-3879,. [5] B. R. Barmish and J. A. Primbs, "On Arbitrage Possibilities Via inear Feedback in an dealized Brownian Motion tock Market," 5th eee Conference on Decision and Control and European Control Conference, pp. 889-894,. [6] B. R. Barmish and J. A. Primbs, "On Market-Neutral tock Trading Arbitrage Via inear Feedback," American Control Conference, pp. 3693-3698,. [7]. Malekpour and B. R. Barmish, "How Useful are Mean-Variance Considerations in tock Trading via Feedback Control?," eee 5st Annual Conference on Decision and Control, pp. - 5,. [8]. Malekpour and B. R. Barmish, "A Drawdown Formula for tock Trading Via inear Feedback in a Market Governed by Brownian Motion," 3 European Control Conference, pp. 87-9, 3. [9]. Malekpour, J. A. Primbs, and B. R. Barmish, "On stock trading using a P controller in an idealized market: The robust positive expectation property," Decision and Control 3 EEE 5nd Annual Conference on, pp. -6, 3. []. warere and B. R. Barmish, "On tock Trading Over a attice via inear Feedback," in FAC World Congress, 4, pp. 7799-784. []. Malekpour and B. R. Barmish, "The Conservative Expected Value: A New Measure with Motivation from tock Trading via Feedback," in FAC World Congress, 4, pp. 879-874. [] C. T. E., J. F. Weston, and. Kuldeep, "Financial Theory and Corporate Policy (4th Ed.)," Addison-Wesley, 3. [3] J. A. Primbs and B. R. Barmish, "ACC Tutorial ession: An ntroduction to Option Trading from a Control Perspective," in American Control Conference, ed,. [4] J. A. Primbs and B. R. Barmish, "ACC Tutorial ession: An ntroduction to Hedged-ike tock Trading from a Control Theoretic Point of View," American Control Conference (Acc), pp. 4496497,. [5] B. R. Barmish, J. A. Primbs,. Malekpour, and. Warnick, "On the basics for simulation of feedback-based stock trading strategies: An invited tutorial session," Decision and Control, 3 EEE 5nd Annual Conference on, pp. 78-786, 3. [6] F. Black and M. choles, "The Pricing of Options and Corporate iabilities," Journal of Political Economy, vol. 8, pp. 637-654, 973. [7] Edwards, Robert D.; Magee, John; Bassetti, W.H.C. Technical Analysis of tock Trends, 9th Edition. American Management Association, 7.