I have been trying to get pinescript to open buy and sell orders without closing orders in the opposite direction. Is that possible?
No, this is not possible. Hedging is currently not supported.
If you really need this, you can create an indicator and simulate all the strategy behavior there.