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.
Asked
Active
Viewed 1,336 times
4
-
1Have a look at the security() function. – vitruvius Nov 19 '18 at 17:39
-
security() function would not help – vitvlkv Nov 29 '18 at 09:30
1 Answers
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