write code in python to buy and sell stocks using macd crossover strategy