logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
FormulaPrimer  
#1 Posted : Friday, May 23, 2014 9:42:31 PM(UTC)
FormulaPrimer

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 8/12/2005(UTC)
Posts: 73

I've been working on a more responsive MACD type indicator.
I've looked at the countless variations of MACD but I just wanted some experienced analysis of the
code I've been working on.

Code:
{MACD - Rapid (custom)
personal use only not for distribution by FormulaPrimer}

prd1:= Input("Fast period",1,200,12);
sqrtpds1:=Sqrt(prd1);
prd2:= Input("Slow period",1,200,26);
sqrtpds2:=Sqrt(prd2);
prd3:= Input("Trigger period",1,200,9);
sqrtpds3:=Sqrt(prd3);

HMA1:=Mov(2*Mov(C,prd1/2,W)- Mov(C,prd1,W), LastValue(sqrtpds1),W);
HMA2:=Mov(2*Mov(C,prd2/2,W)- Mov(C,prd2,W), LastValue(sqrtpds2),W);
HMA3:=Mov(2*Mov(HMA1 - HMA2,prd3/2,W)- Mov(HMA1 - HMA2,prd3,W), LastValue(sqrtpds3),W);

A:=(HMA1 - HMA2) ;
Sig:=HMA3;
Red:=If(A<Ref(A,-1),A,0);
Green:=If(A>Ref(A,-1),A,0);
Red{Hist};Green{Hist};Sig;


Laisze  
#2 Posted : Wednesday, May 28, 2014 11:08:15 PM(UTC)
Laisze

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 11/18/2007(UTC)
Posts: 96
Location: HK

I don't see anything zero-lag about this MacD. Try using zero periods.
FormulaPrimer  
#3 Posted : Wednesday, June 4, 2014 11:56:44 PM(UTC)
FormulaPrimer

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 8/12/2005(UTC)
Posts: 73

{MACDH - Rapid (custom) - revised
personal use only not for distribution by FormulaPrimer}

prd1:= Input("Fast period",1,200,65);
sqrtpds1:=Sqrt(prd1);
prd2:= Input("Slow period",1,200,90);
sqrtpds2:=Sqrt(prd2);
prd3:= Input("Trigger period",1,200,12);
sqrtpds3:=Sqrt(prd3);

HMA1:=Mov(2*Mov(C,prd1/2,W)- Mov(C,prd1,W), LastValue(sqrtpds1),W);
HMA2:=Mov(2*Mov(C,prd2/2,W)- Mov(C,prd2,W), LastValue(sqrtpds2),W);
HMA3:=Mov(2*Mov(HMA1 - HMA2,prd3/2,W)- Mov(HMA1 - HMA2,prd3,W), LastValue(sqrtpds3),W);
A:=(HMA1 - HMA2) - HMA3;
Red:=If(A<Ref(A,-1),A,0);
Green:=If(A>Ref(A,-1),A,0);
Red{Hist};Green{Hist};

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.