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.

즐겨찾기 스크립트에서 빼기 즐겨찾기 스크립트에 넣기

코멘트

Another great and useful piece of code. Thx Michel.
+3 응답
@LucF, Thanks, Luc.
응답
... and don't forget the single var return from security :)
+2 응답
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 응답
bravo, ingenious
+1 응답
This is great, thank you!
응답
May I call you "sensei"? Brilliant
응답
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?
응답
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 응답
MichelT Daveatt
@Daveatt, You are welcome, Daveatt!
+1 응답
홈으로 스탁 스크리너 포렉스 스크리너 크립토 스크리너 이코노믹 캘린더 사용안내 차트 특징 프라이싱 프렌드 리퍼하기 하우스룰(내부규정) 헬프 센터 웹사이트 & 브로커 솔루션 위젯 차팅 솔루션 라이트웨이트 차팅 라이브러리 블로그 & 뉴스 트위터
프로화일 프로화일설정 계정 및 빌링 리퍼드 프렌즈 코인 나의 서포트 티켓 헬프 센터 공개아이디어 팔로어 팔로잉 비밀메시지 채팅 로그아웃