Testing a Long/Short strategy on USO intraday hourly. I think the code on flatten + short if long is off and am getting a 'insuficient funds' error. Any help would be much appreciated.

Author