python class for dynamic stock modelling