nikoschopen 2,824 posts msg #42425 - Ignore nikoschopen |
3/24/2006 4:07:14 PM
MACD Composite isn't currently supported by SF, but you can prolly code it ureself. Here's the MetaStock formula for MACD-C that I found on the net.
_________________________
{ MACD or Histogram based on multiple EMA's }
{ Incorporating automatic overbought/oversold
levels }
{ ©Copyright 2005 Jose Silva }
{ http://www.metastocktools.com }
{ User inputs }
plot1:=Input("[1]MACD, [2]Histogram",1,2,1);
plot2:=Input("[1]MACD/Hist, [2]Normalized",
1,2,1);
pds:=Input("Signal/Histogram EMA periods",
2,260,21);
{ Composite-EMA MACD/Histogram }
ema1:=
Mov(C,3,E)
+Mov(C,5,E)
+Mov(C,8,E)
+Mov(C,11,E)
+Mov(C,14,E)
+Mov(C,17,E);
ema2:=
Mov(C,30,E)
+Mov(C,35,E)
+Mov(C,40,E)
+Mov(C,45,E)
+Mov(C,50,E)
+Mov(C,56,E);
emaComp:=ema1-ema2;
signal:=Mov(emaComp,pds,E);
hist:=emaComp-signal;
{ Choose MACD or Histogram }
MacdH:=If(plot1=1,emaComp,hist);
{ Normalized MACD/Histogram }
normMod:=Highest(MacdH)-Lowest(MacdH);
normMod:=If(normMod=0,.000001,normMod);
MacdHnorm:=
((MacdH-Lowest(MacdH))/normMod-.5)*200;
{ Choose standard/normalized }
MacdComp:=If(plot2=1,MacdH,MacdHnorm);
signal:=Mov(MacdComp,pds,E);
{ MACD/Hist average }
avg:=Cum(MacdComp)/Cum(IsDefined(MacdComp));
{ MACD/Hist auto boundaries }
pk:=Ref(MacdComp,-1)>MacdComp
AND Ref(MacdComp,-1)>Ref(MacdComp,-2)
AND Ref(MacdComp,-1)>avg;
pkVal:=ValueWhen(1,pk,Ref(MacdComp,-1));
tr:=Ref(MacdComp,-1)<MacdComp
AND Ref(MacdComp,-1)<Ref(MacdComp,-2)
AND Ref(MacdComp,-1)<avg;
trVal:=ValueWhen(1,tr,Ref(MacdComp,-1));
Obought:=Cum(pkVal)/Cum(IsDefined(pkVal));
Osold:=Cum(trVal)/Cum(IsDefined(trVal));
{ Plot in own window }
Obought; { Red }
avg; { Grey }
Osold; { Blue }
If(plot1=1,signal,avg); { Green }
MacdComp { Yellow }
|