USE AT YOUR OWN RISK.

I added leverage and a stoploss, cleaned up the code, and tuned it some more.

Author