Thursday, August 19, 2010

21. The (spectral) momentum (or trend) and its acceleration. The 6 basic elements of the momentum (trend) and the 3 measuring methods.

Here is  a suggestion about how to measure in a simplest way the momentum and acceleration in a
spectral-like way in other words selectively sensitive over particular (rainbow) frequencies.

Suppose we want to measure the momentum and acceleration over the frequencies or periods 2*n1, 2*n2, 2*n3,...,2*nk

Then way take the moving averages MA(ni) with periods ni= n1, n2,...,nk respectively

and we combine them as a new weighted average

specMA=a1*MA(n1)+a2*MA(n2)+...+ak*MA(nk)
a1+a2+...+ak=1.
If n1=n2=...nk, then we get measurement on a single frequency.

It is not very practical to use too many frequencies on the same chart, I would suggest 3 at most 4.
e.g. n1=2*N , n2=N, n3=N/2 , n4=N/4, where N is particular rainbow frequency.
Or n1=N1, n2=N1/2, n3=N2 ,n4=N2/2 where N1, N2 are two rainbow frequencies withing the normal range of a single chart.

As weight we may take ai=1/k (all weights equal, no weighted average) or if we want to put more weight to the faster moving averages according to the period then

weights ai=(1/ni)/((1/n1)+(1/n2)+...+(1/nk))

or arbitrary user-interactive weights

So we have defined a spectral smoothed price position

This procedure is under a general approach to utlize weighted average to synthesize
a single meta-indicator from many primary indicators for easiness of monitoring and for reducing complexity.
There are of course other ways to synthesize in to single indicator from many indicators based on logical conditions also.


For the momentum we may take simply the MovingAverage(of specMA ,over period m)-specMA

in other words a classical cross difference of the curve with a moving average smoothing of it. We may prefer m=min(n1,n2,...nk)/2 , for more stable signals.

For the acceleration we may take a OsMA(specMA,l2,l3) of it, in other words a moving average oscillator , but not with a l1 moving average as input, but as input the specMA curve and l2 and l3 smoothing moving averages of it. Better also chose as l2=min(n1,n2,...nk)/2 and

l3=min(n1,n2,...nk)/4 or l2=max(n1,n2,...nk)/2 and  l3=max(n1,n2,...nk)/4


We may want to display the spectral acceleration as a histogram in a separate window with 4 colors above zero and increasing, above zero and decreasing, below zero and decreasing, below zero and increasing. This spectral acceleration involves the desired frequencies and shows hidden divergence for closing positions or starting stalking the market so as to open positions. The acceleration shows leading signals before the reversals

Of course it would be even better to use every where above that a moving average is applied (except of the weighted average from all the frequencies to the spectral position curve) the Hull Moving Average instead of simple moving average.


And of course there are plenty of different indicators that can be used that might measure the momentum and acceleration, if momentum reflects the 1st (or a low order) mathematical (stochastic) derivative, and acceleration reflects the 2nd (or higher order) mathematical (stochastic) derivative. It is better to apply first the smoothing and then the differentiation than vice versa.


If it is preferred a more scientific way to detect and forecast the momentum of the waving price pattern (see post 32) , then we may utilize a Fourier analysis or wavelets analysis.
For example see the indicators 
1) For wavelets analysis the sincMA indicator at  http://codebase.mql4.com/ru/968
2) For Fourier analysis the extrapolator indicator at  http://codebase.mql4.com/4990
Nevertheless, we must realize that in the Fourier analysis it is essentially utilized only one tonal frequency and period, and then all the others are harmonics of it.
If we want to utilize frequencies and periods that are not mutually harmonics, (as the rainbow frequencies ,see post 5) but independent tonal frequencies (e.g. 24 hours periodicity, and also 2.5 days , or 60 hours periodicity simultaneously) then we must superimpose the forecasting of the above extrapolator indicator, with an appropriate specially coded new indicator. I use such an indicator with up to 5 independent tonal frequencies or Fourier sample sizes. In this way we may represent the price movements with almost periodic functions, and utilize selectively few only periodicities (that may not be  harmonics between them) while with a single Fourier analysis we could never be able to do  so. The forecasting in this way, especially around the sessional action (8 hours-12 hours) is much better. The classical scientific tools, are good but not in the exact form they appear in books. It still requires talent and a better than the average understanding of the phenomenon, and the limitations and abilities of the tools.

We must add here that as the momentum (and speed) is not a deterministic but stochastic magnitude,
there are 6 elements of interest to measure and consider in decisions (risk metrics)
1) The signed intensity (the intensity separates a spike from a casual trend)
2) The volatility of it (or amplitude of an appropriate channel; It is relevant to the support-resistance levels )
3) The volatility dynamics of it ( if the volatility of it is increasing or decreasing, in other words if the   channels is expanding or contracting)
4) The phase (the position of the price within the boundaries of the channel, usually also the base for statistical hypothesis test decisions)
5) The duration or maturity (for how long the momentum or trend is going on. e.g. at what number of Elliot subwave we are in, Elliot-order. The decceleration too is an early indicative of the maturity)
6) The decceleration or divergence, and intensity of the acceleration (helpful to get signals prior to reversals of its sign, and to detect spikes)
To the above 6 we may add two more that is for smart traders: 7) The sessional phase relative to the 3 sessions 8) The position relative to the psychological levels xx00, xx50.

If we monitor two different time frames, a focal and a background, then a pair of the above 6 elements should define the state of the market. I have tried it, and it becomes quite complicated. It seems to me now that one time frame, the focal is adequate for all the 6, and the background time-frame only 1 or 2 basic of them. Even at one time-frame only, we may detect the trend on quite close harmonics around the focal frequency, and observe their resonance. Some interesting phenomena occur with the resonance of the sessional periodicities.

The best way to have all these 6 measures relevant to the stochastic momentum, is to utilise a channel, not just a curve, and channels defined by zigzags are preferred. This is the bottom-up method that we discuss below. A moving average as, a single curve, defines only the sign of the trend. (1 of the 6 elements). A channel e.g. the Bollinger Bands, can define 4 of the 6, the sign, the volatility, the volatility dynamics, the phase, but the maturity and divergence not. A channel defined by a zigzag can define all 6 elements of the trend!

The maturity of the trend is usually measured by the divergence or deceleration of its momentum, and by the Elliot wave order. My preference in counting the Elliot orders. 0,1,2,3,4 is by meorological metaphor: 0=Lighning, 1=Thunder, 2=Blow, 3=Wind, 4=Stream.
Statistically, the 1st Elliot wave, the Lightning is the strongest and usually (but not always) it is  a Spike, and the next ones are diminishing in slope and duration. That is why I usually prefer to trade the Lightnings, Thunders, and Blows more than the subsequent waves. Nevertheless some times a trend ends with an final spike (called exhaustion spike that might created also an exhaustion gap) before it reverses direction with a new retrace-and-more spike. The deceleration is utilized to assess the end or almost end of a trend (even though the momentum is still positive) while the acceleration is utilized to select only those trends that is anticipated to be stronger and longer lasting. The deceleration (divergence) and acceleration is detected with various ways, some static based on straight lines (pitchfork median lines, support-resistance break-outs etc), some dynamic based on ratios (e.g. volatility ratios, 2nd derivative ratios etc)



Most people think that it is enough to determine the sign of the trend each time so as to trade successfully. But it is not so. One has to determine successfully all the above 6 elements of the trend so as to trade successfully. There is also an important correlation among these elements. In particular there is correlation between the intensity of the trend and its duration. Both follow a Pareto or Power distribution with a longer tail. This in particular means that you can predict higher duration of the trend if it starts with higher intensity. In other words that longer trends start with spikes! This together with pyramiding along the duration of the trend (as optimal policy after the Pareto law of duration)  is the main key that can allow you a successful trading of high quality. A high quality successful trading is one that the average trade profit is higher or double that the average trade loss. And in its turn this requires setting stop loss less or less than half of the take profit, and trail appropriately.


Each of the 6 elements of the trend is a risk element too, so we may create an additive risk score to evaluate the overall risk at a situation. And by putting a priority order on the 6 elements of the trend, we may have a complete linear risk order on  all trend situations, even if two situations have the same additive risk score.

As there are many rainbow frequencies so as to measure the (stochastic) momentum (or trend or drift) this gives rise to mainly 3 techniques of measuring momentum (or trend)

1) The bottom-up method. In this method we utilize the measurement of momentum based on smaller time scale measurements of the momentum. (Assuming that we start with ticks towards say daily bars, the term bottom-up becomes plausible). A best example is to deduce indirectly the measurement of the momentum (or trend) from the divergence and slope of the channel of a zigzag of  the immediately smaller (rainbow) time scale. It is supposed that each vector of the zigzag is measurement of the shorter time scale momentum while, the zig-zag slope of the focal larger time scale. The theory of Elliot waves is mainly based on that. It is a very powerful method, that I utilize too in my practice.
2) The top-down method. In this method we utilize measurements at larger time scales to deduce the measurement of the momentum on the shorter focal time scale. Usually we have to take higher order derivatives (deltas or differences) of the larger time scale measurement of the momentum. A classical example is the Accelerator indicator of Bill Williams (AC) that is using horizons of 32 days and after higher derivatives it measures small micro-trends of 2-5 days.
3) The middle-out method. In this method we use many different measurements of the momentum with different tools and indicators exactly or almost exactly but quite close to  the required focal time scale (e.g. low order harmonics and subharmonics) and then we deduce from all of them, through an additive score (or through a conjunctive Boolean expression) the momentum of the focal time scale. This is a powerful method too, and if it combines acceleration and oscillators that give earlier signals of the reversal with other trend-following indicators that have lag at reversals we may get a pretty exact measurement for the momentum and is reversals at the focal time scale. As the middle-out technique focuses on the focal frequency and small local deviations of it, its additive score can be considered as an evaluation metric of the states of resonance at the focal frequency.

The above methods are not to be confused with the quite standard and successful practice of requiring that the momentum of the focal or tonal  time scale is not only the appropriate for a trade but also the same holds for the momentum in some larger time scales (background) and some smaller time scales (tuning). This latter technique could be called spectral-band momentum and is a different concept than the bottom-up, top-down ,and middle-out measurement of the momentum which is only of a single  time scale. The focal time scale is distinguished among the larger (background) and smaller (tuning) time scales by the average duration of the trade its average take profit and its  average stop loss.


If we measure the depth of the band-momentum with an additive score (the higher the score the more the time-scales that the momentum is of the same sign, thus another risk metric of the trend)) then we may want to condition and depend the other 6-elements of the momentum as risk metrics according to this score. E.g. we may want to allow maturity of the trend (for opening positions) only at very low Elliot order (early enough, low risk) if the band-score is low (high risk) , while allow maturity at higher order (higher risk) (permit late openings of positions within a trend) if the band-score is high (low risk). This is an example where we do not treat all the 6-elements and the momentum score as independent components but also as depended so as to be more flexible and allow more opportunities and less total intermittency in the trading. The idea is to assess the overall risk from each of the component risks.
That is all.