My algorithm is below.
I have solely long positions and have managed to keep a legal leverage with that.
However, when i tried to start shorting, leverage was crazy.
So how do I monitor and maintain leverage in shorts (i.e. tracking shorts, cash, etc.)