Monday, January 16, 2017

66. HUMBLE HONEST BUT SIMPLE AND STATISTICAL VALID MEASUREMENTS IN TRADING, IS A CORNERSTONE OF CONFIDENCE AND CONSISTENT SUCCESS .

ANYONE WHO WILL TRY TO MAKE MONEY SOLELY BY TRADING AND SUCH SYSTEMS OF TRANSACTIONS SHOULD BE AWARE THAT THERE IS A VERY POWERFUL AND ALMOST UNBEATABLE COLLECTIVE WILL SO AS NOT TO SUCCEED!  NO-ONE WANTS  PEOPLE TO QUITE THEIR JOBS AND MAKE MONEY THIS WAY AS IT IS SOMEHOW PARASITIC. IT IS IN SOME SENSE  UNETHICAL AS A PRACTICE ENFORCEABLE  TO  THE MAJORITY. AND OF COURSE NEITHER THOSE WHO HAVE LARGE CAPITAL  WANT THAT A MAJORITY WILL MAKE MONEY THIS WAY, AS THEY WOULD PREFER THAT THEY WORK IN THEIR COMPANIES FOR THEM. ONLY IN SPECIAL CONTINGENCIES AND SITUATIONS SOMETHING LIKE THIS WOULD BE ETHICAL. AND IN PARTICULAR A HIGHER MORALITY THAT WOULD SUPPORT SUCH A PRACTICE, WOULD BE PROVABLE WITH COLLECTIVELY BENEVOLENT DEEDS FROM A POSSIBLE SURPLUS OF SUCH MONEY!

Everybody would like to know more about  what the market will do so as to trade appropriately with almost certainty, like an arbitrage! But this is not but very rarely the case with the markets. Some press  themselves to guess beyond what is observable in almost ever situation of the markets moves so as to trade with almost certainly and exhaust themselves. The science of statistics  is fair about what it claims it knows with uncertainly and how much uncertainty and what it cannot know at all and such claims are based entirely on the observable by the senses data. ! The science of statistics can draw valuable conclusions with little only information and knowledge about how  really the market will move. But fortunately these conclusions are adequate to make sufficient profits in scientific statistical trading! We may call this realization  the Lean Fair Knowledge of Scientific Statistics.  Even though the science of statistics bases its knowledge entirely on the observable data that are available to everybody, still it is not in the ability of perception of everybody to realize and make directly the same conclusions without some knowledge of statistics. Some people may start their research about the successful trading in the markets more or less knowing the basic statistical behaviour of the markets, but being not satisfied with the Lean Fair Knowledge of Scientific Statistics  search for decades for something more. Most often they will be  failing to find something more, and the reasons is that this Lean Fair statistical knowledge of the markets is a universal  phenomenon , in the way the economy functions and information is distributed and published. The good news is that the Lean Fair statistical knowledge is adequate to make good profits.


There is a thin line that separates business and investments as gambling that destroys the human spirit from business and investments as applications of scientific statistical knowledge under general principles that protects and reinforces the human spirit. This book contributes to see the difference and put the investors from the side of protected human spirit.


We have mentioned earlier the basic cornerstones of success, and we repeat them here. 


There are 3 contexts of laws required in trading . The appropriate LAWS OF THINKING for trading, the appropriate LAWS OF FEELINGS for trading , and the appropriate LAWS OF ACTIONS for trading. 

The Successful trading is based according to these three laws on
1) POWER OF COLLECTIVE  SCIENTIFIC THINKING: A GREAT AND SIMPLE SCIENTIFIC PERCEPTION OF THE FUNCTION OF THE ECONOMY THROUGH SOME GLOBAL STATISTICAL LAW. E.g. The law of Universal attraction in economy: that big money attracts more big money in the capital markets, and this by the balance of demand and supply makes securities indexes of the companies , that are indeed the big money, to have mainly stable ascending trend, whenever one can observe such one. Valid statistical deductions can be obtained with simple statistical hypotheses tests about the existence or not of a trend , with sample size half the period of a dominating cycle.The statistical quantities from the front-office in trading need to me measured are the price position in the channel around the average, the velocity (1st derivative) and the acceleration-deceleration (2nd derivative), which is done as statistical quantities by a hypothesis test or confidence interval. The support-resistance levels can be measured also by action-volume histograms.  The measurements are done with convenient indicators, and can also define in a statistically valid way, not only , the channels , the trend, reversal, and Eliot-waves but also the spikes. In addition for the back-office of trading we need to measure the probability of success of trade based on the past history of trades, to apply the Kelly criterion, and also the average rate of increase of the trading funds and its variance again from the past history of trading.   (STABLE GREAT SCIENTIFIC THOUGHT-FORM  OR BELIEF FACTOR IN TRADING. )

2) POWER OF COLLECTIVE PSYCHOLOGY: A LINK WITH THE POSITIVE COLLECTIVE PSYCHOLOGY.(E.g. that the growth of security indexes also represent the optimism of the growth and success of real business of the involved companies. And we bet or trade only on the ascension of the index, whenever  an ascending trend is observable). (STABLE GREAT POSITIVE COLLECTIVE   EMOTIONAL OR PSYCHOLOGICAL FACTOR IN TRADING. )

3) POWER OF INDIVIDUALS SIMPLE , CONSISTENT AND EASY TO CONDUCT PRACTICE. (e.g. a trading system with about 80% success  rate that utilizes essentially only one indicator in 3 time frames, simple risk management rules of stop loss, take profit, trailing and escalation, and time spent not more than 20 minutes per day. In this way there are not many opportunities of human errors in the conduction of the trading practice. Failed trades are attributed to the randomness and are not to blame the trader). (STABLE SIMPLE AND EASY PRACTICAL  FACTOR IN TRADING)

We may make the metaphor that successful trading is the ability to have successful resonance with the  activities of top minority of those who determine the markets.

In trading there are 3 components in the feelings that must be dealt with. 1) The feeling of MONEY itself, 2) The feeling of the UTILITY of the money 3) The feeling of the RISK of the money each time. What is called usually money management in trading is essentially RISK MANAGEMENT. 


VALID STATISTICS AND PREDICTABILITY
We must make here some remarks about the robust application of statistical predictions in the capital markets.

1) The theory that the efficient markets and in particular that they follow a pure random walk is easy to refute with better statistical experiments and hypotheses tests. The random walk would fit to a market where the sizes of the economic organizations are uniformly random. But the reality is that they follow a Pareto or power distribution, therefore this is inherited in the distribution of the volumes of transactions and also in the emerging trends or drifts. 

2) The statistical models of time series  are more robust , when they apply to the entity MARKET as a whole and are better as  non-parametric , and not when they apply to single stocks and are linear or parametric. The reasons is that  a time series as a stochastic process , requires data of a sample of paths, and for a single stock is available only a single path. While for all the market the path of each stock or security is considered one path from the sample of all paths of all the stocks. Linear time series models or derived like ARMA, ARIMA, SARIMA etc are destined to fail for particular patterns like those described in the post 32, because the true equations are non-linear and in addition with random, time varying coefficients that derive the random emergence of the 4 basic observable patterns (see post 32 ). In addition the standard application of the time series by the researchers,  focuses  on stationary time series after they extract  a stable exponential trend, while in the reality the main concern should be the random path of the average value of the prices that shapes the patterns and is neither constant exponential trend neither zero ! The "statistical momentum conservation" might then be nothing else than an hypothesis that the random and time varying 1st order in time steps , partial correlation of the prices , is always positive. This can be easily tested statistically. E.g. in the cross exchange rate EURUSD but also in the indexes, the partial correlation of the current to the previous time step bar is measured indeed positive, in almost all time frames, except at the daily time frame, where the cyclic behavior prevails. In the daily time frame the partial correlation is negative , which means if one day is up the next day it is more probable that it is down. In addition, the cyclic behavior is even stronger in pairs of two days with negative partial correlation (two days up two days down etc). In searching for random cycles or periodicity, of say a single index or even instrument , the valid statistical practice requires the creation of a sample of paths over a time interval of  a whole period, by collecting  the pieces of the path at different periods as the market move as far as the searched periodicity is concerned may be considered as moving independently at independent periods. 

The most essential tool for successful and profitable above the average,  trading from the three that the title of the book suggests (Law of growth, law of cycles, law of inequalities) is the law of cycles and the awareness to discover cycles in the charts of prices, that are not directly apparent. Especially when the cycles are 1) daily cycles to be traded with hourly or 4-hours bars and 2) Weekly cycles to be traded with hourly or 4-hours or daily bars  3) Monthly cycles to be traded  with daily bars 4) Seasonal 3-months cycles to be traded  with daily bars. 

3) The less ambitious the statistical application the more valid the result. E.g. applying a statistical hypothesis test, or analysis of variance   to test if there is an up or a down trend (drift) or none, is a more valid statistical deduction , than applying a linear model of a time series and requiring prediction of the next step price. 

4) Multivariate statistics, like factor analysis, discriminant analysis , logistic regression,  cluster analysis , conjoint analysis, correspondence analysis, multidimensional scaling etc , goal programming etc are possible to utilize for a more detailed theory of and of portfolio analysis, and sector analysis of the market and not only H. Markowitz theory. 

5) In applying of the above applications of statistics, the researcher must have at first a very good "feeling" of the data, and should verify rather with statistics the result rather than discover it. 

6) The "Pareto rule of complexity-results" also holds here. In other words with less than 20% of the complexity of the calculations is derived more than 80% of the deduction. The rest of the 20% requires more than 80% more complexity in the calculations.






The less hypothesis we use in applying statistical hypotheses, the better. That is why non-parametric statistics is better. An exception is our knowledge of the application of the Pareto distribution in various aspects of the market which we is parametric. 

That is why we avoid applying very complicated with many hypotheses and time consuming to estimate models to forecast the markets, but we prefer to respond to the market, by measuring only in a valid statistical way, the average position of the price, and the channel around it, the velocity (trend, 1st derivative) and acceleration-deceleration (2nd derivative)  of the prices. 
The statistical quantities from the front-office in trading need to me measured are 
1) the price position in the channel around the average, 2) the velocity (1st derivative) and 
3) the acceleration-deceleration (2nd derivative), which is done as statistical quantities by a hypothesis test or confidence interval. 
4) The support-resistance levels can be measured also by action-volume histograms.  The measurements are done with convenient indicators, and can also define in a statistically valid way, not only , the channels , the trend, reversal, and
5)  (Eliot) waves but also 
6) the spikes
7) It is required also an in advance in the past measurement and discovery of the basic stable cycles in the markets (see post 5)
8) An in advanced in the past measurement and discovery that trends duration and length, and volumes follow the Pareto distribution (see post 11,25 etc). 
In addition for the back-office of trading we need to measure the 
9) probability of success of trade based on the past history of trades, to apply the Kelly criterion, and also 
10) the average rate of increase of the trading funds and
11)  its variance again from the past history of trading.

The back-office statistical quantities in 9), 10), 11) are related , by simulation as e.g. in the simulator in post 43.

I have also created a simulator to experiment with different rules of withdrawals. 


Everybody would like to know more about  what the market will do so as to trade appropriately with almost certainty, like an arbitrage! But this is not but very rarely the case with the markets. Some press  themselves to guess beyond what is observable in almost ever situation of the markets moves so as to trade with almost certainly and exhaust themselves. The science of statistics  is fair about what it claims it knows with uncertainly and how much uncertainty and what it cannot know at all and such claims are based entirely on the observable by the senses data. ! The science of statistics can draw valuable conclusions with little only information and knowledge about how  really the market will move. But fortunately these conclusions are adequate to make sufficient profits in scientific statistical trading! We may call this realization  the Lean Fair Knowledge of Scientific Statistics.  Even though the science of statistics bases its knowledge entirely on the observable data that are available to everybody, still it is not in the ability of perception of everybody to realize and make directly the same conclusions without some knowledge of statistics. Some people may start their research about the successful trading in the markets more or less knowing the basic statistical behaviour of the markets, but being not satisfied with the Lean Fair Knowledge of Scientific Statistics  search for decades for something more. Most often they will be  failing to find something more, and the reasons is that this Lean Fair statistical knowledge of the markets is a universal  phenomenon , in the way the economy functions and information is distributed and published. The good news is that the Lean Fair statistical knowledge is adequate to make good profits.
The Lean Fair Knowledge of Scientific Statistics of the market based on the previous measurements of price, its speed and its acceleration and a) the statistical momentum conservation,  b) the cycles c) the Pareto distribution of the volumes, because it is a so lean information and abstract behavior so its is also universal for all instruments and for all times and time-frames. That is why it is also reliable but it is also effective in producing profits. On the other hand, more specific hypotheses like of those of the occurrence of the price patterns, or very specific algorithms of trading depend on the time-scale and maybe on particular instruments and may have spectacular results for limited time, while not at all good results after some time! 



THE OVER ALL STATISTICAL BEHAVIOR OF PRICE PATTERNS
We notice that although the price patterns are essentially  4 categories in details there are 6 distinct statistical patterns of the random or statistical position, velocity and acceleration of the prices (see post 32).
A class of stochastic processes can be defined as the behavior of the markets based on these   6 basic patterns P1, P2, P3, P4, P5, P5, P7. The Pi i=1,2,3,4,5,6,7 are essentially random  statistical patterns with random and variable parameters of size duration, and relative analogies that define them. E.g. we may have a Pareto distribution of the duration and price height of the patterns because of the inequalities in the markets. The 7th pattern P7 of stationary behavior  we may call intermittency pattern.  We may then assume a class of Markov processes  with random and variable transition probabilities, where each random type of pattern occurs and then a next one occurs. But the transition probabilities are not arbitrary! E.g. spikes occur usually at the begging (initial spikes)  and the end (terminal spikes) of trends, up and down trends with stationary channels in between them, shape cycles, that in the average of stable period, and some times of fixed beginning and end. 
The probability that a type of pattern occurs changes also according to the time scale. In 2, 5 or more years annual bars time frames, the non-waving trend pattern is dominating, while say in 5-minutes bars time-frame flat patterns are dominating. 
We notice that, by utilizing only pattern P3, of non-waving trend, and intermittency P7 we may derive all, other patterns with appropriate patterns of transition probabilities of the P3! This is because these patterns are essentially combinations of cyclic moves and trends in different time scales, and the cyclic behavior can be derived wit sequences of alternating trends.  I have coded a simulator of such a class of stochastic processes, superimposed on many time frames called Multi-time scales Rainbow Walks stochastic processes. 

This is the overall behavior of patterns of the markets, and there are some invariant properties  like 
1) Cyclic behavior as alternation with up and down trend patterns with flat channels at the bottoms and tops  
2) Statistical momentum conservation (see post 10) where the 1st time-step partial correlation of a price is almost always positive, 
3) A Pareto distribution of the duration and height of the patterns, due to the inequalities of the enterprises in the economic system (see post 10, 25, 57,63 )


There are many who complain that the indicators have lag, and prefer not to use indicators at all, but only the prices. This is rather stupid! The indicators when are measuring a statistical quantity  MUST have lag, because we are not interested for the price at the now only, but in a short-term past horizon too, which defines the statistical momentum which is statically conserved. It is not a race of speed, it is  a challenge of successful perception. The science of statistics is the best for the moment one can have , from the collective scientific thinking, and collective consensus, and we must  be honest and humble to admit is restricted abilities, but also trust , respect it and be confident for the success   when applying it. When we are applying the statistical mode of thinking for the markets, we never run serious dangers of being "burned"and "busted" in our deductions, as statistics claims everything only up to some probability, or probability inequality and intervals.  

There are some also that claim to have "intuitive guessing" about how the markets will move beyond the observable state of the markets. This of course cannot be included easily in  the standard statistical inference. But it seems to me that sometimes, this is in certain human and social environmental conditions is too much to ask from yourself, and it may fire-back to systematic opposite to the actual markets moves guessing! I believe that fortunately pure statistical inference from the observable states of the market only,  may be adequate for very profitable trading.   





THE TOP 6 FACTORS OF ATTENTION IN MANUAL TRADING ARE

1) NEVER USE ALL YOUR FUNDS FOR TRADING.  DIVIDE THEM TO TRADING AND NON-TRADING FUNDS BY THE RATIO f=R/a^2 RULE (see below for this ratio or in posts 3,13,33). THE DIVISION OF FUNDS AT EACH PERIOD IS ADJUSTED TO CONFORM WITH  THIS PERCENTAGE RATIO. NEVER WITHDRAW PER PERIOD FROM THE NON-TRADING FUNDS MORE THAN HALF OF THE AVERAGE PROFITS OF THE TRADING FUNDS PER PERIOD. This division and adjustment of the funds has been applied for many years in buy and hold investments by  professor Michael LeBoeuf. 

2)  THE ONLY CERTAINTY, WHILE TRADING IS ALSO OUR  FIRST PRIORITY: WE MAY DETERMINE THAT OUR LOSSES AT EACH POSITION WILL NOT BE LARGER THAN A SPECIFIED PERCENTAGE DEFINED BY THE KELLY CRITERION (see  posts 3, 13, 33)

3) FOCUS ON MACROSCOPIC INSTRUMENTS LIKE  STOCK INDEXES WITH PERMANENT STRONG LONG TERM TREND OR AT LEAST STRONG AND CLEAR SEASONAL TREND, even if you want to trade at short time scales. (e.g. of the American Economy which is young and strong and indexes like Dow Jones, SnP500, Nasdaq etc).The statistical quantities from the front-office in trading need to me measured are the price position in the channel around the average, the velocity (1st derivative) and the acceleration-deceleration (2nd derivative), which is done as statistical quantities by a hypothesis test or confidence interval. The support-resistance levels can be measured also by action-volume histograms.  The measurements are done with convenient indicators, and can also define in a statistically valid way, not only , the channels , the trend, reversal, and Eliot-waves but also the spikes. In addition for the back-office of trading we need to measure the probability of success of trade based on the past history of trades, to apply the Kelly criterion, and also the average rate of increase of the trading funds and its variance again from the past history of trading.

4) FOR VERY LOW RISK AT OPENING POSITIONS ON THE PREVIOUS INDEXES WITH PERMANENT STRONG TREND, OPEN BETTING UPWARDS, AT TERMINAL SPIKES AGAINST THE TREND. This is the Bill Williams technique. 

5) READ THE NEWS AND FINANCIAL STATEMENTS BUT THE ASSESSMENT OF THE PATTERNS OF THE MARKET REQUIRES THAT IT IS DONE IN MANY SUCCESSIVE TIME FRAMES CHARTS. This is a basic recommendation by Alexander Elder, which, by now, it is a common knowledge to traders


6) BE FLEXIBLE IN RESPONDING TO  THE MARKET AND DO NOT HESITATE TO FOLLOW PROMPTLY ANY UNEXPECTED CHANGES OF THE TREND OF THE MARKET. (This is the Bill Williams psychological "Holy Grail" of trading )

Sunday, January 15, 2017

65. THE IMPACT OF THE CONVERGENCE OF THE GREEK ECONOMY TO EMI IN THE STOCKMARKET: BAYES, NESTED ESTIMATION OF THE STOCK TRENDS

THE IMPACT OF THE CONVERGENCE OF THE GREEK ECONOMY TO EMI IN THE STOCKMARKET: BAYES, NESTED ESTIMATION OF THE STOCK TRENDS


                                                By Dr. Costas Kyritsis
                                    National Technical University of Athens 1999


1. Introduction
The time when an economy enters the first world economy is a very interesting time. It is even more interesting if the group of nations where it enters, in this case European Union, becomes gradually, with respect to some parameters, the strongest economy in the world.
Although the Greek economy is by far not perfect or advanced, there is the firm decision to handle its indices, as much as possible, so as to qualify according to the standards of European Monetary Integration. These standards are set, for the Greek economy, mainly in the next profile:
a) The Inflation rate less than 1.5%
b) The deficit of the Government less than 0.9% of the Gross National Product
c) The national debt less than 100% of the Gross National Product
d) Growth rate of the Gross National Product at least 4.5%.

2. Macroeconomics factors influencing the prices in the Athens Stockmarket
There is no doubt that the previous standards of EMI make a profile of a mature economy and also no doubt that a young state like the Greek  (less than 2 hundred years old) has major difficulties in qualifying in the profile of EMI, before 2001 .It is worth trying nevertheless, even only for the benefit of eliminating the continuous currency devaluation of the national wealth through the exchange rates.
Experience has showed that the basic magnitudes of Macroeconomics that have significant impact on the changes of prices of stocks in the Stockmarket are:
a) The average rate of deposit in the banks, or the rate of change of the time-value of money.
b) The exchange rates 
c) Mass-media information about other economies and changes of prices in other Stockmarkets.
The procedures with which the previous factors influence the changes of prices in Stockmarket is always through the aggregate demand and supply for each stock:
1) Surplus of demand to purchase stocks in the computer waiting lines creates growth of the price of the stock (Bull-market)
2) Surplus of supply to sell stocks in the computers waiting lines creates falling of the price of the stock (Bear-market)
The exact equations of how stochastic demand and supply results in to the random variables of price and volume and their changes, is not an issue to cover in the present paper. It is not of intractable difficulty to formulate though.
We shall state, nevertheless, the basic equations of competition of demand and supply for each stock. The equations of two populations in competition have been a topic of systematic study. It may not be surprising that such equations have been studied and solved not in the science of Economics but in Ecology. They are a standard topic in an area initiated by Volterra and his equations for populations.
Let us denote by x (tn) and y(tn)  the average   value,  at  time   tn  of the  random variable of the volume of orders of the demand to buy and of the volume of  orders of the supply to sell  a stock. The next equations describe the interplay of demand and supply:

(1) x(tn+1)= x (tn)(a-b x (tn)-c y(tn))
(2) y(tn+1)= y (tn)(e-f x (tn)-g y(tn))

The symbols a, b, c, d, e, f. g are constants defining the competition.
Such equations, formulated in continuous time and deterministic mode are the well known equations of competition in Ecology (see e.g. [Maynard S.J] p 59 formula 36).We notice that they are non-linear equations. They have been solved numerically,  studied and applied in many situations of populations in competition .The populations involved here are of the investors who want to buy and those who want to sell .The equations describe the  effect in demand and supply of the automatic negotiation algorithm in the computers waiting lines . These equations if formulated in continuous time they do not involve oscillations. But when formulated in discrete time and as stochastic processes or time series, they do involve  (non-linear) oscillations which is the common experience for anyone that has spent some time in front of a monitor of a Stockmarket company. If we make use of the prey-predator or host-parasitoid , Volterra equations that different from the equations (1), (2) only at a plus sign instead of a minus sign at he coefficient f in (2), then we get  larger scale oscillation.
 During 1997 there was a major impact on the price growth in the Athens Stockmarket of the size, at year base, close to 50% .It is supposed that it was created by the fall  of the deposit rates of the banks (factor a) mentioned in this paragraph ).
During 1998 there was an even larger impact on the price growth of a size close to 70%. It is supposed that it was created mainly by the currency devaluation in the exchange rates decided by the government in March 1998.
As the latter case was the most dramatic, we shall try to analyze it with a new statistical method.

3. Bayes fractal-like nested estimation of time series
As it is known there is a topic in statistics called Bayes estimators. (See e.g. [Mood A.-Graybaill A.F.-Boes D.C.]  pp 339-351). The main idea is that when we have a parameter in a distribution that we must estimate, we may assume as a meta-level that it is already a random variable with an a priori given distribution . For example if we are estimating a Gaussian (normal) random variable N(m,s) we may assume that we have a double variation and a second stochastic level and that the parameters m, s are already Gaussian (normal) random variables with means mm , mand variances Sm Ss  . It is not that we want to make the computations more complicated but that we need to fit a more flexible model to the real situation.
For doubly stochastic time series see  [Tong H.] pp 117-118. We shall describe a general method to refine autoregressive time series models, such that at each refinement, it appears higher order variability and higher Bayes order as discussed above. For the sake of clarity we shall apply it to the Black-Scholes  lognormal model of the prices of stocks .The model is known in stochastic processes and stochastic differential equations as the geometric Brownian motion . (see [Oksendal B.]  pp  59-61 ,198-199 and 223-225 or  [Karlin S-taylor H.M.] pp 267-269 ,357 ,363,385 and [Mallaris A.G.-Brock W.A.]  pp 220-223. It is a linear SDE of constant coefficients and multiplicative  «noise» or innovation.
Although  much popularity is related to  this model, it cannot describe but the «buy-and-hold» situation in the Stockmarket . We may try to vary this model with the idea of Bayes so as to include reversal patterns and price motion with or without resistance. We supplement the idea of Bayes by corresponding to each new stochastic or Bayes level a finer grid of the argument .In this way different models appear to different scale regimes, but still something is repeated thus we follow also the basic idea of self-similarity introduced  graphically by Mandelbrot  with fractals and multi-fractals .
Mandelbrot has applied his idea of self-similar fractals to the Stockmarkets, arguing that much of the oscillating effects of stock prices are not observed in the Black-Scholes model.
There are many new results of qualitative dynamics of dynamic systems under the term «chaos». The ideas are not irrelevant but in order to apply them in a professional way to Stockmarkets we require them in  stochastic differential equations or time series (see [Tong H.])
The idea of nested patterns of «tides» (trend of a year or more) ,«waves» (in seasonal horizon) and «ripples» (day or intra-day oscillations ) goes back to the theory of Dow and Elliot in the Technical Analysis of stocks (see [Murphy J.J.] pp 24-35 ,371-414). [Murphy J.J.] . It is also obvious the relevancy of the Elliot wave theory with Spectral Analysis and fast Fourier transformation in time series.
The way to enhance the «buy-and-hold» model of Black-Scholes is as follows:
1) We define a nested system of grids in the time argument .For example starting with an horizon of a year we partition it to smaller seasonal horizons (e.g. 60 Stockmarket days). We may continue in this way to monthly, weekly and finally daily horizons .
2) For the first one year horizon we perform an ordinary estimation of the Black-Scholes model .It gives the buy-and-hold trend.
3) In the seasonal horizon we increase the Bayes stochastic order. For each season in the one year horizon we estimate a second Bayes order model. The four seasonal models are pasted automatically to a more flexible overall model than the Black-Scholes
4) We continue to increase the Bayes order by one for each finer horizon, of a month, a week or a day and we estimate a new model for each smaller horizon.
The resulting time series fits pretty well to the real life surprises of the Stockmarket .
The method resembles the splines in numerical analysis only that it is not performed on polynomials and the models are not deterministic but stochastic.
A good question is how we increase the Bayes order. A simple method is to consider the constant coefficients of the initial model as varying linearly relative to time. This introduces for estimation new constant parameters .At each finer grid we assume the previous constant parameters as varying linearly and we estimate the new constant parameters.
In the next paragraph we shall perform the method at two only horizons of one  year and a seasonal of 60 Stockmarket  days .




4. An example: The impact of  the currency devaluation  in the spring of 1998.
As we mentioned in the previous paragraph the Black-Scholes model of the prices of stocks is the geometric Brownian motion in other words defined in continuous time by the stochastic differential equation:
(3)   dx=rxdt+σxdz.
Where x is the price of the stock and z is a Brownian motion.
In this example we implement the discrete time, non-homogeneous time-series version defined by the equation
(4)     xn+1=(r+s en )xn

We make use of a close relative to it, which is the next time series in explicit form:

(5)  xn=exp(rn+sen)
Where eis a normal error or innovation. We do not insist on any stationarity assumption.
We make the  assumption that the «noise» or innovation term  is additive in the exponent  instead of multiplicative and of constant variance, that is, an homoskedasticity assumption that makes the variance of the residual, in the exponent, constant in time.
This simplifies the estimation of the parameters of the time series
The application of the original model of constant coefficients for an one year horizon is straightforward and is very well known. We proceed with the nested Bayes estimation that we described in the previous paragraph .We assume for the four seasonal (3-months) horizons of one year that the model has variable coefficients and that the coefficients vary linearly with respect to time. This introduces new constant coefficients a, b in (5) :        (rn= an+b)
The exponent becomes now quadratic with respect to time.
(6)  xn=exp((an+b)n+sen)
More generally we estimate the equation
(7)   xn=exp((an+b)n+c+ sen)
We notice that the equation is almost the normal curve except of a linear term or sign reversal.
To estimate it we take the logarithm of the prices and apply polynomial regression.
The exponent is in general an at most quadratic polynomial .If the coefficient of the quadratic term is negative, we have an instance of an almost Gaussian (normal) curve, which is interpreted as follows:
1) Increase of the prices with an asymptotic upper resistance, which becomes a reversal pattern (first part of the curve)
2) Decrease of the prices with an obvious asymptotic lower resistance at zero, thus practically without resistance (second part of the curve)
If the coefficient of the quadratic term of the exponent is positive then the probable cases are:
3) Increase of the prices very fast (faster than the simple exponential growth) without upper resistance (second part of the curve)
4) Decrease of the prices with lower asymptotic resistance that becomes a reversal pattern (first part of the curve)
Thus the qualitative dynamics of the stock at each time are described by the above four dynamic states
The results of the least squares estimation of this linear model with  time variable coeficients are given below.
The  estimated model between the dates 10/03/1998 (n=1) and  05/06/1998 (n=60),that is 60 Stockmarket days is
(8)  xn=exp(((-0,00025)n+0,023223)n+7,317873+ en)
The maximum of the normal curve occurs in the day n=47 that is in 19/05/98.
In this date the model gives a clear selling signal .Of course we cannot trade with the general index .But it would give one if we had applied it for a particular stock . The author scored  code in visual basic in Excell in order to analyse the buying and selling signals during the year.The results were quite positive for forecasting .For further analysis of optimal trading se bibliography below from BREIMAN L.1961 to  GENCAY  R. 1998.
The variance of the residual and the goodness of fit are given below:
(9) S= 8409,733584
(10) R= 92,62713729
The reader should be warned nevertheless, that a high goodness of fit of a forecasting model, for a particular short time interval, as the above, is not adequate for a repetitive,  trading based on it and for a long time (years). For a model to be used for repetitive trading and for a long time (years), it should be tested that for the goodness of fit at repetitive forecasting does remains high for long times intervals, that must me at least 2 to 5 years, but even better 20-25 years.
In figure 2 we have an superimposed form the general index and the estimated normal curve for the seasonal horizon of 60 days .
In table 1 they are given the numerical data of the chart .As soon as we have estimated the model by continuing it in a resaonable forward horizon we have an effective forecasting .The forecasting is corrected at best every day so that the buing or selling signals are with minimum time delay .
We have used data of closing daily prices and not intra-day data .
The Bayes nested estimation can be extended for shorter horizons and the exponent becames a polynomial of  order  higher than the  quadratic .

 Figure 2






Table 1
                                                            
                                               
                Date
General Index
Normal Smoothing
Date
General Index
Normal Smoothing
10.03.1998
1542,017
1517,54
24.04.1998
2437,958
2473,98
11.03.1998
1577,069
1531,26
27.04.1998
2456,469
2300,71
12.03.1998
1612,116
1543,62
28.04.1998
2473,89
2445,80
13.03.1998
1647,124
1537,37
29.04.1998
2490,196
2511,56
16.03.1998
1682,055
1649,69
30.04.1998
2505,364
2621,44
17.03.1998
1716,873
1737,37
04.05.1998
2519,372
2602,82
18.03.1998
1751,541
1754,93
05.05.1998
2532,2
2634,54
19.03.1998
1786,021
1861,73
06.05.1998
2543,827
2582,62
20.03.1998
1820,275
1919,91
07.05.1998
2554,239
2509,78
23.03.1998
1854,263
1950,75
08.05.1998
2563,418
2450,16
24.03.1998
1887,948
1922,86
11.05.1998
2571,351
2358,15
26.03.1998
1921,289
1992,81
12.05.1998
2578,028
2438,39
27.03.1998
1954,248
2063,32
13.05.1998
2583,437
2494,66
30.03.1998
1986,784
2083,89
14.05.1998
2587,571
2494,70
31.03.1998
2018,857
2005,80
15.05.1998
2590,423
2469,84
01.04.1998
2050,429
1988,78
18.05.1998
2591,99
2500,44
02.04.1998
2081,46
1995,00
19.05.1998
2592,269
2493,70
03.04.1998
2111,91
2063,50
20.05.1998
2591,259
2547,01
06.04.1998
2141,741
2135,31
21.05.1998
2588,963
2573,98
07.04.1998
2170,914
2129,08
22.05.1998
2585,383
2606,48
08.04.1998
2199,391
2124,76
25.05.1998
2580,525
2669,76
09.04.1998
2227,134
2157,39
26.05.1998
2574,396
2621,33
10.04.1998
2254,106
2158,12
27.05.1998
2567,005
2523,03
13.04.1998
2280,27
2255,81
28.05.1998
2558,364
2549,07
14.04.1998
2305,593
2266,35
29.05.1998
2548,484
2591,03
15.04.1998
2330,037
2339,28
01.06.1998
2537,381
2536,09
16.04.1998
2353,571
2448,55
02.06.1998
2525,071
2551,47
21.04.1998
2376,161
2627,90
03.06.1998
2511,571
2581,24
22.04.1998
2397,776
2623,39
04.06.1998
2496,903
2567,21
23.04.1998
2418,384
2618,65
05.06.1998
2481,086
2562,82

References
[Azariadis C.] Intertemporal Macroeconomics  Blacwell  1993
[BLACK f.sCHOLES m.]  The pricing of Options and Corporate Liabilities  Journal of Economic Theory 10 pp 239-257
[BREIMAN L.].(1961) Optimal gambling Systems for Favorable Games Proc.Fourth Berkeley Sympos. on Mathematics Statistics and Probability ,University of California Press ,Berkeley 1,pp65-78.
[BROER D.P.-JANSEN W.J.](1998) Dynamic Portfolio Adjustment and Capital Controls: An Euler Equation Approach Southern Economic Journal 64(4) pp 902-921.
[Constantinides G.M.] (1979) Multiperiod consumption and investment behavior with convex transaction costs Management Science Vol. 25 No 11 Nov.,pp1127-1137
[DAVIS M.H.-NORMAN A.R.] (1990) Portfolio Selection with transaction costs Mathematics of Operations Research Vol. 15 No 4 PP 676-713
[DIMOPOULOS  D (1998)] . Technical analysis ,Eurocapital  Pubications
[DUFFIE D.-SUN T.](1990)  Transaction costs and portfolio choice in a discrete-continuous time setting Journal of Economic Dynamics and Control 14 pp. 35-51.
[DUMAS B.-LUCIANO EL.](1991) An exact Solution to a Dynamic Portfolio Choice Problem under Transaction Costs.The Journal of Finance Vol. XLVI No2 pp 577-595.
[ELLIOT,R.N.] (1980) The major works of R.N. Elliot ,Chappaqua (edited by Robert Prechter) NY:New Classics Library .
[ELTON E.J.-GRUBER M.J.] (1991) Modern portfolio theory and investment analysis Wiley.
[FROST ,A.J.-PRECHTER R.R.](1978) Elliot Wave Principle key to stock market profits. Chappaqua  NY:New Classics Library .
[GENCAY R.](1998) Optimization of technical trading strategies and the profitability in security markets. Economic Letters 59 pp249-254.
[Hair-Anderson-Tatham-Black] Maltivariate Analysis  5th edition Prentice Hall 1998
[Hamilton J.D.]  Time Series Analysis ,Princeton University Press 1994
[Kloeden E.P.-Platen E.-Schurtz H.] Numerical Solutions of SDE Through Computer Experiments  Springer 1997
[Karlin S-taylor H.M.] A first course in stochastic processes. Academic press 1975
[Lambert H.Koopmans] The Spectral Analysis of time series Academic Press
Probability and mathematical Statistics Vol 22 1995
[Lutkepohl H.] Introduction to Multiple Time Series Analysis Springer 1993
[Magee J.] Technical Analysis of Stock Trends New York Institute of Finance 1992
[Mallaris A.G.-Brock W.A.] Stochastic Methods in Economics and Finance North-Holland 1982
[MAynard S.J.] Models in Ecology                      Cambridge University Press 1979
[MERTZANIS CH.] Limit of prices and variance of the general index in the Athens Stocmarket Proceedings of the Conference of the Institute of Statistics 1998
[MILLIONIS A.E..-MOSCHOS D.] Information Efficiency and application in the Athens Stockmarket. Proceedings of the Conference of the Institute of Statistics 1998
[Mood A.-Graybaill A.F.-Boes D.C.] Introduction to the theory of Statistics McGraw-Hill 1974
[Murphy J.J.] Technical Analysis of the Futures Markets .New York Institute of Finance
[Nicholis D.F.-Quinn B.G.] Random coefficients autoregressive models:an introduction .Lecture Notes in Statistics No 11 Springer NY.   
[Oksendal B.] Stochastic Differential equations Springer 1995
[PAPADAMOY S.-PAPANASTASIOU D.-TSOPOGLOU] Research on the predictability of the stocks in the Athens Stockmarket. [ScarthM.W.] Macroeconomics  Hancourt Brace &Company Canada 1996
[SPANOUDAKI I.-KAMPANELOY A.-ANTONOGIORKAKIS P.] Volume indices in the technical analysis of stocks.Monte-carlo empirical results. Proceedings of the Conference of the Institute of Statistics 1998
[Tong H.] Non-Linear Time series :A dynamic System Approach Clarendon Press Oxford 1990