You are on page 1of 4

Stock Prediction Based on Price Patterns 1.

0 - Matlab source code

Click here to download code for price patterns


http://www.advancedsourcecode.com/pricepatternprot.zip

FAQ

Do these price patterns work well ?


We are currently using these patterns for our trading strategies ;) . You can download
a protected version of code and try it. Click here to download the demo code.

Which limitations does the demo code have ?


Only speed: in demo code artificial delays have been inserted.

Why does code run so slow ?


Artificial delays have been inserted to protected code (each pattern requires about 25
minutes). In this way you will be able to evaluate the code with some restrictions.
The source code is extremely fast and highly optimized: in some fractions of second
data are processed and sell/buy signals are ready to be used.

How long can I use protected code ?


You can use protected demo code with no limit.

I have not a lot of time to evaluate the code. What can I do ?


Please email us luigi.rosa@tiscali.it your data (column vectors with the high, low,
closing, and opening prices of a security in csv or any other formatted file). You will
receive in 6-12 hours a candlestick chart with all price patterns that have been
detected.

I want to obtain complete source code. What have I to do ?


In order to obtain the complete source code (the faster code, with no restrictions and
no artificial delays) please follow the instructions reported below. A donation is
required.

Which patterns have been implemented ?


We have implemented existing price patterns improving them with some major
modifications. De facto new, high profit price patterns have been introduced.

How does the code work ?


Each pattern is detected by a specific function. Each function has as inputs four
vectors: Opening, Highest, Lowest, and Closing price that occurred during the Time
Interval of the bars. We usually perform out tests with 5-Minute Bar Chart but, of
course, other choices are possible. The function returns as output a vector whose
elements are the indices of bars where the current pattern has occurred.
Have I to read a user manual ?
It is not necessary to read any user manual. In the demo code you will find a lot of
examples and applications. All discovered patterns are visualized in a candlestick
chart.

What is your current research in price patterns analysis ?


We are currently studying the possibility of merging these algorithms with
approaches based on Artificial Neural Networks and Genetic Algorithms.

Why Matlab ?
Matlab offers the possibility to create fully-customizable code, with a simple and
intuitive programming language.

A stock price does not assert itself on the market to which buyers and sellers have to
submit. Price is arrived at by the equilibrium in trading between supply and demand.
Price is a relative value. Price is a means of keeping score of market action; a score
based on the ongoing conflict between buyers and sellers. If buyers are in the
ascendancy then a price increase is scored and if sellers have the upper hand then a
price decrease ensues. It is the changes in stock prices that document the results of
investor conflict; if the direction of price change persists then a price trend is
established. It is the early recognition of trends of price change that permits
maximum profitability of stock market invest-ment. Price alone is a poor indicator of
market involvement. It is the consideration of all the other technical information
relative to the price, and price change that reveals the flux of market structure.The
dynamics of investor conflict have prognostic value if they can be discerned. Price
can have some value when related to the large picture of price history. Here various
price levels can indicate previous levels of price support or resistance to further price
change and, therefore, may prove to do so again. But again price does not determine
this, the market forces determine this. That it happens at a particular price is the result
of an equilibrium of market forces. Violation of these areas of support and resistance
are often very bearish or bullish respectively. If these areas are violated then they
often change their roles, support now becomes resistance and resistance, support to
further stock price changes. So, for price to be a meaningful study to enhance
profitability in stock market investment, we must study relative changes in stock
price, i.e. price patterns and trends. Price patterns frequently associated with the
continuation or reversal of trends are recognizable.

There are about as many chart (or price) patterns as there are stock market analysts,
and there are many of them! To give you an idea of the different patterns available to
you, here is a partial listing: trend lines, support/resistance, fan lines, channel lines,
retracement, speed resistance, gaps, reversal patterns, head and shoulder patterns,
double tops/bottoms, triple tops/bottoms, saucers or rounding patterns, cup and
handle, V-formations, triangles, diamonds, flags and pennants, wedge formation and
trading ranges. Candlestick charts have their own series of price patterns such as
hammers, doji, stars, dragonfly doji, spinning tops, and we could go on and on for a
while. The most widely used charting methods are bar charts and candlestick charts;
some traders also use point and figure charts.

The authors are not commodity trading advisors. The information on this site is for
trading education only. There are no trading recommendations for any one individual
made on this site and this information is paper trades for trading education. All trades
are extemely risky and only risk capital should be used when trading. The authors
have no relationship or partnership with The Mathworks. All the code provided is
written in Matlab language (M-files and/or M-functions), with no dll or other
protected parts of code (P-files or executables). The code was developed with Matlab
14 SP1. Matlab Financial Toolbox is required. The code provided has to be
considered "as is" and it is without any kind of warranty. The authors deny any kind
of warranty concerning the code as well as any kind of responsibility for problems
and damages which may be caused by the use of the code itself including all parts of
the source code.

You might also like