Can't seem to figure out why I'm getting a negative "quantity for entry or order" when backtesting my strategy when I go Short. Long orders work fine but when I switch to shorting I get the error. My order execution for shorting is a mirror opposite of my long execution. Here is a shortened version of my order execution.
'''if LongOrShort
if (longConditions and strategy.position_size <= 0)
strategy.entry("Long", true)
if (closeLongConditions and strategy.position_size > 0)
strategy.close("Long")
else
if (shortConditions and strategy.position_size <= 0)
strategy.entry("Short", false)
if (closeShortConditions and strategy.position_size > 0)
strategy.close("Short")'''