weighted_value function

Calculate weighted stock values using FIFO/LIFO