Tuesday, May 9, 2017

68. THE 4 GREAT SIMPLE PRINCIPLES OF LONG TERM SUCCESSFUL TRADING (with margin)

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!

There is a story that an artist, a painter, was praying to the God with the next words. 
"Dear God, please help me for a greatly inspired artwork. Let me take care of the large quantity of efforts, and many paintings , but please  you take care of the quality in at least a few of my  paintings".
This is related with another saying which goes like this "More than 80% of the results in a project come from less than 20% of the efforts and work!"

A trader may try and experiment with trading for many years some times more than one decade, and he may lose a lot of money till he learns what to avoid and how to gain systematically. His attempts for gain must be a journey towards financial freedom. A financial freedom that strictly speaking all should have the right to it e.g. through a guaranteed subsidy and income for survival. But only very few countries provide such a subsidy, as a basic human right, like e.g. the right to have public health insurance.
A trader also should try to make wealth only till the media of the Pareto or lognormal distribution of the wealth in society. Because until that level he is in right and contributes to lessening of the economic inequality that makes the society to suffer. making wealth above the median is of reverse morality, and contributes to increasing the increase of the economic inequalities. 

After more than 20 years of studying the markets, from the point of view both the scientist and the investor and also after investing and trading, I concluded that there are 4 divine simple principles for the successful and safe trading. These 4 principles are based on sound statistical valid verification, for more than half of century of the behavior of the capital markets. I state them and I comment more about them


THE VALID AND COLLECTIVELY ACCEPTED SCIENTIFIC STATISTICAL  METHODS GIVE A COLLECTIVELY SUPPORTED NON-BETRAYING AND SUSTAINABLE WAY OF BELIEVING, THINKING FEELING AND ACTING, IN OTHER WORDS A VALID AND NON-BETRAYING CREATIVE PATH, SO THAT NO MATTER WHAT THE MARKET DOES AND HOW IT BEHAVES , WE ALWAYS HAVE A VALID WAY TO INTERACT AND RESPOND TO  IT WITHOUT INVALIDATING OUR PRACTICE AND SO AS TO SUCCEED IN THE LONG RUN IN THE REQUIRED GOALS. 


PRINCIPLE 1. 
PERMANENT CONSTANT GROWTH
The indexes of securities have a constant long-term (many decades) growth. This is also the basic assumption of the portfolio theory of the Nobel prize winner H. Markowitz. Measurements of index securities along some decades definitely prove the existence of this permanent growth, which is, after all, an artificial growth of the index rather than a particular enterprise of a security. The alignment with the collective optimism of the growth of the totallity of enterprises  is a basic social metaphiscal know-how for the succesful trading.

 ( From 1950 to 2000, for the American stock indices we discover the next statistics:
 1) There are 12 periods of 3.7 years, that the index grows more than 100% 
 2) There are 11 periods of about 9 months (continuation pattern or standing wave of 3 months half period) that the index goes does about 25%-30%.)

PRINCIPLE 2.
EXISTENCE OF CYCLES  MODULATING TO NON-MARHALLIAN DEMAND-SUPPLY COUPLING..
It is crucial to realize that such cycles may emerge in the price changes , in a random way with a hazard rate of appearance at each period , and furthermore that they may appear not directly on the prices changes but on the rate of growth of prices.We must make clear here that we are not talking of exact periodicity but rather for randomly emerging temporary periodicity.  And the  most predictable effect modulated by such cycles is the reaction to an super-exponential moves (a blow-up at the end of trend in the form of super-exponential move or terminal spike).  (See e.g. https://www.ted.com/talks/didier_sornette_how_we_can_predict_the_next_financial_crisis    and http://www.er.ethz.ch/ Such super-exponential terminal patterns of trend may occur usually as result of overgrowth  of the one of the two populations in a demand-supply coupling rather that of domination and not so much of competition or cooperation. See also post 22. For the case of stock indexes, the predator is the fear and population of sellers, while the prey is the optimism and population of buyers. The frequency of emergence and the size of such  super-exponential blow-ups follows the law of inequalities in other words the pareto or Lognormal distribution and is thus by far more often than pure randomness would predict! ). The  indexes of securities have a statistical periodicity of 1-2 days, , 1 month (accounting period and publication of statistical data) with sub-cycle of 10 days with half period moves of 5 days, seasonal (3 months, that financial statements are published) 5,5 years, 11.2 and 22.2 years ( business cycle of the Nobel prize winner S. Kuznets, but also the 22.2 solar cycle of the climate and its effect on the growth in ecology and nature). Careful spectral analysis also proves this fact. Such cycles have a celestial origin, and mainly solar origin. Even the weekly moves of 5 days as half-period moves of 2-weeks sub-cycle of the month are correlated to the 2-fold Parker spiral shape (heliospheric current sheet) of the magnetic field of the sun. (See also http://cycles-of-light.blogspot.gr/2016/09/2-12-celestial-cycles-of-light-in-our.html ) Faster period cycles than the 5 days and 1 day, do exist (e.g. Helioseismological cycles of 3 hours, 1 hour and 5 minutes) but are not strong solar cycles and so also the emergence of such price types of periodicity are not so significant. It is a fallacy to assume that the markets have a self-similar behavior as the fractal theory assumes. By far, the fastest significant celestial cycles are the 1 days and 5 days.  
From the  cycles (see post 5)  (not including their harmonics, that is their sub-multiples of the periods) the order of intensity of effect on the price movements, and therefore the order of predictability also is approximately the next:

Daily (1 Day earth)>> 
Year (12 months, earth)>> 
11 years global climate (Sunspots) >> 
Month (4 weeks, sun+moon)>>
2 weeks solar magnetic cycle (Parker Spiral)>>
160 mins Helioseismologic cycle >>
55 mins Helioseismologic cycle>>
5 mins Helioseismologic cycle.
THUS THE ORDER OF BETTER PREDICTABILITY IS 
1) LONG TERM PERMANENT TREND

2) A CYCLE IN THE ORDER OF PREDICTABILITY DESCRIBED ABOVE AND REALIZED AS REACTION TO SUPER-EXPONENTIAL TERMINAL MOVE (OR SPIKE).


PRINCIPLE 3 (FRONT-OFFICE RISK MANAGEMENT)
CONTROL OF THE MAXIMUM LOSS PER TRADE RELATIVE TO THE FUNDS. PORTFOLIO OF GRID-POSITIONS TO HANDLE THE RANDOMNESS OF THE PATH OF PRICES
Any trading with margin (e.g. of futures or CFDs over the index of securities) must apply the Kelly rule of the percentage of risked funds. This rule also allows for an appropriate decreasing increase of escalation of the size of the open position during the development of the vector of a cycle, as soon as by trailing the percentage of risked funds of the previously open position so far, the risk of individual positions but also in total all of them that have not yet mad break-even, is made zero or always less than a specified percentage of the funds (e.g. 5%-6%). 
The best way to handle the risk of the randomness of the path of prices is to create a portfolio of positions based on the sieve of a dense price grid (open pricely) or open timely (on elementary position per bar) .

PRINCIPLE 4 (BACK-OFFICE RISK MANAGEMENT)
OPTIMAL SEPARATION OF THE FUNDS TO RISKED AND NON-RISKED AND WITHDRAWALS RULE.
Any consumption by withdrawals of the funds, monthly or annually, must follow the rule of optimal separation of traded and non-traded funds, of the portfolio theory. If the actualized risk of the trading as appearing on the growth of the funds is sufficient low, then by the formula of optimal separation we may  have 100% of the funds as traded funds, otherwise we will have less than 100% of the funds as traded. Usually for the American indices , the risked funds as margin should not exceed  about 2/3 of the total funds.  The withdrawals per period  is at most 50% of the period profits of the traded funds. We reset the separation percentage of traded and non-traded funds daily for the cycles and annually for the constant trend position. 




The true abundance of the growth of the funds is found not on the existence of cycles (principle 2) but in the dynamics of the long term trend (principle 1) and the escalation of the nominal leverage of the portfolio of the total positions after following carefully the two risk management principles 3 and 4.




COMMENTS

1) From the principles 1, 2 we have as the only basic patterns of the price moves, that of constant growing trend, and that of  almost cyclic behavior or cyclic with intermittent non-cyclic time intervals. We may form an optimal portfolio of trading of 4 different position sizes , on the same index of securities based on the 1 constant trend and the 3 fastest cycles above the period of the day. If we want to make a portfolio on the e.g. the 3 indices of Dow-Jones, SnP500 and NASDAQ, that will maximize the Sharpe ratio R/s (where R is the period rate of return and s its standard deviation) then , e.g. by measuring from 2009-2017 monthly rates of return, and calculating the co-variances, we results in an optimal portfolio of 29%  of Dow-Jones, 31% of SnP500, and 40% of NASDAQ.  Also the optimal separation to risked and non risked funds, that will maximize in a finite time interval the logarithm of the final value of the portfolio, gives as optimal percentage of funds the R/s^2 (see also post 3) which here it is 86.5%. Nevertheless if we would measure it with annual rates of  return rather than monthly and for many decades back this percentage would be closer to 66%. 

2) The requirement to take advantage of the constant growth trend, restricts the instruments for trading with margin (e.g. futures or CFDs) , to those of indexes of securities , excluding therefore commodities, forex and currency indexes. And we prefer index of securities rather than securities because the index has a guaranteed permanent growth , while a security has only a growth only during young age of its life-cycle. 

3) The constant trend may reverse for a couple of years during strong crises, and during such times the cyclic behavior say of 1 or 2.75=5.5/2 years  is stronger than the constant growth. Waves at the seasonal periods (3 months) are connected to what technical analysis calls continuation patterns, in other words flat channel of standing waves, where the market has not decide yet if it is going to continue increasing prices, or will start for a couple of years to decrease prices. The waves at the period of month or shorter  appear usually as if random noise to the constant trend. From 1950 to 2000, for the American stock indices we discover the next statistics:
 1) There are 12 periods of 3.7 years, that the index grows more than 100% 
 2) There are 11 periods of about 9 months (continuation pattern or standing wave of 3 months half period) that the index goes does about 25%-30%.

4) The 2nd principle of cyclic behavior , is stronger that the usual methods of technical analysis, because, it sets specific times of staring and ending of the periods. It is a non-phenomenological principle, with source of causes , far before the shaping of the demand-supply interplay. The latter is modulated by the causes of the cyclic behavior.
The easiest cycles to observe is the monthly cycle. Then the 5,5 years cycle. Then the seasonal or 3 months cycles, and finally the short term of 5 days and 2 days. But among the various cycles what is readily measurable us a super-exponential bubble usually of seasonal period (3-months) , but sometimes of 1 months. We need to take the logarithm of the prices and apply a least squares line to observe the cycles, especially the extremity of the super-exponential bubbles.  
By far the constant trend is the pattern that makes most of the money, after the leverage and appropriate risk management. The the second best is the spontaneous super-bubbles at some period of the above faint cyclic behaviors. 


Here in the chart below which is with the prices after taking the logarithm, we may watch deviations from the linear moves (super-exponential moves) and their highly predictable reaction lasting in the average 3.75 years. during 30 years!





5) So we look for cycles and we trade along the constant trend  preferably starting only, when a terminal spike against the constant trend appears (the terminal down spike may be at a daily chart but usually it is a whole month going down!) . To realize the emergence of cycles and vectors of them, we only need also to measure statistically the derivative (velocity) and second derivative (acceleration-deceleration) of the prices. But the simplest is the duration of the half-period. We set an initial stop-loss of about 1/3 of the amplitude of the cycle, with position size that is defined by the Kelly rule, of percentage of funds to risk at each trade. We trail by about a quarter of the period. We close the trade after about a half-period of the cycle or again if after one month down move a second continues again down. But as we mentioned in 1) we have a small portfolio of trades at 3  different periods of 3 different cycles and one permanent position  for the constant growth. For the latter position , we buy or sell annually to keep constant the optimal percentage of separation of risked and non-risked funds, corresponding to this position.

6) For the formula of the Kelly rule see post 13 (also  https://en.wikipedia.org/wiki/Kelly_criterion)
where:

  • f* is the fraction of the current bankroll to wager, i.e. how much to bet;
  • b is the net odds received on the wager ("b to 1"); that is, you could win $b (on top of getting back your $1 wagered) for a $1 bet. In trading it is  the multiples of the stop-loss , that will be the gain of the trade.
  • p is the probability of winning;
  • q is the probability of losing, which is 1 − p.
There is also the formula f=(p/a)-(q/b) , where p, and q as before but a, b are interpreted as follows. If you win (probability p), having bet or exposed 1 unit of funds you result to  1+b funds , and if you lose (probability q) you result with 1-a funds. In the case a=b=1 we have the previous solution f=p-q. 
From the previous in the first formula above we see that the higher the b is from 1, the less requirements for high probability of success. The less the b from 1, the more demanding are the probability of success of a trade thus the more difficult is to trade successfully. This is why having a Stop-loss (SL)  much ,less than a take profit (TP) , it is better and it will give a positive average profit even with only a 50% probability of win. E.g. with p=q=0.5, and  with SL=(1/2)TP, then b=TP/SL=2 the average profit will be 0.5*SL, while the SL is optimal to be 0.25 of the exposable funds, with average profit 0.5*0.25=0.125 of the funds.

Since the probability of success of trade p, can be measured only after a sample of trades, it is required a starting percentage f* of funds to risk in a trade (in the case of losing based on the stop-loss) which is usually set equal to 2% of the funds, (corresponding to the Kelly formula for b=1, and p=51%). Later when at first a probability p can be measured from the back-office of the sample of past trades, we may set b=1, and even later, we may also estimate a b from the set stop-losses and the profits of the trades.

The Kelly rule also may suggest that is may be sufficient profitable and easier to trade at larger scale, where the cyclic patterns are more clear and with higher probabilities of prediction/ E.g. if for a daily  cycle the probability of prediction of the cycle to integrate is even 51% only , and we set a stop-loss SL at 1/3 of the amplitude, with take-profit TP=A, then the expected profit is 0.51*A-0.49*A/3=0.346*A. While the optimal percentage of funds to expose is at most 34% only. But if at a weekly or monthly scale the probability of the cycle to integrate is higher , say 60%, then with the same settings, the average profit is 0.6*A-0.4*A/3=0.466*A, while the optimal percentage of funds to expose is at most 46%. Notice that we say at most 34% and at most 46% and not equal because , we are not only interested in the maximum speed of growth of the funds, but also with constraints of risk of at bankruptcy at most  at a level, which requires less percentages.

When the percentage of risked funds is f, and [f] is the integer part of it, while q=1-p is the probability of loss of each trade then the probability s of bankruptcy is s=q^[1/f] =(1-p)^[1/f] ( ^ is raising in power). E.g. if the risked funds is 2% and the probability of success of trade is 0.51, then a bankruptcy may occur if we lose [1/0.02]=50 times in sequence which has  probability  0.49^50=2.2*10^(-16), which is very small! 

7) For the optimal separation of traded and non-traded funds as we utilize it here, we take as maximization rule the logarithm of the final funds at the end of a time interval. See [1] below. If the risk-less non-traded funds have zero deposit rate of return, then it is proved that the percentage of funds to trade is R/σ^2 if it is less than 1 and 100% if it larger than 1. Where R is the rate of increase per period of the traded funds and σ the standard deviation of R. For the formula R/σ^2 of the optimal separation see post 3  or [1](also http://www.albany.edu/~bd445/Economics_802_Financial_Economics_Slides_Fall_2013/Separation_Theorem.pdf , 
[1] "Stochastic Differential equations" by B. K. Oksendal (Springer editions) page 223, example 11.5 . 
[2] James Tobin. Liquidity preference as behavior towards risk. Review of Economic Studies, XXV(2):65–86, February 1958. HB1R4.)
In general if the risk-free rate of return of  non-traded funds is Rf, then the formula is 
(R-Rf)/σ^2
As a default starting separation percentage we may set 2/3 of the funds as traded, and 1/3 of them as non-traded. (This corresponds to an assumed initial annual rate of return of the funds of 10%, with standard deviation of it 36%, which is the usual for buy-and-hold of securities).

8) Principles 3) and 4) make the magical mix of high risk of uncertainty, with the low risk of certainty (of non-trading) producing the psychologically and economically acceptable and safe risk of uncertainty. Principle 3) is doing it at the frequency of every trade, while principle 4) is doing it at the frequency of withdrawals (annually usually). Since in principle 4) the separating of the funds to non-traded and traded is clearly of information nature and does not require transaction costs , it can be done daily, but it will take effect at every new trade, and mainly it will become highly effective each time we withdraw funds for consumption. The adjustments of principle 3) are effective obviously at each new trade. 

9) We may compare the above techniques with the  legendary Turtle trading system of the 80's (See also the book by M. W. Covel "The Complete TurtleTrader")
At the decade of the 80's it was a legend the systematic profits in the markets and even in the commodities of the turtle trading system. Actually there are the fast or monthly  and the slow or seasonal turtle trading systems. The fast turtle trading system opens positions at the break out of the 20 days Dochian channel (in other words at breakouts of the maxima or minima of 20 days bars) when the previous trade was not a win. Notice that the turtle trading system misses a significant entry at the highs of the bars of the  down spike  waves of the 20 days Dochian channel as B. Williams and even A. Elder suggest with his 2-days force index! This spike may appear as spike in th weekly or nomthly charts although only as a move with high slope in the daily charts. Definition of the start of seasonal trend within a constant tidal-trend by a spike makes the hysteresis of the measurement of a seasonal trend zero!  It pyramids or escalates at N/2 price volatility intervals ,(see post 44 for the definition of N by the 20 days ATR, and with position size so that N price change corresponds to 1% change of the funds of  the account). As an optimization we may prefer the psychological levels of decimal system , that is by intervals of 100 or 50 points.  E.g. in the index NASDAQ and Dow-Jones the 50 points are closest to the N/2 changes while in the index SnP500 10 points are closest to the N/2 changes. From this point of view the turtle-trading is a Grid-trading. A grid-trading like a sieve creates a portfolio of a large number of positions that handles the randomness of the path of prices in the best way. The idea of escalation is of course to build gradually the position with densest reasonable grid, so as to risk always not more than an optimal little , here the 1% and then eliminate this risk with a break-even and proceed escalating as much as the margin and risked stop-loss allows in the available funds, while remaining at a quite early position of the total trend-move. Notice that the turtle trading is missing here that the escalation is done also with less risk at the   down waves of the Dochian channel as A. Elder  suggest with his 2-days force index. !  The initial stop loss but not subsequent trailing is at 2N (thus 2% of the funds)  price interval. When  a new position is opened , the next day and in general the first next day that it is possible we to move the initial stop loss to a break even. In order to keep total position risk at a minimum, if additional units were added, the stops for earlier units were raised by 1⁄2 N (trailing). This generally meant that all the stops for the entire position would be placed at 2 N from the most recently added unit. However, in cases where later units were placed at larger spacing either because of fast markets causing skid, or because of opening gaps, there would be differences in the stops.  The System has an alternate stop strategy that resulted in better profitability, but that was harder to execute because it incurred many more losses, which resulted in a lower win/loss ratio. This strategy was called the Whipsaw.   Instead of taking a 2% risk on each trade, the stops were placed at 1⁄2 N for 1⁄2% account risk. If a given Unit was stopped out, the Unit would be re-entered if the market reached the original entry price. If the position does not close by stoploss , an exit rule is that it is closed if prices hit the opposite side of a 10 days Dochian channel. This fast system obviously is tracking and utilizes the monthly cycles. The slow turtle trading system is the same as the fast except as entry rule is used the 6 weeks or 55 days Dochian channel with exit by 20 days Dochian channel.. This system system utilizes seasonal cycles of 55-60 days. The turtle system was utilized mainly in the commodities markets. 
 There is also the faster "Parker-spiral"  variation of the monthly turtle trading system where it is  utilize the 10 days Dochian channel with exit by the 5 days Dochian channel.
We may notice that the Bill Williams system is approximately as the seasonal turtle trading, except that the initial entry (of long positions) is only at a (down) terminal spike so as to have less risk at the initial stop loss which may be way less than N/2, and  that the escalation is decreasing and not of constant rate, while it is avoided as the seasonal trend while still with positive first derivative it acquires nevertheless negative second derivative. Also the trailing-out is not by the 20 days Dochian channel but by the 5 days Dochian channel. 
Alternative better exits can be timely rather than pricely, based on the timing of the half-period moves of the 5D, 10D and 30D or 6 weeks (See principle 2 above) for the seasonal turtle trade, or 10 days for the monthly turtle trade, and 5  days for the "Parker-Spiral" turtle trade. We may also combine timely exits with an at least  80% trailing of the floating profits at each position. Notice that in general an exit-trailing rule based on percentage of floating profits for each position e.g. 66%, 80% etc (individual position not group of positions profits) will create a portfolio of different speed of trailing-outs which like a portfolio of time-scales of turtle trading, thus more robust to the risk! Older positions stay more in fluctuations while new positions may close and reopened more often.
Portfolios approach to handle more risk.: The best way to handle the uncertainty that a single index may exhibit, is to implement a portfolio of 33% allocation of the funds for all the three different cycles and time-scales of  the turtle trading, namely Parker-Spiral cycles, Monthly cycles, and Seasonal cycles. The fact that all these turtle systems use charts of the daily bars and same parameters of initial stop-loss , and escalation, based on N, helps even better for the portfolio of trading systems.
Also a portfolio on the 3 indexes Dow-Jones, SnP500, and NASDAQ by 29%, 31% and 40% respectively is  a better practice that trading just one index of them, e.g. only NASDAQ. 
As the above system of turtle trading (with the extensions based on the A. Elder system, B. Williams system, break-even, decimal price levels of escalation, and cycle based timely exits) is quite solid-complete and deterministic in conduction, probably the only discretion is 1)  the percentages of allocation of the above two portfolios of 3 indexes and 3 time scales and 2) the adding or not based on the strength of the first derivative of the seasonal trend, and sign of the second derivative or the percentage of the half-period of the relevant cycle (5D, 10D, 30D). 
For the profitability of  manual such conduction on daily bars, we may notice that for strong seasonal trends, there may occur a more than doubling of the funds within a season (that is about 25% per month) if the utilized margin-leverage by CFD's is 200 or more while with ordinary margin-leverage of 20 of futures contracts is at least 10 times less, that is about 2.5% per month, as recorded by many turtle-traders since 1980. For non-leveraged trading it is hardly worth the time and effort compared to buy-and-hold investment.  \When the constant trend-tide is absent and the market is in a seasonal stationary-continuation pattern, practically the profit for one or more seasons may be zero.



Here we summarize an enhancement and improvement of the turtle trading, based on the above remarks from the systems of A. Elder and B. Williams and my discoveries of random celestial cycles in the markets. We may call it the 3-cycles turtle-grid  portfolio  system, or in short THE CELESTIAL SIEVE.
The perception and conduction of the system is 4-fold, and it is applied on daily bars.
1) (TIDE) At first we have identified in monthly (and weekly) charts the perpetual constant trend or tide (usually lasting at least 2 or 3.7  years , principle 1 above in post 68 ) on the 3 indexes Dow-Jones, SnP500, and NASDAQ. For the sake of simplicity in writing we assume it here that it has been identified as upward, good for long positions.
2) (WAVE) Within that, occur seasonal moves with trend, that start after a seasonal continuation flat channel pattern or  by a down spike in the weekly or monthly chart , whichis about one month down so no momentum measurement hysteresis is necessary in detection (B. Williams). Such moves  end timely (principle 2 above in post 68 ) (5D, 10D, 30D) or by going to zero of the 1st statistical derivative with earlier sign negative 2nd statistical derivative or by a  terminal spike or by a down spike that results to  one month down move and the second month continues down! They also may start usually by timely pattern recognition, that is as reactions  of same half-period  (5D, 10D, 30D) moves in the opposite (down) direction.The  most predictable effect or pattern , after the long term permanent trend , modulated by such cycles is the reaction to an super-exponential moves (a blow-up at the end of trend in the form of super-exponential move or terminal spike).
3) (ENTRY, STOP-LOSS , ESCALATION)
We open positions up at the starting spike (B. Williams) or backwards ripples signals by the 2D force indicator (A. Elder) or forwards break-outs of the decimal based N/2 grid (Turtle trading, and fractals by B. Williams) or even simpler we open timely that is at every daily bar one (elementary) position , as long as the total virtual exposure, by open positions that have not yet have break-even , as percentage of the funds is upper bounded (e.g. 5%-6%) and the open positions are with initial stop loss between 2N, N, or N/2 , when N by the appropriate position size is 1% of the available funds (principle 3 above in post 68) . We do not open positions by the Grid if the 2nd statistical derivative is negative or the 1st statistical derivative close to zero, or timely (principle 2 above in post 68 ) we are more than 80% of the duration of a half-period that is 5D, 10D, 30D etc.
4) (EXIT, TRAIL-OUT). We trail-out either timely (Turtle, B. Williams) e.g. 5D, 10D, 30D or pricely (A. Elder) by X% of the floating profits (which is better as it creates a portfolio of time scales and positions) e.g. 50%, 66%, 80%, 90%  which may be changing and increasing as the seasonal trend reaches its maturity etc
or we close timely (principle 2 above post 68) by expiration or maturity of half-periods e.g. 5D, 10D, 30D etc or a down spike of one month and the second month continues down. 


Therefore 
1) by knowing   what we want with clarity  (desire for a road to financial freedom) 
2) by knowing why we want it (so as to exist better with less inequalities  and evolve collectively faster) 
3) by establishing a rapport to or tuning with the collective consciousness through  valid statistics and also the law of growth (in other words utilizing index funds  that have stable for ever long term increasing trend)
4) by applying the right perception (of the existence of cycles)
5) and by having the desire for applying with determined persistence the particular optimal strategy of risk management (optimal Kelly rule and optimal separation of funds)
6) we get the ultimate divine simple and profound formula of success


And although we may teach the know-how of this simple method, to others there is no guarantee, that they will also succeed (the 6)) , because there is no guarantee that they may also have the persisting desire for this (the 1)) , the right motive or cause ( the 2)) , the correct embedding to and tuning with the collective consciousness (the 3) ) , the subtle perception of the reality of the cycles (the 4)) and finally the desire that gives determination to persevere with consistency to the particular right optimal risk management policies (the 5)).  The desire must exist not only for the goal and cause but also for the particular method and way.

When we are dealing with margin trading, the risk is high and it should be monitored carefully. To see the difficulty of it here is the relevant quantities, and formulae, e.g. for the index funds CFD's of  Nasdaq , SnP500, Dow Jones etc

STARTING WITH EFFECTIVE LEVERAGE<=1 Sometimes trading with margin (leverage >1) may give worse results than trading with leverage =1, when we do not know ho to handle in risk of the leverage. One way is to start opening positions with effective leverage  (see below for definition, effective or nominal leverage=total value of the position/total balance of the funds) <=1, and once we have break-even , and insure that we will not lose any money with a stop-loss , only then to try to open a next position with leverage <=1 etc. In this way we may escalate to leverage larger than 1, but the non insured positions by break-even always have leverage at most =1, and so we succeed that our account will not crash.  Even if the market will not allow very significant escalation, by closing positions at  waving backwards, this method allows  to invest to index funds starting with little money and using the CFD's instead of the index funds itself or futures on it. Having little money should not mean that we are forced to lose them before reaching an almost buy-and-hold tactic. And the current method shows  how even with little money we can have at  an investment at least as profitable as the buy-and-hold scheme. We escalate in this way till as long as the used margin of all the positions does not exceed the optimal separation ratio of the Markovitz Portfolio theory, which for US-indices and for daily bars is 100%, Thus here the total margin should not exceed 80% of the balance of the funds, as the remaining 20% is left for the maximum exposure when opening individual or elementary positions. After  reaching this  maximum  escalation we do not apply buy-and-hold, but we apply the sell-buy adjustments so as to keep this ratio stable . Initially we put a stop loss when we open a position (with effective leverage <=1) at 4N or 5 days low, and then we break-even. After that we trail at 50% of the profits , and when the psoition is deeply in profits with 66% of the profits. Position that close by the above rules are reopened with the 2Days High

So in overall the system goes as follows:


CONSTANT GROWTH TRANSACTION SYSTEM  

 ( From 1950 to 2000, for the American stock indices we discover the next statistics:
 1) There are 12 periods of 3.7 years, that the index grows more than 100% 
 2) There are 11 periods of about 9 months (continuation pattern or standing wave of 3 months half period) that the index goes does about 25%-30%.)

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!


1)                We start opening positions , each one with maximum-exposure 1%-2% and in total all of them 10% -20% (more than 10% better only rarely in high success probability occasions. We also ensure that we have sufficient funds, and the size of the position is small enough so that the effective leverage (effective leverage=value of the position/total Balance of the funds) is at most equal to 1 (un-leveraged).
2)                 We start insuring profits (by trailing the stop loss) at first with a 5-Days Low. (Parker magnetic solar spiral) . We set at first Break-even then 50% insurance of profits, and finally 66%=2/3 insurance of profits.
3)                In case of backwards moves that it closes positions wit exit rules as in 2) , we re-open with the 2-days High rule (Parker magnetic solar spiral) . The volume size is determined by the maximum exposure rules.
4)                We proceed as before till the maximum optimal separation ratio of the instrument as projected to the margin used in the funds of the trading account. Funds=Closed positions , as Balance which is less than the Equities e.g. in MT4 platform. The inverse of this ratio in MT4 is calculated and displayed as Margin Level.  For daily monitoring frequency (sampling rate) and instruments like US index funds or Bitcoin the optimal separation ratio is 100%. But even this for the margin-trading means that here the optimal separation ratio is about 80%, as the 20% is left for the maximum exposure at the re-opening of the positions (thus Margin -Level 125%).
5)                Constant Optimal Separation ratio rule. In the case again that the margin increases above the 80% then we close positions , which will increase the balance of the funds, due to floating profits and will decrease the margin percentage. We close the minimum number of positions to restore the constant optimal ratio of 80%, which is a rule different logic and optimality from the maximum exposure percentage rule.  In case we have margin equal to 80% of the balance of the funds, and the maximum exposure is realized by a turn of the market, again we close positions , the minimum number that is necessary, so as to restore the optimal constant separation rule of 80% , and also a 20% available for maximum exposure at reopening positions.
6)                The closing and reopening of the positions as in 2)-3) is different from the closing of the positions as 5). In the case of 2)-3) it is unwillingly an involuntary and of size determined by the maximum-exposure rule, while in the case of 5) it is willingly and voluntary , and of sizes based on the constant optimal separation ratio.
7)                The closing and reopening of positions by the voluntary optimal constant ratio rule 80% , can be done also for closing by utilizing the backwards moves of the market and the 5-days lows rule (Parker magnetic solar spiral) and for opening by the 2-day highs   (Parker magnetic solar spiral), instead of just percentage of ratio deviation trigger. The size of the closing-reopening is the minimum to restore  the constant ratio rule, and I may be position sizes less than the sizes suggested by the maximum-exposure rule. E.g. e may close at every 5% deviations from 80% , while the maximum-exposure rule may suggest 10% exposure positions. Therefore  the final and long term constant ratio rule, has at reopening positions less risk than the maximum exposure rule.
8)                The 5-days lows 2-days highs rules is because of the celestial cycle of the solar magnetic Parker spiral.
9)                The nominal leverage or effective leverage , in other words the value of the total position compared to the balance of the funds, denoted by LE at the optimal separation ratio of  OSR=80% is LE=((OSR))*LM, where LM is the margin-leverage of the account. E.g. LM=200 OSR=0.8 then LE=160. For
LM=500, OSR=0.8, LE=400, which is really high to my practice so far.




10)           SUMMARY
Before reaching the optimal constant separation ratio, the exposure  reaches the maximum preset, at opening the positions. At  the optimal constant separation ratio (e.g. 80%) it is less. Both cases can be triggered by the 5D/2D lows-highs rules. The front office procedures are simple the backofice a little more complicated.




QUANTITIES-MAGNITUDES OF RISK-MANAGEMENT OF ESCALATION AND THEIR SYMBOLS.


LT : Effective (or nominal) leverage of the Portfolio. That is the ratio of the value of the open position by the portfolio and the balance (closed positions) of the funds
L0 , l0 : Effective (or nominal) leverage of the Portfolio of single elementary position.
LM : Margin leverage of the instrument in this account.
M0 : margin of elementary position P0
M  : Size of the portfolio in number of elements or positions
P0 : Elementary position in volume size of contracts
V(P0): Value (nominal) of the open elementary position  P0 .
Ind: Index fund or instrument in general.
Pr(Ind): Market price of the Index fund or instrument in general.

Mmax : maximum number of elementary positions in the portfolio, by escalation till optimal separation ratio reached.
Rs or Xs: Optimal separation ratio for the instrument and the chosen bins (usually days).
N: average true range of a bar (day) in price units.
RN: The previous N, as percentage of the price of the index or instrument.
F0 : Initial balance of the funds for transactions.
m: Contract size, at the symbol specifications of the instrument or constant multiplier to convert price changes into money for the instrument.
CS: Constant contract size in forex
e0: Maximum exposure percentage of the Balance of the funds , per elementary position P0 , usually 2%.

HYPOTHESES
  
    1)    Escalation spacing N of the grid, which remain constant during the escalation
     2)     Stop-Loss 2N
     3)    e0: corresponds to 2N exposure.
     4)    We assume funds remaining constant for  the procedure escalation
     5)    We assume leverage l0 constant during the escalation.


For FX instead of index funds  Contact size/Pr(ind)=m(t) which is variable while for index it is constant.

If the starting size of the elementary position (for indexes) is based on having the effective leverage equal to 1, then instead of the formula P(0)=e(0)F(0)/(2Nm) as above we use another by solving the equation P(0)mPr(Ind)/F(0)=1, which gives

P(0)=F(0)/mPr(Ind)   



THE PREVIOUS ESCALATION AND TRAIL OUT CAN BE EITHER WITH SPOT MARKET INSTRUMENTS E.G. CFD'S OR EVEN CALL OPIONS .

AN ALTERNATIVE SIMPIFICATION OF THE MATHEMATICALLY OPTIMAL  METHOD OF CONSTANT RATIO ON INVESTED AND NON-INVESTED FUNDS:

An alternative simplification of the constant ratio method to handle mathematically optimally a trending in the long run, instrument (e.g. US indexes etc) is to define  A PRTOFOLIO OF TW OPARTS, ONE BUY-AND HOLD AND ONE SHORT-ERM TARDES AT EXTREMT CASES OV VERY HIGH PREDICTABILITY  UP. 
In other words: 
A) A LONG-TERM STRINCTLY BUY-AND-HOLD LONG TERM PART AT X% F THE FUNDS. WE ESCALATE AFTER BREAK-EVEN AS ABOVE BUT WE DO NOT TRAIL OLY SET A TAKE PROFIT ABOUT 1 OR  2 TIMES THE STOPLOSS RISK.

B) AN UP ONLY  SPORADIC SHORT-TERM TRADES PART AT Y% OF THE FUNDS (X%+X%=100%). (NORMALLY IT SHOULD BE TIME PERIODIC SHORT TRADES IF THE MODELOF THE TREND IS A DRIFT , BUT THE SUCCESS RATE IS BY FAR HIGHER WHEN THEY ARE SPORADIC WHEN OPPORTUNITIES APPEAR BECAUSE TRULLY THE TREND IS NOT JUST A DRIFT BUT INVOLVES LINEAR NON-MARSHALLIAN DEMAND-SUPPLY COUPLING)

IN THIS 2-PARTS PORTFOLIO ,THE HIGHER THE VOLATILITY THE HIGHER THE Y%, AND THE LOWER THE TREND OR DRIFT THE LOWER THE X%. 


(E.G. UTILIZE THE ALIGATOR INDICATOR OF BILL WILLIAMS AT VARIOYS SHORT TERM SCALES, AND OPEN POSITIONS WITH VERY TIGHT STOP LOSS AT DOWNWARD  PANIC MOVES THAT ARE EXHAUSTIVE OR FINAL SUPER-EXPONENTIAL (LIKE END-TREND  SPIKES)  , AND CLOSING THE POSITION WHEN REACHED THE MIDDLE RED LINE OFTHE ALIGATOR. FINAL SUPER EXPOSMENTIAL EXTREME MOVES ARE DETECTED VISUALLY OVER THE ALIGATOR "OPENING" OF ITS LINES AND ANGLE WITH THEM AS THEY APPEAR ALMOST LIKE SPIKES. BOTH BILL WILLIAMS AND DIDDIER SORNETTE (SEE ABOVE IN THIS POST) HAVE DISCOVERED THIS AS HIGHLY PREDICTABLE SITUATION. DIDIER SORNETTE CALLS SUCH FINAL SUPEREXPONENTIAL MOVES THAT REACT CONVERSELLY AS SUPER-BUBBLES. EXPERIMENT SHOWS A SUCCESS RATE HIGHER THAN 80%. STILL A PARETO RULE HOLDS: MORE THAN 80% OF THE TIME  OCCUR LESS THAN 20% OF THE OPPORTUNITIES OF FINAL SUPEREXPONENTIAL MOVES. CHUCK HUGHES HAS APPLIED IT WITH BOUGHT CALL OPTIONS WHICH IS BY A FAR A BETTER INSTRUMENT TO DO THE B) PART OF THE PORTFOLIO  WITH A MONTHLY RATE OF RETURN OF ABOUT 10% AND SUCCESS RATE HIGHER TO 95% .  )


In order to conduct successfully an intra-day system of transactions , that is successful in the long run and easy to keep on applying it the next points must be met.

1) It must be relatively utterly simple! Only the "eye of simplicity"can put order and tame the chaos of intra-day price patterns! It must be manual and not automated!
2) Therefore it has to be one only pattern among the 4 price patterns (see post 32) 
3) To deal with this one only pattern, we may apply simplifiers like , velocity or rate of change of prices, acceleration, support-resistance.
4) Celestial periodicity will give the long-run stability, but it need not be one only frequency or period but a few neighboring frequencies or periods in  the spectrum of celestial frequencies or cycles.
5) But most of all the strongest simplifier is that , when measuring the velocity or rate of change , by a stratified sampling hypothesis test, then it has to be an extreme value , which will indicate a reaction or closing of the cycle. This in particular means that we entirely avoid the parametric predictive models of econometry that assume predictability at every time step, as for such to be succsesful they would need to be pod stochastoc coeficients and there practically no such econometric models,  and we resort to the more robust and with less assumptions non-parametric statistics and in particular of a single non-parametric  measurement of the velocity of the prices, with stratified sampling. 
The stochastic model that is relevant is again the simplest possible one, e.g. starting from that of the Portfolio Theory of Markowitz, where for the rate of return R we postulate R(t)=R(0)+R(s,t)+e(t) where the R(0) is the  constant average rate of return in time of the Markowitz theory of portfolio (constant trend) , R(s,t) is the seasonal part ,with average value non-zero , and on which we apply the above hypothesis test at various frequencies or sampling horizons or with stratified sampling , and e(t) has average value zero , it is normally distributed and is the random excitation part. The stochastic model has no-memory and for the sampling each step gives independent observation. From the above equation we may derive with the exponential function the final stochastic process of the prices and volumes that will be log-normally distributed.
6) It must be a phenomenon tested scientifically with valid quantitative procedures , with sufficient good (intermittent) predictability , for many years.
7) The financial result should be adequate (e.g. >= 1MDS).
8) The financial result, in my case, is to be used not only for economic freedom, but also for a worthy goal e.g. so as to finance my innovative research in the new millennium digital mathematics. 


9) One of the solutions to the above requirements is the best (vanila) options spreads strategy of Chuck Hughes as in post 41, which woeks only when the market has high volatility (thus implied volatility too)

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