The script shows a workaround for stack in pine-script via drawings. There are few restrictions with them: 1. The depth of the stack cannot be more that amount of allowed drawings (about 40 by now) 2. Because the stack shares the space of drawings throughout the whole script, using drawings with the stack must be careful, with handly creating and removing of each drawing, because otherwise pine's garbage collector might break the stack 3. push() and pop() must be called on every bar, because of implementation of functions in pine there are inner serieses, which must be updated on every bar. So wherever you have a setter or getter in the code - it must be called on every bar. But if it's just an update, then you should pass 'false' as a param of the funtion.
And the example of using the stack: if the stack is empty - then fill it and taking by a value per bar till the stack is emty and then fill it again.
진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.