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

Notification

Icon
Error

Options
Go to last post Go to first unread
mark91345  
#1 Posted : Friday, April 29, 2011 12:00:31 PM(UTC)
mark91345

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 1/6/2009(UTC)
Posts: 36
Location: Los Angeles

Thanks: 4 times
Hi,
How can I find the average closing price at $0.10 or less over the last 90 days?

I get stuck trying to figure the "average" part.

Thanks,
Mark

wabbit  
#2 Posted : Friday, April 29, 2011 12:13:30 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)
Something like:

Code:

data:=C;
limit:=0.10;

lookback:=90;


test:=data<=limit;

num:=sum(data*test,lookback);
den:=sum(test,lookback);

avg:=num/max(den,power(10,-8));

{plot/return}
avg;



wabbit [:D]

mark91345  
#3 Posted : Friday, April 29, 2011 12:20:07 PM(UTC)
mark91345

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 1/6/2009(UTC)
Posts: 36
Location: Los Angeles

Thanks: 4 times
Thanks for your great - and quick - response!

Mark

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.