Traders' Tips from TASC Magazine

Confirming the Price Trend

Barbara Star’s article on confirming the price trend discusses using R squared and the slope of a linear regression line in conjunction with moving averages and the stochastic. All these indicators are built into MetaStock and require no custom formula to use. Below is a system based off her suggestions in her article.

Long positions are entered when:

  • A 10 period moving average is above a 30 period moving average
  • The Stochastic Oscillator has risen above 20
  • R squared is above .2
  • A 20 period linear regression lines slope is above 0

Short positions are entered when:

  • A 10 period moving average is below a 30 period moving average
  • The Stochastic Oscillator has fallen below 80
  • R squared is above .2
  • A 20 period linear regression lines slope is below 0

Positions are closed when:

  • R squared is equal to .2 or less
  • A 20 period linear regression lines slopes against the position
  • Either the moving averages or the Stochastic Oscillator give an opposing signal

The formulas and the steps to create this system in MetaStock are listed below:

  1. Select Tools >
    the Enhanced System Tester.
  2. Click New
  3. Enter a name.
  4. Select the Buy Order tab and enter the following formula:
    • stsig:=if(cross(stoch(14,3),20),1,if(cross(80,stoch(14,3)),-1,prev));
    • mov(c,10,S)>mov(c,30,s) AND rsquared(c,20)>.2 AND
    • LinRegSlope(c,20)>0 AND stsig=1
  5. Select the Sell Order tab and enter the following formula:
    • stsig:=if(cross(stoch(14,3),20),1,if(cross(80,stoch(14,3)),-1,prev));
    • rsquared(c,20)<=.2 AND LinRegSlope(c,20)<=0 AND
    • (stsig=-1 OR mov(c,10,S)<mov(c,30,s))
  6. Select the Sell Short Order tab and enter the following formula:
    • stsig:=if(cross(stoch(14,3),20),1,if(cross(80,stoch(14,3)),-1,prev));
    • mov(c,10,S)<mov(c,30,s) AND rsquared(c,20)>.2 AND
    • LinRegSlope(c,20)<0 AND stsig=-1
  7. Select the Buy to Cover Order tab and enter the following formula:
    • stsig:=if(cross(stoch(14,3),20),1,if(cross(80,stoch(14,3)),-1,prev));
    • rsquared(c,20)<=.2 AND LinRegSlope(c,20)>=0 AND
    • (stsig=1 OR mov(c,10,S)>mov(c,30,s))
  8. Click OK to close the system editor.

William Golson
Equis International


Contents