TradingView
allanster
10 Feb 2020 pukul 06.38

How to Overlay First LTF Bar of Day 

Bitcoin / United States DollarCoinbase

Deskripsi

Example how to overlay the first lower timeframe bar of the day across the entire day. Set chart to a timeframe that is lower than 1 Day period. Also included option for coloring wick pressure of that bar.


NOTICE: This is an example script and not meant to be used as an actual strategy. By using this script or any portion thereof, you acknowledge that you have read and understood that this is for research purposes only and I am not responsible for any financial losses you may incur by using this script!

Catatan Rilis

Updated for Pine Script v5.
Komentar
UnknownUnicorn5012578
great
allanster
@MrSinghji, thanks appreciate the kind words!
puapua
Best ! I am starting to learn pinescrit ! Thank you so much sir!
Pratik_4Clover
Very underrated and short but great logic script, thank you :)
allanster
@OWL, thanks for your review, much appreciated!
Pratik_4Clover
@allanster, Just one question
I've applied this logic
showlastSR = input(title = "Show Only Last Period SR", defval = true)
islastSR = showlastSR ? security(syminfo.tickerid, 'D', barstate.islast, lookahead = true) : true
And implemented "islastSR" it into each plot function as condition, but it seems to still keep previous days levels as well as you can see in shared image



I think this has something to do with what TV is calculating as my local time of the first day of the week rather than what is actual day start of the script, this is why this split,maybe I'm wrong, but any ways to deal with this? Please help ^^
allanster
@OWL, this is due to trying to force the script to behave in a way it was never intended to be used. The script is meant only to plot the source values of the the first intraday bar formed. Notice in the script description that it says "Set chart to a timeframe that is lower than 1 Day period", when you use security('D') you are calling a timeframe of 1 Day period, which will not work.
Pratik_4Clover
@allanster, Thank you for clarifying that ^^

Will change the TF data importing logic and see if it works.
Lebih lanjut