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

Notification

Icon
Error

Options
Go to last post Go to first unread
Nathan  
#1 Posted : Saturday, November 7, 2009 8:59:44 PM(UTC)
Nathan

Rank: Member

Groups: Registered, Registered Users
Joined: 10/12/2009(UTC)
Posts: 13

Hi, I know the first prev is assumed to be 0. My question is: can I initialize prev with some other value. E.g. IF plot C*1.03
mstt  
#2 Posted : Sunday, November 8, 2009 1:46:55 AM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)

Hi Nathan

Here's an example of how an EMA might initialize or seed bar one.

{Exponential Moving Average}
Pds:=Input("Periods",1,1000,10);
Rate:=2 / (Pds+1);
EMA:=If(Cum(1)=1, C, PREV*(1-Rate) + C*Rate );
EMA;

Roy

Nathan  
#3 Posted : Sunday, November 8, 2009 4:59:15 AM(UTC)
Nathan

Rank: Member

Groups: Registered, Registered Users
Joined: 10/12/2009(UTC)
Posts: 13

Hi Roy, Thank you very much for your help. It is very helpful. Kind Regards, Nathan
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.