Collection of useful functions for quantitative trading