Definition of a trend

Discussion in 'Strategy Development' started by macrotrader, May 2, 2009.

  1. People who are not knowledgeable in mathematics like to think that a definition of trend is as straightforward as it gets.
    For example I skimmed through one of the major popular books on trendfollowing and it is full of babble about trends.

    The problem is that trends are a very perplexing thing. All the confusion arise from the disregard of the random nature of the process.

    One should start any observation with the statement: asset prices are a random process. That is to say that one part of the outcome will always be unknown. It doesn't mean that everything will be unknown. The standard recipe for random proceccess is the brownian motion.

    The following picture shows a simulation of a brownian motion with mu = 1 and sigma = 0.3 and sigma = 0.9. Both markets trend, which simply means that mu is not zero. However the ratio of mu to sigma is a measure for strength of the trends. Trends are
    not binary, they have a spektrum. In fact they are multidimensional: they can be meanreverting, autocorrelating, correlating, cointegrating, etc. However often sophisticated stochastic calculus misses some very basic things.

    Chan writes in his excellent book:

    [​IMG]

    Code:
    '''
    N_sim: number of simulations
    T: horizon
    dt: step length in years
    sigma: volatility per year
    mu: drift terms (moving average or long-term mean for stock returns)
    S0: initial stock price
    '''
    
    from numpy.random import standard_normal
    from numpy import array, zeros, sqrt, shape
    from pylab import *
    
    S0 = 10.222
    T =1
    dt =0.0002
    
    #sigma = 0.4
    #mu = 4 #1
    N_Sim = 5
    Steps=round(T/dt); #Steps in years
    	
    def plot_brown(sigma,mu):
    	title('Simulations %d Steps %d Sigma %.6f Mu %.6f S0 %.6f' % (int(N_Sim), int(Steps), sigma, mu, S0))
    	S = zeros([N_Sim, Steps], dtype=float)
    	x = range(0, int(Steps), 1)
    	
    	for j in range(0, N_Sim, 1):
    		S[j,0]= S0
    		for i in x[:-1]:
    			S[j,i+1]=S[j,i]+S[j,i]*(mu-0.5*pow(sigma,2))*dt+sigma*S[j,i]*sqrt(dt)*standard_normal();
    		plot(x, S[j])
    
    if __name__=='__main__':
    	subplot(211)
    	plot_brown(0.3,1)
    	subplot(212)
    	plot_brown(0.9,1)	
    	
    	xlabel('steps')
    	ylabel('stock price')
    	show()
    
     
  2. Corey

    Corey

    So why not use a non-linear curve fitter to crunch numbers overnight and go long/short the securities with the highest mu/sigma ratio?

    It's simple until you realize that sigma and mu can change...
     
  3. Maximizing mu-sigma is more or less what the "modern" portfolio theory says. As you absolutely correctly pointed out, the weakness is that mu and sigma are supposed to be static.

    As bad as the Brownian Motion is, it is a good start to think about trends.
     
  4. The price action people tell me:

    Uptrend = higher highs and higher lows

    Downtrend = lower lows and lower highs


    Of course, sometimes you get a mixture with like HH, HL, LH, HL, HH, LL. I guess technically that deviates from the definitions above and therefore isn't a trend.

    Honestly, I have no idea.

    Simpler to define trend by a MA's slope.
     
  5. I think what is usually meant by trend is that prices go higher and 'decidely' so. That is most of the time of the trending period prices go steadily higher. In fact to say that markets always trend is a paradox, because that would mean they are predictable. Markets can't be predictable all the time, almost by definition. To say that a market trends is to make a prediction: it will go higher if it went higher.

    Code:
     If x[t]-x[t-1]/x[t-1] > threshold then
       x*[t+1] > x[t]
    
    If x[t]-x[t-1]/x[t-1] < -threshold then
       x*[t+1] < x[t]
    
    x* = predicition
    
    That is in effect autocorrelation. To say that markets trend is to say that they exibit autocorrelation. That is not true at least some of the time. To say they trend when they trend is pretty lame, but that is really what popular "gurus" say (people who give seminars, people I have no respect have for).
     
  6. A trend is a market enrivonment where trend-following systems achieve superior risk-adjusted returns.
     
  7. Actually I developed a trend-indicator today which correlates quite well with CTA-trendfollowing funds. It is calculated over a universe of 20 or so liquid futures. I think if I would tweak a bit it would replicate a CTA index.
     
    • ti.png
      File size:
      27.5 KB
      Views:
      226
  8. OP, you have gotten off to a poor start.

    Price change is a requirement for making money and makig money can be done at a variety of velocities depending upon where the person choses to operate.

    Some past examples here include those who make the chioce to operate on two levels and even within one market.

    Several people here have cool means of looking at how to divide the preiodicity of the market (fractals). One person who integrates both market variables into his representation uses multiples of 7, the Power Law of numbers. Another follows time division conventions as a consequence of the 32 sectors of trading and those who populate those sectors (they have influence.)

    OP, you show us your limitations in other ways too. Your choice to use maths as the driver instead of "how markets work", puts you out of the game, as it were. Too bad.

    Lets say any person with a ruler could make parallelagrams that enclose a trend. He also could then draw the two diagonals: a long diagonal and a short diagonal.

    If he drew three in a row and was not like Pring, Joe Ross or LBR or Toni or oliver or the Wizards; he would see something unknown to all of these folks.

    Next, if he took all thse drawings and put them on a chart that could show one after another these things in around the same time zone on all SEVEN fractals' he would have a minumum of 63 parallelograms.

    If he took the three longest parallelograms in time; and filled their width with parallelograms in the six faster fractals he would have a power of the 63 to work with.

    Inductively he knows a few things:

    1. Trends overlap

    2. The overlap begins on the long diagonal (t, p)

    3. The overlap ends at the end of the short diagonal.(t, p)

    So this is unsatisfactory since it is inductive. A deductive proof is required and analytical geometry does this for any high school student.

    We have that.

    Also we got something else that is very nice and very definitive about the three essential questions for any Holy Grail ATS for trading markets. We have the answers to:

    1. Where are we in the trend?

    2. What is next?

    3. How fast are things changing?

    To make the point further.

    There are many leading indicators of price and the other independent variable of the markets is one of them.

    The illustration shows SEVEN of them. Further it assigns an order to them. This chart is running faster than anything you have ever considered.

    In this manner, then, you, OP, use trends to make money. You make the most that is offered. You know before the timely action to take profit segments that the time is coming nigh. you know it, usually for at least two or three trades out and with deductive certainty and NOT ant probabilities involved but instead the sufficiency of information theory.

    In ET, it is customary to shoot the messenger. Nitwits do the shooting. So you can deduce quite easily who the nitwits are in ET.

    [​IMG]
     
  9. The problem with most technical approaches is that it lacks precision and misses the central concept of randomness. It's like playing poker without knowing the concept of odds (i.e. probabilities). Markets are not deterministic, therefore "analytical geometry" doesn't apply.
     

  10. well stated. the "chart illusion" exerts a powerful draw on many.
     
    #10     May 4, 2009