OPEN-SOURCE SCRIPT

Buy and Sell with Oscillator Divergence

已更新
This exploratory script provides a graphical representation of "Peaks" and "Dips" during market expansion, where traders are likely to take part of their profits. One possible use is with a contrarian entry strategy: selling when buyers have finished taking their profits and buying when sellers have finished taking their profits. This is achieved by comparing the strength of an existing trend by analysing the price and any given oscillator between two consecutive peaks or dips for regular divergences.

The script combines Bollinger Band expansion to detect extreme points. It then compares a single oscillator of choice (e.g., RSI, CCI, Stoch RSI, or MACD) to determine whether the value of the oscillator between two Bollinger Band extremes is increasing or decreasing, thereby detecting possible divergence with the price. Additionally, there is an option to include any other oscillator of choice as an input source for the oscillator, provided that it is loaded on the chart.

In an uptrend, if the price continues to peak higher while the oscillator peaks lower, it indicates signs of bullish exhaustion. Conversely, in a downtrend, if the price keeps dipping lower while the oscillator dips higher, it signals bearish exhaustion.

The above can be used in conjunction with price action analysis to identify entry or exit points near key areas of support or resistance. The script is intended for exploratory and educational purposes, is a work in progress, it requires further tunning, and does not constitute financial advice.
版本注释
Added a check for volume and relative volatility to filter out signals which happen during low volatility sessions.
版本注释
-Made some cosmetic changes.
-Added additional BUY, SELL signals to compare divergence between two consecutive BUY or two consecutive SELL signals.
版本注释
- Fixed some bug in the logic to filter out unnecessary signals.
multitimeframeOscillatorsTrend Analysis

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明