Refactored to factor out the common part of Stock and SmoothLine
Fix