LonesomeTheBlue

Start the Script on Last Nth Bar [Experimental]

LonesomeTheBlue Wizard 업데이트됨   
Hello Pine Scripters,

Sometimes we need to run some processes in the scripts on last N bar but currently we don't know bar_index value of realtime bar or number of remaining bars before we reached it. So most of us use "start date" as input and run some processes after "start date".

This experimental script finds last Nth bar approximately. As you can see in the script we (should) use GMT, otherwise as I see the result might not be accurate (we don't know timezone used on the chart)

The idea is to find/use similar bar in the past (using timenow as reference) and then calculate aproximate the time of last Nth bar. the results may not be accurate all the time, also we can not know local holidays etc.

At the moment the script works on 1minute or higher time frames (it won't work on less 1min timeframes)

In the future if the Pine Team add something like "bar_index_realtime" then we will not need such things. by the way many thanks to Pine Team, they are doing great job.

You can use this script in your scripts as you want, no need to ask permission. If you can improve it let me know ;)


Enjoy!
릴리즈 노트:
Fixed UTC type as float. UTC value should be same as chart timezone. (www.tradingview.com/...bottom-of-the-chart/)

오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?