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

Notification

Icon
Error

Options
Go to last post Go to first unread
jmjki  
#1 Posted : Friday, March 5, 2010 10:20:06 AM(UTC)
jmjki

Rank: Newbie

Groups: Registered, Registered Users
Joined: 3/5/2010(UTC)
Posts: 7

Hello Friends


I need formula for MACD (3-10-16 ) indicator with pull back trend


I will use backtest function with the help of this indicator



Justin  
#2 Posted : Friday, March 5, 2010 12:19:33 PM(UTC)
Justin

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 9/13/2004(UTC)
Posts: 673
Location: Salt Lake City, UT

If you are wanting to use 3-10-16 in place of 12-26-9, you can write it as follows;

Pds1:=3;
Pds2:=10;
Pds3:=16;
Mov(C,Pds1,E) - Mov(C,Pds2,E);{MACD}
Mov(Mov(C,Pds1,E) - Mov(C,Pds2,E),Pds3,E){Signal Line}

Now if you wanted to make a set of trading rules such as when MACD Crosses above or below its signal line you can modify the above formula slightly:


{Buy}
Pds1:=3;
Pds2:=10;
Pds3:=16;
X:=Mov(C,Pds1,E) - Mov(C,Pds2,E);{MACD}
Y:=Mov(Mov(C,Pds1,E) - Mov(C,Pds2,E),Pds3,E);{Signal Line}
Cross(X,Y)

{Sell}
Pds1:=3;
Pds2:=10;
Pds3:=16;
X:=Mov(C,Pds1,E) - Mov(C,Pds2,E);{MACD}
Y:=Mov(Mov(C,Pds1,E) - Mov(C,Pds2,E),Pds3,E);{Signal Line}
Cross(Y,X)
Mark17  
#3 Posted : Tuesday, July 13, 2010 8:02:14 AM(UTC)
Mark17

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/25/2010(UTC)
Posts: 55

Hi Justin, Since every single time Pds1, Pds2, and Pds3 are used for 3, 10, 16, was there a particular reason why you set-up these variables in the first place? Thanks.
Traetey  
#4 Posted : Wednesday, July 14, 2010 2:52:55 AM(UTC)
Traetey

Rank: Member

Groups: Registered, Registered Users
Joined: 3/22/2010(UTC)
Posts: 16

Mark, The result of the formula is the same, factoring out the variables makes the code more maintainable (i.e. if you want to change parameters later on it's easier to modify the variable assignments than to dig into the code). Treatey
paulotrader  
#5 Posted : Sunday, July 18, 2010 11:45:12 AM(UTC)
paulotrader

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/17/2010(UTC)
Posts: 4

Thanks a lot Justin for your formula!

For a beginner like me, it's very useful!
It's simple and I understand it!


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.