[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cleaning House



PureBytes Links

Trading Reference Links

These are the codes for the MACD Momentum, created by Barbara Star,from the
Feb., 1994  Technical Analysis of Stocks and commodities. It is believe to
be a leading indicator and I've created a system based on this indicator.

The idea: Take the difference between  Gerald Appel's MACD's histogram and 
the histogram's value DSP bars ago and smooth it with an Smth bar
exponential (or simple) moving average. When this differrence crosses below
zero, the tradable is predisposed to go down. When the histogram actually
turns negative, go short. When the difference crosses above zero, cover the
short trade. And when the histogram actually turns positive, go long. Cover
when the difference crosses below zero.

----------------------------------------------------------------------------
---------------------
{User Function: McdMo}
Inputs: R(Numeric),S(Numeric),Q(NUmeric),Dsp(Numeric),Smth(Numeric);
Vars: Mo(0),Avg(0),Diff(0);

Mo=MACD(C,R,S);
Avg=XAverage(MACD(C,R,S),Q);
Diff=Mo-Avg;
McdMo=Average(Diff-Diff[Dsp],Smth);

Notes: This calculates the  difference between theMACD histogram and its
value DSP bars ago, smooth by an SMTH bars simple moving average.

----------------------------------------------------------------------------
------------------------------
{user Function: MacdDiff}
Inputs: R(Numeric),S(NUmeric),Q(Numeric);
Vars: Mac(0),Avg(0);

Mac=MACD(C,R,S);
Avg=Xaverage(MACD(C,R,S),Q);
MACDDiff=Mac-Avg;

Notes: This is the Macd Histogram.
----------------------------------------------------------------------------
--------------------------------
{indicator: Macd Momentum}
Inputs: R(12),S(26),Q(9),Dsp(10),Smth(3);
Vars: Mo(0),Diff(0);

Diff=MacdDiff(R,S,Q);
Mo=McdMo(R,S,Q,Dsp,Smth);
Plot1(Diff,"Diff");
Plot2(Mo,"Macd Mo");
----------------------------------------------------------------------------
---------------------------------
{system: Macd Momentum}
Input: R(12),S(26),Q(9),Dsp(10),Smth(3);
Vars: Mcdif(0),McdCr(0);

Mcdif=MacdDiff(R,S,Q);{Trigger}
McdCr=McdMo(R,S,Q,Dsp,Smth);{Filter}
Condition1=McdCr<0 and Mcdif  crosses below 0;
Condition2=McdCr>0 and Mcdif crosses above 0;
Condition3=McdCr crosses above 0;
Condition4=mcdCr crosses below 0;

If Condition1 then sell 1 contract on close;
If Condition3 then exitshort 1 contract on close;
If Condition2 then buy 1 contract on close;
If Condition4 then exitlong 1 contract on close;


_____________________________________________

"The mark of a successful commander is the ability to adapt 
rapidly to the constantly changing conditions on the field of
battle."

-Carlo D'Este on Field Marshall  Walter Model