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 : Tuesday, November 17, 2015 3:44:37 AM(UTC)
mark91345

Rank: Advanced Member

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

Thanks: 4 times

If I want to calculate the difference between today's low and yesterday's low, I can use this formula:

If(LOW < Ref(LOW, -1),  LOW - Ref(LOW, -1), 0)

 

However, I want to find the total sum of all the differences for the WEEK, but ONLY when today's price is less than yesterday. For example,

Fri =   1.08   

Mon = 1.00   (8  cents lower than Friday)

Tue = 0.90   (10 cents lower than yesterday)

Wed = 0.85   (5 cents lower than yesterday)

Thu = 1.20    (don't include it, because it's higher than yesterday)

Fri   = 1.00   (20 cents lower than yesterday)


The sum of ONLY the ones whose price is lower than the day before = $0.43.

 


I guess another way of interpreting this is:

If Fri low < Mon low, and Tue low< Mon low, and Wed low< Tue low, and Thu low< Wed low, and Fri low< Thu low

then

Sum up (Mon low - Fri low) + (Tue low - Mon low) + (Wed low - Tue low) + (Thu low - Wed low) + (Fri low - Thu low)

 

 

I was looking the different Functions, but I cannot seem to figure it out.

 


 

Edited by user Tuesday, November 17, 2015 3:52:47 AM(UTC)  | Reason: Not specified

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.