I'm trying to implement a pairs trading algo in Pine Script but I don't know how to select a specific asset to buy or sell. It seems I'm locked with the current symbol.
Unfortunately this is not possible in PineScript. Yes, you may get data of a different assets with the security() function, but, it's forbidden to execute strategy.XXX functions in a secondary security context.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With