1. 1 Neural Trading-Keys to Profit
NEURAL TRADING …….KEYS TO PROFIT
Term Paper
Vinod Gupta School of Management
IIT Kharagpur
Submitted in partial fulfilment of the Management Information Systems (BM61014) Course at the
Vinod Gupta School of Management, IIT Kharagpur.
Submitted to: Submitted by:
Prof. Prithwis Mukerjee Pallav Maheshwari
10BM60057
2. 2 Neural Trading-Keys to Profit
Table of Contents
Abstract...................................................................................................................................................3
Introduction to the idea and importance...............................................................................................3
Why ANN?...........................................................................................................................................3
So, What is required: ..........................................................................................................................3
Fundamental Analysis.............................................................................................................................4
Technical Analysis ...................................................................................................................................5
Things to take care while training Neuronets.........................................................................................7
Some Myths about Neural Trading.......................................................................................................11
Future as seen by Experts.....................................................................................................................11
Current Players in the Market...............................................................................................................12
Road Blocks for Neural Trading.............................................................................................................12
Real World Constraints .........................................................................................................................13
Conclusion and the way forward..........................................................................................................13
References ............................................................................................................................................14
3. 3 Neural Trading-Keys to Profit
Abstract
The Human nervous system is one of the most complex systems in the universe. Apart from its
superior processing speed and memory, it has the ability to learn and adapt This makes the brain
different from computer. Computer scientists now are writing software which tries to mimic this
cognitive learning of adapting. This adapting is seen as learning from past experiences, which a
normal computer today is unable to do. This term paper focuses in applying this learning in trading.
We focus on a number of trading strategies and see how neural trading can reap rich benefits and do
away with the need to understand patterns which have been previously observed. The same
technology can also be used in forecasting and helping in deciding on future strategy in derivatives
and forex markets. This will help in generating more than normal profits.
This paper aims to discuss a neural trading strategy, give insight into its development and eventually
operate it given the real world constraints.
Introduction to the idea and importance
Why ANN?
Artificial Neural Networks (ANNs) are the best known non linear approximators. They show great
tolerance to imprecision and perform even in noisy data environments. Financial Markets are very
noisy in terms of volatility, unpredictability and risk. These very features make financial trading both
challenging and rewarding. ANNs therefore are best suited for mimicking and understanding the
movements of financial markets.
Researchers have been trying to apply ANN to develop mechanical trading systems. In this context a
mechanical trading system operates as per a set of rules and has no discretionally components.
Developing economically viable trading system is a tough task, but the recent developments in the
technology are very promising. ANNs have the methods of back-propagation with feedback to reduce
the training error. One of the objectives which the mechanical trading system can put to use is to
maximize profit subject to a given level of risk, an opportunity which is not available with ANNs. The
mechanical trading system try to mimic behaviour expectations of the traders and at the same time
maintain a balance with the traditional ANN training methods. This happens because of proper choice
of inputs and outputs. All this methodology if properly implemented with a robust mechanical system
would work wonders in years to come.
So, What is required:
4. 4 Neural Trading-Keys to Profit
From a trading system point of view, we will focus on real world applications of the technique along
with a technique of benchmarking.
First of all, we need to select the variables which are likely to influence our desired outcome. These
methods for the starting point for creation of ANN and are likely to heavily influence the outcome.
Various number of methods exist to find out the variables which are likely to influence our outcome
heavily. There are categories under which they’ll fall, the fundamental analysis or the technical
analysis.
We need to first understand such these two types of analysis. Since both of them are complementary
to each other an intelligent approach in selection of inputs should be used. These inputs should be
used to match them to expected outputs in terms of their effect and duration
so that an intelligent choice of inputs can be made, and these can be matched to likely outputs in
terms of their possible effect and duration.
Fundamental Analysis
We all know that financial ratios are used worldwide for the fundamental analysis of companies future
performance. They give an indication of future earnings and a potential future price direction. Various
books have been selling this investment wisdom and contain details on building portfolios and
selecting top picks for the near future.
One of the wisest investor approaches was developed by Graham. He urged investors to pay
attention to three fundamental variables
The size of the firm
The capitalization and
The P/E ration
Oppenheimer and Schlarbaum stated that ‘. . .it is reasonable to conclude that our evidence
contradicts the semi-strong form of the efficient market hypothesis’.
Graham had also published a list of ten attributes of an undervalued stock, which could be used by
investors to get more than normal returns. These 10 attributes were:
E/P yield >= twice the AAA bond yield,
P/E <= 4/10 of the highest average P/E in most recent 5 years
Dividend yield >= 2/3 of the AAA bond yield,
Price <= 2/3 of the tangible book value per share
Price <= 2/3 of net current asset value
Total debt =< tangible book value
Current ratio >= 2
Total debt <= net quick liquidation value
Earnings doubled in most recent 10 years, and
5. 5 Neural Trading-Keys to Profit
No more than two declines in earnings of 5% or more in the past 10 years
This was a very novel approach to security pricing, as most other analysts take into consideration a
number of subjective factors as well while deciding on a security. The point to be made here is even
with such a mechanical approach a positive returns on stock prices was generated.
Buffett took forward the analysis by Graham and used his own subjective judgements also while
relying on the approach suggested by Graham. Buffett made a killing in almost everywhere he
invested.
More researchers (Read Piotroski) define three different classes of financial performance signals,
namely:
Profitability
Leverage, liquidity and source of funds
Operating efficiency
From the above three classes of signals, some simple signals are defined, and a total score of the
nine signals ranks the constituents. These nine signals involve the following seven fundamental
variables:
Net income before extraordinary items
CFO (Cash flow from operations) -both scaled by the beginning of year total assets
Leverage
Liquidity
Whether external financing has been raised recently
Current gross margin scaled by total sales
Current year asset turnover ratio
Within the higher aggregate portfolio constructed, Piotroski observed that the returns are cantered
around the small-cap and medium cap companies, companies with low volume of share turnover, and
firms who have less analyst following. One more point to take note was that superior performance is
not guaranteed by lower share prices initially. Point to be keenly observed is that 1/6th of the annual
return difference between the ex-ante strong and weak firms are earned over the four three-day
periods around the announcement of earnings. This particularly is of interest to market timing
proponents.
Technical Analysis
Modern technical analysis started from the work done by Mr. Charles Dow. He took the average of the
stock prices on daily basis of 11 major stocks. His articles in the Wall Street Journal way back in 1902
6. 6 Neural Trading-Keys to Profit
documented price movements and the patterns of averages. Today, Technical analysis is said to be
composed of the following techniques.
Charting (matching patterns)
Indicators (and oscillators)
Esoteric Approach
This paper will try to explore each of these possibilities. Typically indicators and oscillators are easy to
reproduce as per their mathematical decisions. The charting and pattern matching is a very subjective
approach and it comes without mathematical definitions.
Esoteric approach is not included in this Paper, as they can’t be scientifically justified. Warnecke
(1987) provides examples of the criticisms at these techniques. Technical analysts today are in
demand again after being sided for decades. The reason for this being concerns over the efficient
market hypothesis (EMH) which favoured the random walk theory. The theory stated that share prices
are randomly generated and independently distributed.
The important implication of this hypothesis is that it implies that a series of price changes has no
memory, which further implies that the study of past prices cannot provide a useful contribution to
predicting future prices. As the majority of technical analysis techniques focus on probability based on
past price behaviour, the natural conclusion is that technical analysis cannot work. Regardless of the
random walk theory, a large number of market participants use technical analysis as their main
method of stock selection. Indeed, Taylor and Allen (1992) conducted a UK survey of Forex dealers
on behalf of the Bank of England, and found that at least 90% of the respondents placed some weight
on technical analysis for decision making. It has been suggested that due to its high usage, technical
analysis may, in fact, be becoming a self-fulfilling methodology. In other words, if enough people
follow
the principles, then those principles can be expected to become manifest in the character of price
time series.
Let us know look at the research support for use of technical analysis, which will use variables like
Moving Averages, Indicators, Oscillators.
Most organisations do not disclose their technical rules. They are kept secret and the ones which are
available are very simple.
According to Pring (1999), three basic types of technical analysis are there
Prices movement in trends
Volume goes with the trend
A trend, tends to persist once established.
Less amount of effort has been put on the technology supporting the use of specific technical
indicators and oscillators. The major academic work done relates to Moving Average and Momentum
based rules. To have a neural network to access to the same types of indicators and oscillators being
used by practitioners across the globe, a survey of the practitioners’ journal, ‘The technical analysis of
Stocks and Commodities’ was conducted. For the sake of brevity, detailed reviews are not provided
7. 7 Neural Trading-Keys to Profit
for the articles studied, rather, a list of the most ‘popular’ (i.e. most frequently referenced) technical
variables is provided below. The supposition is that these variables are very much in use is due to the
fact that they are quite useful.
Technical Variables most frequently cited in ‘The Technical Analysis of Stocks and Commodities’
Moving Averages Volatility based variables, such as Average True Range Volume based variables,
such as
Volume directly, or OBV (On Balance Volume)
ADX (Average Directional Index – See Wilder (1978)
Stochastic (based on the work of George Lane)
Momentum (both price and volume)
RSI (Relative Strength Index – See Wilder (1978)
Variety of miscellaneous indicators and oscillators e.g. MACD, Inter-market indicators, Money Flow,
TRIN (Traders Index), etc.
To conclude the position regarding technical analysis, it would be prudent to state that after a long
absence from academic circles, technical analysis is beginning to enjoy a return to hardcore
investment finance. It is becoming common nowadays to see universities promote subjects with titles
such as ‘Computational Finance’, and even Siegel (2002) supports the use of Moving Averages.
Nowadays Computational Finance courses are not particularly devoted to technical analysis, but they
also cover other topics, such as Behavioural Finance and Intelligent Finance. Intelligent Finance
tends to develop a comprehensive understanding of financial markets by the combination of
fundamental, strategic and technical analysis. It also takes help of neural networks.
Things to take care while training Neuronets
How do we train a neural network exactly or how do we not over train them? This is the most
complicated question, which is very difficult to clearly systematize. Therefore lets discuss on the
proper way to train them and avoid over training. Since it is so non-linear and it has the ability to adapt
to any data, a neural network is well trained and adjusted and as a result has a tendency to over train
itself. A neural network with just some neurons in its inside layer can remember the history of a
around 1000 bars. Also, “over-training" becomes the basic nature of neural nets when applied
financial markets specially. It is because markets change rapidly over time - what happened in the
past will not be there in the future. Of course some of it exists, but somewhat differently, there will be
no apple to apple matches. Patterns, laws, market areas – will al be different on different.
Therefore, if a neural network learns the examples of the past very well when being trained on
historical data, it may simply fail to identify new patterns in the end. That mean, the neural network
has to be well adapted to the market situations, which were there in the past, but it was unable to
recognize the new patterns in the changed market situations
Two most prominent approached to avoid over training are
8. 8 Neural Trading-Keys to Profit
the early stop of training
increase of the training interval.
Though, both methods have their serious disadvantages. The difficult question arises. At what point
shall I stop training? What criteria should be used? There are many answers to this question - use
errors, profit levels, drawdown some other mathematical constraints. But they do not give a 100%
guarantee of timely stops. This timely stop of training depends only on the trader's skills.
Most common myth with traders is that the better it was in the past, the better it will be in the future.
Or the lesser the error on the interval of training, the better the network will operate in the time to
come. But being too well trained in historical data, a neural network can fail to foresee. This is what
has been observed - the error decreases gradually with the increasing training time, but the profit first
increases and then falls, forming a maximum in a certain moment in time. This is what we need to
catch.
Further, as the training time increases, the error will also gradually decrease. The profit on OOS could
actually produce some other maximums, but they are smaller than previous ones. Though this is not
always the case as traders have found out situations where second and the third were better than the
first one. But it is a general trend that the first maximum is better than the rest in terms of profitability
& efficiency. In fact as a trader one needs to catch first maximum. And it depends on skills and
experience of the trader. Although, one may be guided by the percentage of profitability, error, Sharpe
ratio, drawdown and many other parameters but ultimately, it depends completely on the trader what
criteria to use. And it depends on how he understands his Trading System and knows how it behaves.
While on the interval of training, we may be surprised by some results. The error and profit act
perfectly opposite - the error gradually reduces, and profit increases smoothly. If profit increases
during optimization, this means that the Expert Advisor is fitted to the market curve, transforming or
modifying the price into a smooth curve. This curve should rise up and is called equity. In fact, such
an optimization is also to reduce the error. And following results: the greater the profit on the section
of optimization is, the more probability of over-training or over-optimization is and, as a consequence -
losses in the future.
9. 9 Neural Trading-Keys to Profit
One other way to avoid over training is to increase the interval of training, i.e. to increase the amount
of data, over which the network is trained. But this method may also not suit. Increasing the amount of
data in financial markets might result in the network just failing to recognize patterns and market
areas, which exist at the very given training. This training section is too large for that, because the
market changes with time. And a particular pattern appears too different in this large interval, and the
network cannot describe that this is the same pattern, which has just changed over time.
Then there is another question: Which part of the market should be assigned to a network for
training? Here is the answer: that part where the network remembers patterns and market areas
necessary for a TS and the trader. This depends on trader's skill level - the way he understands the
market and how nicely he can choose the right part for training.
Other ways to avoid over-training exist but they are not significant enough.
In this profession a lot is on stake on the experience and skill of a trader. This requires mathematical
knowledge as well as creativity. Also we have established the point that all features of the use of
neural networks and trading systems stay on the underlying fact that markets are ever changing and
past never exactly repeats itself. This feature exists in financial markets only. The popular myth is that
we need to overload neural network with data and let it train itself - it will learn independently what it
needs. For some normal use of neural networks this may be true, but financial markets have their own
specialities and peculiarities, which so is not so easy.
As per a very successful trader, never use pure time series for the inputs of neural networks. Time
series are always transformed by some indicator, which normalizes the data into a certain row e.g.
from -100 to 100 or from -1 to 1. More normalization is not necessary, because if the indicator values
are greater than 1, they can be divided by a certain appropriate number, to achieve a value not more
than 1. He tries to do as little change of input data as possible, because any transformation will bring
more non linear distortion in the input signal. This results in wrong training of a neural network, as the
distortion can be incorrectly understood by the network. Also, with strong transformations, and
subsequent large nonlinear distortions, the network could have trained not on a real input signal, but
on nonlinear distortions, which might be fatal for a trader and can result in loss of deposit.
10. 10 Neural Trading-Keys to Profit
Here are a few examples of distortions which are non linear that are visible to the naked eye. Take,
for example, the normal stochastic. We might perceive that such a simple indicator would bring no
distortions. But some time, it makes strong nonlinear distortions, which might mislead the neural
network in the training process and in further work on a real account.
Such areas are highlighted with a white oval on the chart. In the first indicator as the price goes up,
and the stochastic indicator is almost still in its maximum value. In the second case, the price is
almost constant, whereas the stochastic indicator sharply goes down from maximum to minimum
value. In the first case the stochastic indicator will bring zero information to the network, while in the
latter case it will simply confuse the network. In both the demonstrated cases, the behaviour of the
11. 11 Neural Trading-Keys to Profit
stochastic indicator will negatively impact both the training and the work of the neural network on a
real account. And this might lead to losses.
These two examples are the visible form of distortions which are easily seen. There are many others
which we are unable to see and analyze. This is the very reason that one should be very careful while
pre-procession the input data.
There are other indicators that make stronger distortions. Also are those that make less strong ones.
However, the fact is - distortion can be made by any indicators. Although, one can select specific
parameters for any indicator (even stochastic), so that it brings minimum distortions in the original
signal with particular market conditions. Obviously, the nature of the market may change, and one will
have to change the indicator parameters in order to reduce the distortions introduced.
Some Myths about Neural Trading
One of the biggest myths associated with neural networks is their super-profitability. But this applies
to Forex as a whole. At first it might seem easy to a starter earn - buy and sell, no complications.
Later, some factors appear, of which one does not know - only then one starts comprehending and
understanding them. In neural networks, there is a different kind of paradox. Disappointing is the very
thing that attracts you - networks ability to train and adapt to any market with any data available. This
big advantage becomes a significant disadvantage when applied to financial markets. What an
amazing metamorphosis.
There is no super-profitability in Forex , not only in neural nets. Strictly, neural networks are the same
trading systems. They just use a neuronet instead of common indicators. And then the most important
facet is money management, the greed of the traders.
Future as seen by Experts
Dean Barr, chief investment officer for LBS Capital Management in Safety Harbor. Fla., says, "The
technology does work. We use it every day to manage over $200 million. A lot of people get frustrated
because they just start with it and assume they can just do this, that and the other thing. It is very time
intensive; you have to manipulate a lot of data and, as a result, people become very discouraged
when they don't have immediate success. Unfortunately, there is a lot of trial and error involved in
these processes."
Vincent Butkiewicz, a vice president with Carroll, McEntee & McGinley in New York, agrees. His
company has recently completed work on a neural network trading system after researching on the
technology for around a year.
12. 12 Neural Trading-Keys to Profit
"We have put a lot of time into this, and with repetitive bashing against these things, eventually you
will figure what type of inputs the net likes to see. It's basically a case of working long and hard at it"
he says. Though he did not discuss the hypothetical performance but said he was very much pleased
with the results.
Current Players in the Market
Neural Trading is being pursued by quite a large number of hedge funds and brokerage houses.
Some of the large players in Neural Trading Market today are:
NeuroDimension: They generate algorithms and technologies in the filed of neural
networks for trading purposes. They have customers in more than 60 countries
around the world benefiting first-hand from our extensive expertise in the field.
American Century Investments: It is a privately-controlled and
independent investment management firm that has been focused on delivering
superior investment performance. It employs Neural Trading.
LBS Capital Management: Pursuing Neural Trading heavily and was one of the
pioneer.
TrendLogic Associates, Greenwich: This firm is earning superior returns for its
investors using Neural Networks.
Road Blocks for Neural Trading
a. The systems implements only ‘long’ trade positions and does not sell the stock short, which is a
large part of profit making in the markets. It is because short selling has various restrictions in
various stock exchanges and it can’t be simply assumed that all stocks can be sold short. For
example, the method the Australian Stock Exchange uses to determine which shares can be sold
short can make short-side selling reasonably complex. The ASX determines the list of Approved
Securities, and allows no more than one tenth of the total quantity in issue of eligible securities to
be short sold. There is a new list of short selling stocks everyday, based on the list for the T-1
day, as described by the Australian Stock Exchange, in the Short Sales document (Short Sales,
2004).
b. There is indeed, a lack of a formal methodology which can give input to the mechanical trading
sytem. There are very clear reasons for this. Successful systems traders would try to protect their
intellectual capital and not disclose development methodologies. This is the biggest inhibitor for
many researchers who are not sure whether their system will actually work when real world
constraints are applied.
c. There is a further lack of understanding in terms of the correct way of benchmarking such
systems. This is because published results may be the end mixup of a large number of previous
experiments, leading to a poorly developed system. Such systems tend to fail and are unstable.
13. 13 Neural Trading-Keys to Profit
d. Further complications arise because of lack of understanding of the constraints of real-world
trading, such as accounting for transaction costs, and the implementation of algorithms of money
management.
Real World Constraints
a. All trading simulations must account for transaction costs, and it should be over-estimated for
historical testing. Traditionally, the cost of brokerage has been falling, therefore, using today’s
transaction costs to simulate historical trading results of ten years ago can be misleading,
especially if the strategy being tested generates a large number of trades.
b. Another simulation constraint appears in form slippage. Although a trade may be initiated at
market open, this doesn’t mean that the trade will be opened or closed at that very price. There
might be a slippage due to the fact that at market open there may be a great many trades
scheduled. Obviously there can be huge price movements in the initial in the early part of trading,
and slippage is the method to take care of this cost.
c. It is quite important while developing and benchmarking systems of this type that simulations
respect volume constraints. It is not reasonable to assume that there is are infinite quantity of
stocks available for purchase. When training and testing, it is realistic to assume that the positions
acquired are a small fraction of overall trade volume available. A suitable factor might be five
percent, or maybe even lesser depending on the market volatility.
d. Finally, it is not prudent in historical simulations to directly refer to cut-off values for variables such
as price. For example, it is not be feasible to include a condition that price must be less than $5 to
initiate a trade. Historic price data is adjusted for splits etc, so, historically a price may be $5, but
at the actual date that stock was traded it could be a different price.
Conclusion and the way forward
This paper has presented a methodology for Artificial Neural Network based system to work based on
various types of analysis. It demonstrated some traders who are doing this task very effectively. There
are a number of small firms doing in on an ad-hoc basis. It also focussed on the real world problems
and the possible precautions to be taken while trading on neural networks.
The objective of developing viable mechanical stock market trading systems based on technologies
such as neural networks is achievable. The key is to conduct the development process within a well-
defined methodology, and as close to real-world constraints as possible.
Way forward for neural networks is very promising. A big company needs to start working on refining
the technology and unlock the immense potential that artificial neural networks offer.
14. 14 Neural Trading-Keys to Profit
References
1. Analysis of Particle Swarm Optimization Algorithm, Qinghai Bai, Vol 3, No 1, Feb 2010
2. Designing Short Term Trading Systems with Artificial Neural Networks, Bruce Vanstone,
Gavin Finnie, and Tobias Hahn
3. A Hybrid Neural Network-Based Trading System, Nikos S. Thomaidis and Georgios D.
Dounias Springer-Verlag Berlin Heidelberg 2009
4. News items on world wide web
5. Neural Networks, Financial Trading and the Efficient Markets Hypothesis, Andrew Skabar &
Ian Cloete
6. A Hybrid Financial Trading System Incorporating Chaos Theory, Statistical and Artificial
Intelligence/Soft Computing Methods, Dr Clarence N W Tan, Ph.D.