Peter_O

RSI MTF by PeterO

This is my take on reaching Higher TimeFrame charts, what is usually helpful when determining the trend. On the example of RSI.

So imagine you want to check RSI from higher timeframe. 15x higher for example. There are 3 ways to do it.

1. security(tickerid,"15",rsi(close,14))

DON'T!!! I strongly advise against this method. Security() function is buggy in PineScript, leads to so-called "repainting" issues. Repainting is caused by creating leak from future data and leads to abnormally fantastic strategy backtest results like the one in Open Close Cross Strategy. Theoretically speaking if security() used correctly - with Pine version3 and barmerge.lookahead_off - you should encounter no repainting, but I could swear I saw scripts repaint even with security() implemented properly.

Even assuming security() implemented correctly will not repaint - it will create delay in your script. I'm using "15" multiplier in my example, and this means, I have to wait for 15 candles to close to produce indicators value. If a strong move happens in the meantime, I'm blind, because I have to wait anyway.

So for your own security, stay away from security() at all times.

2. rsi(close,14*15)

This will produce RSI plot with no delay, but a very flattened one. RSI will move between 45 and 45, never even reaching 30 or 70 levels. So pretty useless.

3. Dig-in-the-formula way.

Doing a bit more math produces RSI line, which is not delayed, not repainting and moving in full 0-100 RSI range. Actually - looking almost identical to the one from the higher timeframe. Which was the goal of this script.

I auto-execute TradingView Alerts into MT4/MT5 using this: www.tradingconnector.com 1-second delivery. Ping me if you need support with installation.
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?