Vous êtes sur la page 1sur 21

ALGORITHMIC TRADING

Algorithmic Trading

Algorithmic trading (automated trading, black-box trading, or simply algo-trading) is


the process of using computers programmed to follow a defined set of instructions for
placing a trade in order to generate profits at a speed and frequency that is impossible
for a human trader. *

Lin, Tom C. W., The New Financial Industry (March 30, 2014). 65 Alabama Law Review 567 (2014);
Temple University Legal Studies Research Paper No. 2014-11. Available at SSRN:
http://ssrn.com/abstract=2417988

Financial forecast

Major challenge : Accurately forecast price movement in financial and


commodity markets.
Future occurrences : based on present and past event and data..
Financial time series data.
Existence of price trends in financial market and the correlation among
fundamental events and economic figure affecting the market.
Futures contract.
Two type of futures traders : 1) Hedgers and 2) Speculator

[Abu-Mostafa and Atiya, 1996] Abu-Mostafa,Y. S., & Atiya, A. F. (1996).


Introduction to financial forecasting. Applied Intelligence.,6(3):205-213.

Financial forecast

The method used by speculator to forecast can be grouped into two


categories : 1) Fundamental and 2) Technical
Chart analysis
Moving average technique and the regression analysis
Moving average technique : signals an uptrend if the short term average of
the price signal is higher than a longer term average, otherwise it signals a
downtrend.
Regression analysis : A line is fit to the most recent price data points. The
slope of the line determines whether the market is in uptrend or downtrend.

[Abu-Mostafa and Atiya, 1996] Abu-Mostafa,Y. S., & Atiya, A. F. (1996).


Introduction tofinancial forecasting. Applied Intelligence.,6(3):205-213.

Financial data

Forecasters use a learning procedure to associate market direction with price


patterns and other technical and fundamental input, thus discovering the
underlying relationships.
Due to large amount of data and price pattern variety, techniques are needed
to guide the learning process and to preprocess the system inputs and
outputs.
A model ( e.g. neural network, attempts to simulate the market, it takes input x
which is a small subset of the information. So the other information is noise as
far as x is concerned.

[Abu-Mostafa and Atiya, 1996] Abu-Mostafa,Y. S., & Atiya, A. F. (1996).


Introduction tofinancial forecasting. Applied Intelligence.,6(3):205-213.

Inputs and outputs

The moving average technique

Trading Volume indicator


Volatility
Fundamental indicators and hints

[Abu-Mostafa and Atiya, 1996] Abu-Mostafa,Y. S., & Atiya, A. F. (1996).


Introduction tofinancial forecasting. Applied Intelligence.,6(3):205-213.

Feature Selection

Representation : Original time series into d-dimensional space.

identity : The whole sequence is considered to be one 252-dimensional point.


First derivative : the i-th coordinate of the derivative vector is equal to the difference between
the (i + 1)-th and i-th value of the sequence.

Normalization : How we should normalize the vectors.

The standard normalization is done by computing the mean of the vector coordinates and
subtracting it from all coordinates
Piecewise Normalization : split the sequence into windows, and perform normalization
(as described above) separately within each window.

Martin Gavrilov, Dragomir Anguelov, Piotr Indyk, and Rajeev Motwani. 2000. Mining the stock market
(extended abstract): which measure is best?. In Proceedings of the sixth ACM SIGKDD international
conference on Knowledge discovery and data mining (KDD '00). ACM, New York, NY, USA, 487-496.
DOI=http://dx.doi.org/10.1145/347090.347189

Feature Selection

Dimensionality Reduction : reduce the dimensionality of the vector space


while preserving the quality of the representation.

Principal Component Analysis : PCA maps vectors xn in a d-dimensional space (x1 , ..., xd)
onto vectors z in an M -dimensional space, where M < d.
PCA finds d orthonormal basis vectors ui , called also principal components, and
retains only a subset M < d of these principal components to represent the projections of
vectors x n into the lower-dimensional space.
Aggregation : based on the assumption that local fluctuation of the stock is not as important
as its global behavior, and therefore that we can replace a B ( B = 5, 10, 15 etc. ) day period
by the, average stock price during that time.
This decreases the dimensionality by a factor of B.

Similarity Measure : Euclidean distance between the feature vector.


The clustering Method : Hierarchical Agglomerative Clustering

Bottom Up approach
Each observation starts in its own cluster, and pairs of clusters are merged as one moves up
the hierarchy.
A single partition (slice across the hierarchy) can then be taken at any level to give the
desired number of clusters.

Comparing the results :

Stock Trend Prediction


Predict the trend of a stock based on sequential chart pattern modeling.

Chart pattern extraction

Chart distance measurement

Sliding window to extract charts from the stock historical data.


The sliding window covers w-day closing prices and moves in one day step.
similarity is calculated between two charts according to the Pearson correlation coefficient.
Pearson correlation coefficient is between [1, -1]. A higher value implies the two charts are
more similar, and a value close to 0 implies the two charts are uncorrelated.

Chart pattern clustering

Use of K means clustering algorithm to form a cluster of charts with high correlation
coefficient.

Stock Trend Prediction

Sequential chart pattern finder

Trend analysis

For the clustered chart patterns, AprioriAll algorithm is used to find out frequent patterns which
match the given minimal support and confidence
After we have frequent patterns of sequences, we can predict the next possible chart pattern
according to the pattern the current chart belongs to.

Trading strategy : Trading rules are

Buy action If the stock trend is going up and average index return > p% after n days.
Sell action If the stock trend is going down and average index return < p% after n days.

Yung-Piao Wu, Kuo-Ping Wu, and Hahn-Ming Lee. 2012. Stock Trend Prediction by Sequential Chart
Pattern via K-Means and AprioriAll Algorithm. In Proceedings of the 2012 Conference on Technologies
and Applications of Artificial Intelligence (TAAI '12). IEEE Computer Society, Washington, DC, USA,
176-181. DOI=http://dx.doi.org/10.1109/TAAI.2012.42

Preprocessing

Discretizing the time slot of stock market (9:00 AM to 5:00PM) into 1 minute
buckets.
8 identifiers used based on Price and volume of stock
Predict change in closing price of 1-min bucket given information of 7
identifiers prior to that minute.

Metric

Used as a result for accuracy of the preprocessing model.


For each bucket, each model attempts to invest 1 share if uptrend
Rolling profit from each time domain is calculated.
Three Parameters:

accuracy= correct predictions/total predictions


precision= accurate uptick predictions/uptick predictions
recall= accurate uptick predictions/actual upticks

Fragment Based Mining

Main aim to reduce the length of the table in order to reduce processing time
Based on the rule of association mining.
Example large scale companies stock in direct correlation with small scale
companies stock.

Fragment Based Mining

Fragment Based Mining

Statistical Arbitrage

Profit made through statistical mispricing


Ex: Pairs Trading

Ordinary Least Square Method

Estimates the unknown parameters of Linear Regression Model


Minimises difference between observed response and response from linear
model.

Ordinary Least Squares

References
1)
2)

3)

4)

[Abu-Mostafa and Atiya, 1996] Abu-Mostafa,Y. S., & Atiya, A. F. (1996). Introduction to financial
forecasting. Applied Intelligence.,6(3):205-213.
Martin Gavrilov, Dragomir Anguelov, Piotr Indyk, and Rajeev Motwani. 2000. Mining the stock
market (extended abstract): which measure is best?. In Proceedings of the sixth ACM SIGKDD
international conference on Knowledge discovery and data mining (KDD '00). ACM, New York, NY,
USA, 487-496. DOI=http://dx.doi.org/10.1145/347090.347189
Yung-Piao Wu, Kuo-Ping Wu, and Hahn-Ming Lee. 2012. Stock Trend Prediction by Sequential
Chart Pattern via K-Means and AprioriAll Algorithm. In Proceedings of the 2012 Conference on
Technologies and Applications of Artificial Intelligence (TAAI '12). IEEE Computer Society,
Washington, DC, USA, 176-181. DOI=http://dx.doi.org/10.1109/TAAI.2012.42
Future Trend Prediction of Indian IT Stock Market using Association Rule Mining of Transaction
Data- Rajesh V. Argiddi & S.S.Apte

References
5) Flexible least squares for temporal data mining and statistical arbitrage
Authors: Giovanni Montana, Kostas Triantafyllopoulos & Theodoros Tsagaris

Vous aimerez peut-être aussi