TradingView
ruckard
5 Th08 2020 21:21

LB Squeeze Momentum Divergences 

Bitcoin / TetherUSBinance

Mô tả

This study tries to highlight LazyBear Squeeze Momentum divergences
as they are defined by
TradingLatino TradingView user
Squeeze momentum green peaks are connected by a line
Associated prices to these green peaks are also connected
If both lines have a different slope orientation
then there is a divergence.

It only shows two last divergence lines and angles.

The original chart screenshot shows some divergence lines
on the top or main chart
these were drawn manually
because you cannot write to two different charts
from the same pine script study (Well, not in August 2020 anyways)

It's aimed at BTCUSDT pair and 4h timeframe.

HOW IT WORKS
Simple geometric mathematics are used
to calculate the two lines degrees
Then both degrees are compared
to show if both lines agree ( // or \\ )
or if they disagree ( /\ or \/ )

SETTINGS
(SQZDiver) Show degrees [False]: Show degrees of each Squeeze Momentum Divergence
lines to the x-axis.
(SQZDiver) Show desviation labels [True]: Whether to show
or not desviation labels for the Squeeze Momentum Divergences.
(SQZDiver) Show desviation lines [True]: Whether to show
or not desviation lines for the Squeeze Momentum Divergences.

(ADX) Smoothing [14]
(ADX) DI Length [14]
(ADX) key level [23]
(ADX) Print [False]: Whether to show
or not scaled ADX line

(SQZMOM) BB Length [20]
(SQZMOM) BB MultFactor [2.0]
(SQZMOM) KC Length [20]
(SQZMOM) KC MultFactor [1.5]
(SQZMOM) Use TrueRange (KC) [True]
(SQZMOM) Print [True]: Whether to show
or not Squeeze Momentum indicator.

WARNING
Some securities and timeframes might output degrees
too next to zero.
The code might need to be tweaked to meet your needs.

USAGE
One strategy is to sell when you are in a long entry
when you find out that the price slope is upwards ( / )
while the lb smilb slope is downwards: ( \ )
E.g. You will see:
/
\
on the indicator.

Why?
Because it might signal you that the price is
going to correct downwards soon.

FEEDBACK 1
Please let me know if there is any
other strategy based on the red side of
LB Squeeze Momentum
so that I might add support for it in the future.

FEEDBACK 2
Calculating degrees in a chart
with a different x-axis scale
is a nightmare
that's why I did not a range settings
so that values next to zero are
converted into zero
and thus showing an horizontal line.

Feedback is welcome on this matter.

EXTRA 1
If you turn off showing the divergence lines
and if you turn off showing the divergence labels
you almost get what TradingLatino user uses
as its default momentum indicator.

EXTRA 2
Optionally this indicator can show you
a rescaled ADX (it only works properly on 2020 Bitcoin charts)

[B]ABOUT COLOURS[/B]
TradingLatino user has both dark green and light green
inverted compared to this LB SQZMOM chart.

CREDITS
I have reused and adapted some code from
'Squeeze Momentum Indicator' study
which it's from TradingView LazyBear user.

I have reused and adapted some code from
'Directional Movement Index + ADX & Keylevel Support' study
which it's from TradingView console user.

Phát hành các Ghi chú

ADX improvements:
  • Now the ADX value is properly plotted with the correct scale.
  • Added different colours for ADX when it goes downwards or upwards
  • ADX Keylevel (23) line is now shown in silver colour when ADX is below the keylevel. It is shown in white colour when ADX is above the keylevel.
  • Added optional label for knowing what's the last bar ADX value.
  • Now you can see the ADX value for every bar on the Data Window.

Phát hành các Ghi chú

ADX improvements:
  • Added ADX Scale
  • Option to enable or disable ADX scale


Please be aware that the drawn ADX Scale is only accurate on the last values of ADX.
Bình luận
leofranjav
te quedo increible este script! solo tengo 2 dudas, ¿la primera es si el tema de la divergencia solo aplica para detectar unicamente correcciones o tambien impulsos? pues noto que solo se traza unicamente en lo verde, y la segunda es ¿si la linea se va trazando en tiempo real cuando detecta la divergencia? gracias. por su maravillo trabajo. un saludo
ruckard
@leofranjav, Creo que sí que se traza en tiempo real pero no estoy seguro.

Por otro el script sólo muestra las divergencias de lo verde. No de lo rojo que entiendo es con lo que te refieres a impulsos.

Hacer que se mostrasen ambos supongo que era muy complicado.

Copiar y pegar el studio y hacerlo para los rojos parece bastante directo pero, claro, habría que ponerse.
lorenzoscoccia
beautiful. would be amazing to make it work in all charts.
ruckard
@lorenzoscoccia, I am tempted to do the same indicator for the top char but I'm afraid of TV considering it a non original study and thus duplicated (so that they delete it).
manthur
How many bars before the divergence is confirmed and painted to the chart?
ruckard
@manthur, No bars, maybe one bar. The divergence is painted as soon as it's detected.
fagervan
why is adx keylevel crooked? how do i put it right
ruckard
@fagervan, That's because of different scale with the Squeeze Momentum.
Having a crooked ADX is the price you have to pay to avoid using one extra indicator.

If you don't mind using an extra indicator just use a traditional ADX indicator in order to paint it.
RB_TRADER
Thanks!
Thêm nữa