Updated trading.py