Mathematical analysis for trading