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

Notification

Icon
Error

Options
Go to last post Go to first unread
Wienke  
#1 Posted : Sunday, September 11, 2005 6:58:29 PM(UTC)
Wienke

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/4/2005(UTC)
Posts: 2

Hi, is there any way to gain access to the index (k=1,....,periods) within the summation function to run calculations like sum(C*k, periods) ? Have been searching in various places and hope I don't bother the forum too much with this question. Thanks! Reinhard
Patrick  
#2 Posted : Monday, September 12, 2005 7:34:26 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Wienke, I might not have understood your request, I'm having some reading problems lately :D Try this : sum(C*cum(1), periods) Patrick :mrgreen:
Wienke  
#3 Posted : Friday, September 16, 2005 7:59:48 AM(UTC)
Wienke

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/4/2005(UTC)
Posts: 2

Patrick, thanks a lot and sorry the question had not been clear and explained in better way. What I would need to do is to perform a calculation possibly using sum() that actually uses the index (=number) of the added elements. E.g. A weighted summation over 3 periods (k=1,2,3) -> sum(k/periods * C, periods). In effect it should calculate the following: 1/3 * C + 2/3 * C + 3/3 * C for each value of the custom indicator. Have not figured out how to use cum(1) in this context as cum(1) will give me the n-th index order from the start of the chart. I would need the index values (1,2,3) as abovefrom the start of the summation. Hope this may help to clarify my question. Thank you. Reinhard Wienke
Jose  
#4 Posted : Friday, September 16, 2005 11:42:58 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
Reinhard, try this MS code: [code:1:69b9c5846e] ================ Summation Index ================ ---8<----------------------- { Summation index, aka % Exponential Moving Avg} { ©Copyright 2005 Jose Silva } { For personal use only } { josesilva22@yahoo.com } { User Inputs } wght:=Input("Weighting 0~100%", 0,100,66.666667)/100; x:=Input("use Open=1 High=2 Low=3 Close=4 WClose=5 MP=6",1,6,4); { Select price field } x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,WC(),If(x=6,MP(),C))))); { Exponential %-weighted Moving Average } Ema:=x*wght+PREV*(1-wght); { Plot on price chart } Ema ---8<----------------------- [/code:1:69b9c5846e] jose '-) http://www.metastocktools.com
Users browsing this topic
Guest (Hidden)
Similar Topics
The McClellan Oscillator and Summation Index (Formula Assistance)
by masterdata 9/27/2005 1:15:57 AM(UTC)
McClellan Summation Index (Formula Assistance)
by Patrick 8/19/2005 4:29:43 PM(UTC)
NYSE McClellan Summation Index (Formula Assistance)
by henry1224 4/7/2005 1:24:55 AM(UTC)
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.