MichelT

Emulating binary operations and several values in one variable

Binary operations and storing several numbers in one variable.

It's useful when you need to pass a values numbers to another study. Study-on-study (SOS) in Tradingview allows passing only one value, which is not always convinient. So if we put all those numbers in one - we can pass more values from one study to another.

In Pine we can use up to 52 bits for our data. Because of that we can put 6 1-byte (8-bit) values in one float. Or 12 4-bit values. Or 52 1-bit values.

Hilangkan dari Skrip-Skrip Favorit Tambahkan ke Skrip-Skrip Favorit

Komentar

Another great and useful piece of code. Thx Michel.
+3 Jawab
@LucF, Thanks, Luc.
Jawab
... and don't forget the single var return from security :)
+2 Jawab
MichelT michl
@michl, Oh, yes. But as far I know, it won't be a problem soon - security will be allowed to return a tuple.
+3 Jawab
bravo, ingenious
+1 Jawab
This is great, thank you!
Jawab
May I call you "sensei"? Brilliant
Jawab
Daveatt Daveatt
@Daveatt, what could be the use cases for such a script?
Apart from passing output signals for buy/sell/close buy/close sell signals

Curious to know what are the general use cases you have in mind?
Jawab
MichelT Daveatt
@Daveatt, the only I can thik of are passing values to another script and returning more values from the security function. Few times I met cases when people used too much variables in their scripts, so the scripts couldn't be compiled, because of restriction on amount of the variables. It might (franckly, I doubt, but it might) be a workaround for the restriction - putting together several variables to make a script working.
+1 Jawab
MichelT Daveatt
@Daveatt, You are welcome, Daveatt!
+1 Jawab
Beranda Penyaring Saham Penyaring Forex Penyaring Crypto Kalender Ekonomi Bagaimana Cara Kerjanya Fitur-Fitur Chart Harga Akun Refer seorang teman Tata Tertib Pusat Bantuan Solusi Website & Broker Widget-Widget Solusi Charting Perpustakaan Charting Ringan Blog & Berita Twitter
Profil Pengaturan Profil Akun dan Penagihan Teman yang di refer Koin Tiket Dukungan Saya Pusat Bantuan Ide Terpublikasikan Pengikut Mengikuti Pesan Pribadi Obrolan Keluar