Reputation: 25
I'm making a strategy in Pine script v5, at the moment either if I run ONLY Long trades or Short trades my script works fine, but when i run long and short trades at the same time the strategy first closes the current trade and then opens the new one. I know this logic makes sense but I would like to manage my trades separately so for example even if I already have a Long trade opened and a short signal occures I want to keep both positions open. Is it possible? thanks
Upvotes: 2
Views: 3571
Reputation: 1094
The strategy you're describing is called "hedging" which is having both long and short trades opened at the same time. Unfortunately this is not possible with the current version of Pine Script, at least not on the same trading instrument.
Upvotes: 3