Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
No doubt, the easiest way is the direct way, as Henrry detailed. I suppose if you wanted to mix your exploration with multiple timeframes, you could adapt some of the cross timeframe indicators. For example, you could explore daily data and still get a weekly scan using Jose's Weekly close MACD. Perhaps something like this:
ENTER INTO COLUMN A
PLOTS -1 for sell signal; +1 for buy signal; 0 for no signal
[code:1:9e43994fc9]
{ Original code and concept by Jose Silva }
{ Weekly Close MACD/Signal/Histogram v4.0 }
{ For daily/intraday charts }
{ Requires either "Week's true start & end"
or "Week's true start & end(2)" indicators.}
{ ©Copyright 2002~2005 Jose Silva
The grant of this license is for personal use
only - no resale or repackaging allowed.
All code remains the property of Jose Silva.
http://www.metastocktools.com }
{shorter weekly EMA periods}
pds1:=12.3;
{longer weekly EMA periods}
pds2:=25.7;
{signal weekly EMA periods}
pds3:=9;
{ Choice of Static/Dynamic last EOW signal }
EOW:=Cum(1)=LastValue(Cum(1));
{ Reference EOW signals }
WkEnd:=EOW OR
FmlVar("Week's true Start & End","WEEKEND");
{ Week's Close }
WkCl:=ValueWhen(1,WkEnd,C);
WkCl:=ValueWhen(1,WkCl>0,WkCl);
{ Weekly EMA1 }
x:=If(pds1=12.3,0.15,2/(pds1+1));
x:=If(pds1>Cum(1),2/(Cum(WkEnd)+1),x);
WkEma1:=ValueWhen(1,WkEnd,PREV)*(1-x)+WkCl*x;
{ Weekly EMA2 }
x:=If(pds2=25.7,0.075,2/(pds2+1));
x:=If(pds2>Cum(1),2/(Cum(WkEnd)+1),x);
WkEma2:=ValueWhen(1,WkEnd,PREV)*(1-x)+WkCl*x;
{ Weekly MACD }
Mac:=WkEma1-WkEma2;
{ Weekly Signal }
pds3:=If(pds3>Cum(WkEnd),Cum(WkEnd),pds3);
Signal:=ValueWhen(1,WkEnd,PREV)*(1-2/(pds3+1))+Mac*2/(pds3+1);
{ Return value }
If(Cross(Signal, Mac),-1,
If(Cross(Mac, Signal),1,0))[/code:1:9e43994fc9]
|