Trendoscope

Divergence Backtester

There is n number of possible ways in which we can backtest divergence and this is just a start :)

In this script, we are trying to count how many times the pivots made HH, HL, LH, LL after a particular divergence state.

An example of using data is as below:


The script keeps track of each pivot sentiment and resulting next pivot state. As mentioned in the chart snapshot, we can look at two of the previous pivot states and collect stats on how each of these state impacted price action.

As mentioned before, this is just tip of iceberg. Further combinations for which we can do backtest are:

1. m X n combinations of last pivot and last to last pivot divergence state
2. divergence combined with double divergence state.

Only issue to explore further is lack of space on the chart as tables can take up huge space.

PS: As you can see based on historical stats, probability of divergence impacting the change of trend is very low in most cases.

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 đồ?