Traders' Tips from TASC Magazine
Moving Average Crossovers
Dimitris Tsokakis’s article, “Moving Average Crossovers (part II),” introduces more formulas to analyze moving averages. The formula for the indicator and the instructions on adding it to MetaStock are:
To enter these indicators into MetaStock:
- In the Tools menu, select Indicator Builder.
- Click New to open the Indicator Editor for a new indicator.
- Type the name of the formula
- Click in the larger window and type in the formula.
- Click Ok to close the Indicator Editor.
Name: the Stochastic TC graph
Formula:
- p1:=Mov(Stoch(5,3),3,S);
- y:=Input("short MA time periods", 2, 200, 20);
- z:=Input("long MA time periods", 3, 200, 30);
- may:=Mov(p1,y,S);
- maz:=Mov(p1,z,S);
- test:=If(z-y=0,-9999,z-y);
- tc:=If(test=-9999, 0,
- (y*(z-1)*Mov(p1,z-1,S)-z*(y-1)*Mov(p1,y-1,S))/test);
- tc;
- Stoch(5,3);
- p1
This indicator will prompt for the time periods of the two moving averages, but it defaults to the values suggested in the article.
The explorations and instruction for creating them in MetaStock are:
- Select Tools >
the Explorer. - Click New
- Enter a name, “SMA cross stats - ascending”
- Select the Column A tab and enter the following formula.
- p1:=Mov(Stoch(5,3),3,S);
- y:=20;
- z:=30;
- may:=Mov(p1,y,S);
- maz:=Mov(p1,z,S);
- tc:=(y*(z-1)*Mov(p1,z-1,S)-z*(y-1)*Mov(p1,y-1,S))/(z-y);
- ascxpred:=Cross(p1,tc);
- confascx:=Cross(may,maz);
- Cum(ascxpred);
- Click in the Col Name box and enter the text: “Total”.
- Select the Column B tab and enter the following formula.
- p1:=Mov(Stoch(5,3),3,S);
- y:=20;
- z:=30;
- may:=Mov(p1,y,S);
- maz:=Mov(p1,z,S);
- tc:=(y*(z-1)*Mov(p1,z-1,S)-z*(y-1)*Mov(p1,y-1,S))/(z-y);
- ascxpred:=Cross(p1,tc);
- confascx:=Cross(may,maz);
- asctotpred:=Cum(ascxpred);
- acc0ascxpred:=Cum(confascx AND Ref(ascxpred,-1));
- 100*(acc0ascxpred/asctotpred)
- Click in the Col Name box and enter the text: “1 day”.
- Select the Column C tab and enter the following formula.
- p1:=Mov(Stoch(5,3),3,S);
- y:=20;
- z:=30;
- may:=Mov(p1,y,S);
- maz:=Mov(p1,z,S);
- tc:=(y*(z-1)*Mov(p1,z-1,S)-z*(y-1)*Mov(p1,y-1,S))/(z-y);
- ascxpred:=Cross(p1,tc);
- confascx:=Cross(may,maz);
- asctotpred:=Cum(ascxpred);
- acc1ascxpred:=Cum(confascx AND Ref(ascxpred,-2));
- 100*(acc1ascxpred/asctotpred)
- Click in the Col Name box and enter the text: “2 day”.
- Select the Column D tab and enter the following formula.
- p1:=Mov(Stoch(5,3),3,S);
- y:=20;
- z:=30;
- may:=Mov(p1,y,S);
- maz:=Mov(p1,z,S);
- tc:=(y*(z-1)*Mov(p1,z-1,S)-z*(y-1)*Mov(p1,y-1,S))/(z-y);
- ascxpred:=Cross(p1,tc);
- confascx:=Cross(may,maz);
- asctotpred:=Cum(ascxpred);
- acc2ascxpred:=Cum(confascx AND Ref(ascxpred,-3));
- 100*(acc2ascxpred/asctotpred)
- Click in the Col Name box and enter the text: “3 day”.
- Select the Column E tab and enter the following formula.
- p1:=Mov(Stoch(5,3),3,S);
- y:=20;
- z:=30;
- may:=Mov(p1,y,S);
- maz:=Mov(p1,z,S);
- tc:=(y*(z-1)*Mov(p1,z-1,S)-z*(y-1)*Mov(p1,y-1,S))/(z-y);
- ascxpred:=Cross(p1,tc);confascx:=Cross(may,maz);
- asctotpred:=Cum(ascxpred);
- uslsascxpre:=Cum(confascx AND ascxpred);
- 100*(uslsascxpre/asctotpred)
- Click in the Col Name box and enter the text: “useless”.
- Select the Column F tab and enter the following formula.
- p1:=Mov(Stoch(5,3),3,S);
- y:=20;
- z:=30;
- may:=Mov(p1,y,S);
- maz:=Mov(p1,z,S);
- tc:=(y*(z-1)*Mov(p1,z-1,S)-z*(y-1)*Mov(p1,y-1,S))/(z-y);
- ascxpred:=Cross(p1,tc);ascxpred:=Cross(C,tc);
- confascx:=Cross(may,maz);
- asctotpred:=Cum(ascxpred);
- acc0ascxpred:=Cum(confascx AND Ref(ascxpred,-1));
- acc1ascxpred:=Cum(confascx AND Ref(ascxpred,-2));
- acc2ascxpred:=Cum(confascx AND Ref(ascxpred,-3));
- uslsascxpre:=Cum(confascx AND ascxpred);
- 100-(100*(acc0ascxpred+acc1ascxpred+acc2ascxpred+uslsascxpre)/asctotpred)
- Click in the Col Name box and enter the text: “false”
- Click OK to close the exploration editor.
I also suggest, before closing the editor, adding the following text to the Notes field to provide a more detailed description of the column names:
columns descriptions:
1: total ascending predictions
2: percent confirmed 1 day later
3: percent confirmed 2 days later
4: percent confirmed 3 days later
5: percent useless (confirmed same day as prediction)
6: percent of false predictions
The second exploration is added in the same manner, but the formulas and notes are different. The column names are the same. The steps to create it are:
- Select Tools >
the Explorer. - Click New
- Enter a name, “SMA cross stats - descending”
- Select the Column A tab and enter the following formula.
- p1:=Mov(Stoch(5,3),3,S);
- y:=20;
- z:=30;
- may:=Mov(p1,y,S);
- maz:=Mov(p1,z,S);
- tc:=(y*(z-1)*Mov(p1,z-1,S)-z*(y-1)*Mov(p1,y-1,S))/(z-y);
- decxpred:=Cross(tc,p1);
- confdecx:=Cross(maz,may);
- Cum(decxpred);
- Click in the Col Name box and enter the text: “Total”.
- Select the Column B tab and enter the following formula.
- p1:=Mov(Stoch(5,3),3,S);
- y:=20;
- z:=30;
- may:=Mov(p1,y,S);
- maz:=Mov(p1,z,S);
- tc:=(y*(z-1)*Mov(p1,z-1,S)-z*(y-1)*Mov(p1,y-1,S))/(z-y);
- decxpred:=Cross(tc,p1);
- confdecx:=Cross(maz,may);
- destotpred:=Cum(decxpred);
- acc0desxpred:=Cum(confdecx AND Ref(decxpred,-1));
- 100*(acc0desxpred/destotpred)
- Click in the Col Name box and enter the text: “1 day”.
- Select the Column C tab and enter the following formula.
- p1:=Mov(Stoch(5,3),3,S);
- y:=20;
- z:=30;
- may:=Mov(p1,y,S);
- maz:=Mov(p1,z,S);
- tc:=(y*(z-1)*Mov(p1,z-1,S)-z*(y-1)*Mov(p1,y-1,S))/(z-y);
- decxpred:=Cross(tc,p1);
- confdecx:=Cross(maz,may);
- destotpred:=Cum(decxpred);
- acc1desxpred:=Cum(confdecx AND Ref(decxpred,-2));
- 100*(acc1desxpred/destotpred)
- Click in the Col Name box and enter the text: “2 day”.
- Select the Column D tab and enter the following formula.
- p1:=Mov(Stoch(5,3),3,S);
- y:=20;
- z:=30;
- may:=Mov(p1,y,S);
- maz:=Mov(p1,z,S);
- tc:=(y*(z-1)*Mov(p1,z-1,S)-z*(y-1)*Mov(p1,y-1,S))/(z-y);
- decxpred:=Cross(tc,p1);
- confdecx:=Cross(maz,may);
- destotpred:=Cum(decxpred);
- acc2desxpred:=Cum(confdecx AND Ref(decxpred,-3));
- 100*(acc2desxpred/destotpred)
- Click in the Col Name box and enter the text: “3 day”.
- Select the Column E tab and enter the following formula.
- p1:=Mov(Stoch(5,3),3,S);
- y:=20;
- z:=30;
- may:=Mov(p1,y,S);
- maz:=Mov(p1,z,S);
- tc:=(y*(z-1)*Mov(p1,z-1,S)-z*(y-1)*Mov(p1,y-1,S))/(z-y);
- decxpred:=Cross(tc,p1);
- confdecx:=Cross(maz,may);
- destotpred:=Cum(decxpred);
- uslsdesxpred:=Cum(confdecx AND decxpred);
- 100*(uslsdesxpred/destotpred)
- Click in the Col Name box and enter the text: “useless”.
- Select the Column F tab and enter the following formula.
- p1:=Mov(Stoch(5,3),3,S);
- y:=20;
- z:=30;
- may:=Mov(p1,y,S);
- maz:=Mov(p1,z,S);
- tc:=(y*(z-1)*Mov(p1,z-1,S)-z*(y-1)*Mov(p1,y-1,S))/(z-y);
decxpred:=Cross(tc,p1);
- confdecx:=Cross(maz,may);
- destotpred:=Cum(decxpred);
- acc0desxpred:=Cum(confdecx AND Ref(decxpred,-1));
- acc1desxpred:=Cum(confdecx AND Ref(decxpred,-2));
- acc2desxpred:=Cum(confdecx AND Ref(decxpred,-3));
- uslsdesxpre:=Cum(confdecx AND decxpred);
- 100-(100*(acc0desxpred+acc1desxpred+acc2desxpred+uslsdesxpre)/destotpred)
- Click in the Col Name box and enter the text: “false”
- Click OK to close the exploration editor.
The recommended notes for this exploration are:
columns descriptions:
1: total descending predictions
2: percent confirmed 1 day later
3: percent confirmed 2 days later
4: percent confirmed 3 days later
5: percent useless (confirmed same day as prediction)
6: percent of false predictions
It should also be noted that MetaStock version 10 users can put all 12 columns, both explorations, into a single exploration. It would only require changing the column names just a bit in order to easily tell which ones are for the ascending crosses and which ones are for the descending crosses. The second exploration would then have its formulas put in columns G through L.
William Golson
Equis International
Contents
- Affine transformation
- Anticipating Moving Average Crossovers
- At Last! A Trend-Friendly Oscillator
- Average True Range or Standard Deviation
- Balance of Market Power
- Between Price and Volume
- Bollinger Band Targets
- BONUS ISSUE: Mutual Fund Screen
- Boosting Profitability - the AIM Indicator
- Breakout_Range2
- Bridging the Gap, Linking Point & Figure and Bar Charts
- Buff Up Your Moving Averages
- Bull and Bear Balance Indicator
- Candlestick Filtering
- Coding Candlesticks (II)
- Confirming the Price Trend
- Creating Multi-Colored Indicators in MetaStock
- Darvas-Style Trading and Something Darvas
- Deviation Oscillator
- Directional Breakout
- Ehlers Filters
- Elastic Volume Weighted Moving Average
- Finding Key Reversals
- Fisher Transform
- FVE - %b
- FVE - lin reg slope
- FVE - Storz's divergence
- FVE w/ linear regression slope
- High Low Strategy
- High Tech Mesa Adaptive Moving Averages
- Hilbert Indicators Tell You When to Trade
- Holding Overnight Positions
- Hot Zones
- How Smooth is Your Data Smoother
- Ichimoku Charts
- Index of Chart Sentiment
- Laguerre Filter
- Laguerre RSI
- MACD of Relative Strength
- Moving Average Crossovers
- Moving Average: Long on Talk, Sort on Action
- Normalization
- Now's The Time To Trade Crude
- Pivot point Strategy
- Profit with ETFs
- Quicken Your Averages
- Red-Green Strategy
- Refining the Hilbert Indicator
- Regularization
- Relative Performance Charting
- RSI Bands
- Squelch Those Whipsaws
- sRSI - Original
- sRSI - Using Wilders
- Stochastics
- Tandem Studies on Market Movement
- Targeting Your Pattern
- TC 2000 Scans
- The Average Peak Excursion
- The Cocked Gun Revisited
- The Inverse Fisher Transform
- The Self-Adjusting RSI
- The Truth about Volatility
- The Wilson Relative Price Channel
- Thrust Oscillator
- Trade Against the Gap
- Trade Into the Gap
- Trade the Swing Price
- Trend Continuation Factor
- Trend Quality Indicator
- Trend Trigger Factor
- TrendIV & Volume - Buy Signal
- TrendIV & Volume - Sell Signal
- Triggering Your Trading System
- Using Money Flow to Stay with the Trend
- Using Volume to Detect Shifts In Power
- Volatility System
- VWAP for Support and Resistance
- When and When not to Trade