I am not an expert here, but programs like Quicken (and MS Money I think) do that and brokers like IB offer interfaces to Quicken and perhaps other similar products. I also think there's a commercially available product based on Excel, but could not remember its name (other thanthe fact that I had seen it advertized.)