TradingView
agekara
2020年12月11日午後4時25分

MTF Candlestick 

USD/JPYOANDA

詳細

One of the most important thing to understand in order to estimate the trend direction and its continuation is how the lower time frame candlesticks have been formed.
There are many processes by which candlesticks have been formed even if same size.

So in this script, daily candlestick is overlapped on the currently chart as default, and that can be changed.
Only real body is shown so as not to interfere with the currently chart.

リリースノート

I added High/Low line which are able to switch ON/OFF.
Default: off
コメント
nashlow
The indicator plots correctly in real time but not so in historical data. In historical data, the MTF boxes are way off
NeoButane
Hi, I have a suggestion to make for historical data painting, for marking mtf ranges you can try using high/low to encapsulate the entire range

sec_open = security(syminfo.tickerid, res, high, lookahead=barmerge.lookahead_on)
sec_close = security(syminfo.tickerid, res, low, lookahead=barmerge.lookahead_on)



You would still need open/close for the BullishColor/BearishColor rules, and using high/low only might affect real-time painting, so it might not be ideal. Hope this is helpful for you
agekara
@NeoButane, Thank you for your idea :)
heydarirasoul909
//@version=4
study("MTF Candlestick", overlay=true, format=format.price)

res = input("D", "Time frame", input.resolution)

sec_open = security(syminfo.tickerid, res, open, lookahead=barmerge.lookahead_on)
sec_close = security(syminfo.tickerid, res, close, lookahead=barmerge.lookahead_on)
sec_high = security(syminfo.tickerid, res, high, lookahead=barmerge.lookahead_on)
sec_low = security(syminfo.tickerid, res, low, lookahead=barmerge.lookahead_on)

FrameColor = input(color.gray, "Frame", input.color)
BullishColor = input(color.white, "Bullish candlestick", input.color)
BearishColor = input(color.blue, "Bearish candlestick", input.color)

FrameTransparency = input(50, "Frame transparency", input.integer, minval=0, maxval=100)
BodyTransparency = input(90, "Body transparency", input.integer, minval=0, maxval=100)

Show_HighAndLow = input(false, "Show High/Low ?", input.bool)
HighColor = input(color.gray, "High color", input.color)
LowColor = input(color.gray, "Low color", input.color)

plot_open = plot(sec_open, color=FrameColor, style=plot.style_stepline, transp=FrameTransparency, editable=false)
plot_close = plot(sec_close, color=FrameColor, style=plot.style_stepline, transp=FrameTransparency, editable=false)
plot_high = plot(sec_high, color=Show_HighAndLow ? HighColor:na, style=plot.style_stepline, transp=FrameTransparency, editable=false)
plot_low = plot(sec_low, color=Show_HighAndLow ? LowColor:na, style=plot.style_stepline, transp=FrameTransparency, editable=false)

fill(plot_open, plot_close, sec_open<=sec_close ? BullishColor:BearishColor, BodyTransparency, editable=false)
SNW777
@agekara please input the 20 minutes candle option?thank you
thefoolishegg
When I use replay or watch realtime Bitcoin(original candle in 1min, MTF candle plot in 5min), the close line on the plot is not right, it fails to update them on the previous candles.
nashlow
hi, compared to the rest this is a nice and simple yet effective indicator. Any chance add the wicks please?
agekara
@nashlow, I was thinking of implementing of wicks, but I am not thinking about it now. sorry
詳細