The Power of Tangential Learning

According to Wikipedia,

tangential learning is the process by which some portion of people will self-educate if a topic is exposed to them in something that they already enjoy.

I was just organizing my bookshelf the other day and is surprised by how fast my collection of statistics books have grown. I studied statistics back in school as a stepping stone to learning stochastic process for wireless communication theories (e.g. CDMA). Detecting radio-frequency and resolving wireless signals to meaningful messages is fundamentally about assessing the state of random processes. I hated statistics back then because I didn’t get it and did poorly in those courses. It is ironic that years later I would realize how much I have grown to rely and love the little p‘s and q‘s in my little hobby of quantitative trading.

I still don’t like statistics (or theoretical math), per se. I just love applying them in my trading and quant programs. The more that I learn about statistics, the more that I realize how powerful they can be and how ignorant I am. For example, in my clinical study days I used either t-test or ANOVA for everything under the sun. Now that I’ve come to understanding about inferential statistics, I am aware of the assumptions and pitfalls such as the assumption of t-tests of homogeneity of variance between the two samples tested. If this assumption is violated, then the unequal variance t-test should be used.

Finer points like these are routinely ignored in practice because many clinical studies are inherently designed in the experiment to meet these criteria. However, that’s not the case when I am making creative use of statistics in my trading. I don’t have a clinical study committee watching over my back. If I make a false or weaker-than-expected claim and don’t know better, then it is my bank account that will suffer the consequences.

Learning statistics was initially due to this got-to-know-better necessity. However, the more that I learn about statistics, the more that I appreciate it. If used correctly, statistics can provide a new dimension to the scientific assessment of your trading performance and market data.

No related posts.

7 Comments

  1. Franco says:

    I myself had an engineering statistics module about two years ago, to be honest don’t really remember anything!

    The only way how I’m calculating probabilities at the moment is to use many moving averages ((between 10 and 150) , calculate their slopes, get a reference slope factor, and determine if the bulls or bears are the strongest by comparing each slope numerically.

    The problem with the above strategy is a strong support/resistance area completely destroys the mathematics., as every period of a moving average can show up but the market can turn in an instant.

    Somehow the S/R areas needs to be incorporated into the model.

    Don’t get me wrong the model works lovely, but definitely not satisfied.

  2. Paul says:

    Franco, looks like you’re estimating the derivative of prices. Are you using stochastic calculus in your new model?

  3. Franco says:

    Hey Paul,

    Like I said my stats are really bad at the moment, I have to get that book off the shelve and start studying again.

    Are you referring to the Wiener process?

    I’m not exactly sure what I did with the filter I’m using on almost all my strategies, but all I know is that it works quite good. What I basically do is calculate the bull or bear probability using moving averages, and then multiply the specified volume with the probability. This filters out low probability trades.

    Let me state again the probabilities are according to what the moving averages say. Here is the three functions: (the code looks confusing here, cannot upload a file so I posted it anyway)

    
       //+------------------------------------------------------------------+
        //| Calculate Lot Size To Use                                                            |
        //+------------------------------------------------------------------+ 
    
        public double CalcLot(Instrument instrument,Period period,int type) throws JFException
        {
    
        	double lot = 0;
    
            if (UseMAFilter == false) {lot = Volume;}
            else
            {
    	    	if (type == LONG)
    	    	{
    	    		lot = Volume * CalcProp(instrument,period,TotalMAS, MADelta,LONG);
    	    	}
    
    	    	if (type == SHORT)
    	    	{
    	    		lot = Volume * CalcProp(instrument,period,TotalMAS, MADelta,SHORT);
                           //TotalMAS are the number of moving averages
                          //MADelta is the moving average period increment
    	    	}
            }
    
        	return(lot);
        }
        //+------------------------------------------------------------------+
        //| Calculate Probability                                                                   |
        //+------------------------------------------------------------------+
        public double CalcProp(Instrument instrument,Period timePeriod,int MAS, int delta,int type) throws JFException
        {
    
        double up = 1;
        double down = 1;
        double p;
        int bars = 1000; //Bars used to calculate average values from
        int y = 0;
        double[] MASlope = new double[MAS+1];
    
        for (int i = 0;i 0) {up =up +MASlope[i] ;}
    
           if (MASlope[i]  <0) {down =down + Math.abs(MASlope[i]);}
    
        }
    
        if (type == LONG)
        {
           p = up/(up+down) ;
           return(p);
        }
    
        if (type == SHORT)
        {
           p = down/(up+down) ;
           return(p);
        }
    
        return(0);
    
        }
    
        //+------------------------------------------------------------------+
        //| Calculate Moving Average Advanced Slope Factor                    |
        //+------------------------------------------------------------------+  
    
        public double MA_AdvSlopeFactor(Instrument instrument,Period timePeriod,int period,int bars) throws JFException
        {
    
    	    int i;
    	    double sum = 0;
    	    double count = 0;
    	    double[] MA = new double[bars+1];  
    
    	    for(i=0; i<=bars; i++)
    	    {
    	        MA[i] = this.indicators.ema(instrument,timePeriod,OfferSide.ASK,IIndicators.AppliedPrice.CLOSE,period,i);
    	    }
    
    	    for (i =0;i<bars-2;i++)
    	    {
    			sum = sum + Math.abs(MA[i] - MA[i+1]);
    			count++;
    	    }
    
    	    double MA_Avg = sum/count;
    
    	    double slope = MA[1] - MA[2];
    
    	    return((slope/MA_Avg));
    
        }
    
  4. Franco says:

    The code is messed up, not sure why that happens. I posted the code at my new forum, if you want to register and I’ll activate your account and you can look at the code there.

    http://www.forexconsilio.com

  5. Franco says:

    Oh by the way you sparked my interest in stochastic calculus, books here I come

  6. Liang says:

    The problem with statistics in financial markets, particularly in a fundamental market like forex, is that, their process does not really follow stationary process assumption, that most of the statistical inference is based on. For example, the fat tail about the return rate.. But I guess the return rate is more of academic interest, in trading, is the price that matters more, however, price series will violate the stationary process assumption.

    How do you get around of this?

  7. Paul says:

    Published research have shown that time series data in short time frames follow a Gaussian distribution. For longer time frames, I use non-parametric statistics. There’s also detrending techniques, etc. As Graham once said, security analysis is all about comparing similar and related securities. Statistics is a nice way to do quantitative comparisons.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>