OPEN-SOURCE SCRIPT
Cập nhật Realtime Divergence for Any Indicator

This indicator is an addon to any oscillating indicator. It shows divergences. It shows realtime divergences too. Realtime divergences are potential divergences because the actual pivot is not fully formed.
It shows:
Reatime divergence lines are dashed lines while non-reatime are solid.
This script also offers a fair bit of control over what you can accept as a legitimate divergence.
Also note that functions tend to not work properly in conditional and loop structures so I couldn't use a lot of functions and consequently my script is really big. Sorry.
It shows:
- Regular Bullish Divergences
- Hidden Bullish Divergences
- Regular Bearish Divergences
- Hidden Bearish Divergences
Reatime divergence lines are dashed lines while non-reatime are solid.
This script also offers a fair bit of control over what you can accept as a legitimate divergence.
Also note that functions tend to not work properly in conditional and loop structures so I couldn't use a lot of functions and consequently my script is really big. Sorry.
Phát hành các Ghi chú
I've added support for price chart divergence lines.I've added a flags/labels option to help quickly recognize the different types of divergences.
To use this script with the price chart you must do 2 things: check the Overlay Chart setting, and choose the desired oscillator input from Source Input
NOTE: This script currently is designed to use ANY different sized pairing of divergence lines between the price and oscillator. So, even if the price has a super small divergence line and the oscillator has a huge one - that will currently still be used as a legit divergence. The effect is that you'll get some divergence signals that may not be desirable. Sorry.
I'm going to figure out a reasonable way to allow varying length divergence pairings between price and oscillator while somehow filtering out the undesirable divergences. One idea is to filter out any pairing where one divergence is X amount too much bigger than the other divergence.
Phát hành các Ghi chú
I removed "Minimum Pivot Height" option because it's not very useful. At least not in it's current state. The "Pivot Look Back" option mostly achieves the same idea. The more bars that make up the pivot - the bigger the pivot.I partially fixed the bug that caused the PlotShape labels to increase when the "Allowance for Misalignment Between Price and Oscillator" option increased. There was only supposed to be one label per line.
I'm still casually trying to figure out a reasonable way to allow for varying length divergence lines between price and oscillator but only the acceptable ones. I think most Divergence scripts only give exact same length divergence lines.
Phát hành các Ghi chú
I refactored a little bit, or at least I tried.I added no new features.
Phát hành các Ghi chú
I added alerts for the realtime (i.e. potential) divergences.I added labels for realtime divergence lines. I haven't investigated but it looks like divergence lines won't get rendered until AFTER their alert, if set, is completed. If so, I'll possibly fix eventually.
Phát hành các Ghi chú
Just a few minor changes. Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
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.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
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.