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.

オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?