Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to trade multiple assets with one script?

Tags:

pine-script

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.

like image 721
Thiago Locks Avatar asked Oct 21 '25 03:10

Thiago Locks


1 Answers

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.

like image 127
vitvlkv Avatar answered Oct 23 '25 22:10

vitvlkv



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!