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

Notification

Icon
Error

Options
Go to last post Go to first unread
vivekbajaj  
#1 Posted : Monday, January 16, 2012 10:20:46 PM(UTC)
vivekbajaj

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 12/3/2005(UTC)
Posts: 4

I was trying to compute a 3 day moving average of the Close and displace it 3 days in tinme i.e. 3X3 DMAC. I am not good in coding so I refered to the codes given in previous post. However the code doesn't work. Can any one help Vivek
wabbit  
#2 Posted : Monday, January 16, 2012 11:05:47 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Have you done the exercises in the free Equis Formula Primer? What do you mean by "doesn't work"? Why didn't you post the code you were having problems with?

Not a lot of information to go by here...

Cest la vie.

Try:

Code:

ma:=mov(c,3,s);
dma:=ref(ma,-1);

{plot}
dma;



wabbit [:D]

vivekbajaj  
#3 Posted : Tuesday, January 17, 2012 3:59:45 AM(UTC)
vivekbajaj

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 12/3/2005(UTC)
Posts: 4

Thanks Wabbit. I have now started completing the exercises in the Primer. Even though coding is not my forte I guess I can't avoid it. truly Cest la vie The code I used is Ref(Mov(C,3,S),-3). Thanks
henry1224  
#4 Posted : Tuesday, January 17, 2012 5:05:02 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
here are 3 displaced MA's recommended by Joe DiNapoli

3X3:=Mov(Ref(C,-3),3,S);
5X7:=Mov(Ref(C,-5),7,S);
5X25:=Mov(Ref(C,-5),25,S);
3X3;5X7;5X25;


For those with PowerPivots Plus add-on this allows you to compare from a higher time frame

TF:=Input("Time frame 1",1,100,1);
Off:=Input("Offset",0,100,0);
CD:= ExtFml("PowerPivots.TDataCreate",3,TF) ;
3X3:=Mov(Ref(CD,-3),3,S);
5X7:=Mov(Ref(CD,-5),7,S);
5X25:=Mov(Ref(CD,-5),25,S);
3X3:=ExtFml( "PowerPivots.TDataLocalize", 3X3, TF, Off);
5X7:=ExtFml( "PowerPivots.TDataLocalize", 5X7, TF, Off);
5X25:=ExtFml( "PowerPivots.TDataLocalize", 5X25, TF, Off);

3X3;
5X7;
5X25;
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.