4

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.

Thiago Locks
  • 301
  • 3
  • 7

1 Answers1

2

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.

vitvlkv
  • 782
  • 7
  • 13