TradingView
RicardoSantos
18 Th12 2019 15:38

[RS]MTF Candle Sticks 

Euro Fx/U.S. DollarFXCM

Mô tả

Displays the multiple timeframe candlestick bars offset'd after price.

Phát hành các Ghi chú

Removed a input that was not doing anything.
its possible for the candles to overlap if there are big time intervals, its a known issue.

Phát hành các Ghi chú

Added input for spacing the bars.

Phát hành các Ghi chú

Added optional labels and horizontal lines for hi/lo's.

Phát hành các Ghi chú

added countdown to label, and option to show a specific number of candlesticks.

Phát hành các Ghi chú

update function to show missing zeros on single digit hour and minute countdown.
Bình luận
sam_m400
very good ... Is anyway to show candle of all other higher TF on LTF ?? This will help to see candle pattern that is forming in higher pattern when trade in lower time frame. eg i used to set at 5 m TF for intraday but could see what is candle formation happening in 15m, 1 hr, 4 hr ,D and W? This will help to exit quickly in lower time frame being a formation of some doji pattern observed in HTF.. I am not expert in coding ,so asking whether it is possible to do ? . If possible it will really amazing...
sam_m400
I tried for BTCUSD .. it is showing HTF candle in LTF but when in tried in scripts which i trade INFY, AJANTPHARM etc it is not coming only candle for W is showing.. Please help..
sam_m400
I will be in 5 M TF and trying to see the HTF candles of 15M, 60, 4 Hr, D and W.. but it is showing only for W candles... When i tried with BTCUSD it is showing all HTF candles perfectly at 5 M which is LTF.. Can you please see using my scripts to make me understand ??
RicardoSantos
@sam_m400, did you try changing the spacing input in the configuration? this is due to having bar hidden on session break, the candles get stacked on top of each other, theres no solution for this currently unfortunately.
sam_m400
I got it ..Thanks ... It is issue with spacing..

Thanks for amazing code that really works..
OutsourcE
how`d you interpret those?
RicardoSantos
@OutsourcE, the same way you do the normal counterpart >.<
Rodri_Fernando
amazing awesome waooo
tamir54
Hi Ricardo

It is amazing indeed.

I don’t know how to open a new discussion so I use this session on MTF analysis to ask for more. Apologies in advance.

Following is a simplified script which was originally written by ChrisMoody.
Yet, when used with lower time frame, this script records the last value of the outRSI2 (value of the last lower time frame bar) once the higher time frame closes. The other internal lower time frames outRSI2 are not recorded.
I wonder, is it possible to record each lower time frame close of the outRSI2 within the higher time frame? Further, is it possible to define 2 variables that one of them records higher values of outRSI2 and the other records lower values of the outRSI2 with respect to their preceding bar?

Example:
Suppose I am using 1H (the higher time frame) chart and 15m as my lower time frame for the outRSI2. Now, there should be, obviously, a total of 4 records of outRSI2. Further, this outRSI2, within the 15 minutes time frame, may have, for example: 45 (last close), 50, 60, 55 & 70. In this example, we have 3 values of outRSI2 that are greater than their previous outRSI2 bar and of course 1 outRSI2 bar that is less (or equal) than its preceding bar.

So, I would like to know how these values of outRSI2 can be recorded (and plotted).

Thanks a lot.
Tamir

study(title="RSI MTF", shorttitle="RSI Multi Time Frames", precision=2)
len = input(14, minval=1, title="Length")
useCurrentRes = input(true, title="Use Current Chart Resolution?")
resCustom = input(title="Use Different Timeframe? Uncheck Box Above", type=resolution, defval="60")
resCustom2 = input(title="Use 2nd RSI? Check Box Above", type=resolution, defval="D")
useCurrentRes2 = input(false, title="Use 2nd RSI Plot On Samet Timeframe?")
len2 = input(14, minval=1, title="2nd RSI Length")

src = close

res = useCurrentRes ? period : resCustom
res2 = useCurrentRes2 ? period : resCustom2

rsi = rsi(src, len) //down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
outRSI = security(tickerid, res, rsi)

rsi2 = rsi(src, len) //down2 == 0 ? 100 : up2 == 0 ? 0 : 100 - (100 / (1 + up2 / down2))
outRSI2 = security(tickerid, res2, rsi2)

plot(outRSI, title="RSI", style=line, linewidth=3, color=blue)
plot(outRSI2, title="2nd RSI - Different Time Frame?", style=linebr, linewidth=4, color=green)
RicardoSantos
@tamir54, there is no issue with the higher timeframes, the problem is with when pooling the lower timeframes since they have much lower historic data, you can still query the lower timeframe on live candle and it will show the flowing lower value that will be repainted once there is a new lower timeframe bar..

if i understood your question
rsi = rsi(src, len)
outRSI = security(tickerid, res, rsi)
outRSI2 = security(tickerid, res, rsi[1])

should resolve your issue..
Thêm nữa