OPEN-SOURCE SCRIPT

Auto Order Block by D. Brigaglia

Atualizado
This indicator finds trend following engulfings, and draws order blocks based on the 1st candle's range (the first candle of the engulfing pattern).
It does filter the trend with simple moving averages of 21 and 55 periods, but it doesn't filter for retracements in the trend (you should consider only the order blocks that are coming from engulfings after a retracement)
Notas de Lançamento
- Lenght of the orderblocks visual representation extended to 50 periods;
- Rectangles are now based on the candle's body instead of the candle's range;
- Rectangles representing order blocks are now transparent, so the price action that occurs through them is now more visible;
- Color of the rectangle now tells if the trend is generally up or down, filtering the appropriate orderblocks (bullish OBs are blue, bearish are red);

The criteria by which the trend is defined is the sma(21) and sma(55) reciprocal position: if sma21 > sma55 the script considers the actual condition an uptrend. Viceversa it does consider a downtrend situations in which sma55 > sma21. These periods where chosen because I am a fan of Fibonacci numbers and I usually use these two simple moving averages to get an idea of the short-mid term trend direction, however you can set your own periods: just change the numbers in line 10 and 16 of the code.
Notas de Lançamento
Hello traders, in the latest version I completely dropped the moving averages and candlestick pattern concepts, using the ATR to estimate sharp price moves. The orderblocks shown are nothing more than the range of small candles that printed just before a sharp move in the opposite direction (suggesting that the institutionals accumulated positions with limit orders in the small candle, while the retail moved the price with market orders).
Notas de Lançamento
Aggiunti alert per notificare l'utente alla formazione di ogni nuovo order block
Notas de Lançamento
This is the new script, I updated the code but also the concept behind.
I called this setup "Volatility Expansion Level" because this is what happens (bullish example):
1 - Bears create a decent bear trend bar (body is at least 90% of last 10 bars ATR)
2 - Bulls overwhelm the bears creating a bull trend bar twice as big immediately afterwards
3 - The open/high of the original Bear bar is a breakeven exit for all the bears who are still in a losing short, making this a bullish rejection level for a while.

It's the same for shorts, but in reverse.

The name comes from the shape of the pattern: it's a considerable market move suddently followed by an opposite, twice as big move. In short, a volatility expansion. We're just defining it with OHLC bars and highlighting the level at which losing traders will probably leave their positions fueling a move we anticipated.

I have noted that often times the market makes expanding triangles breaking both highs and lows before switching from a low volatility to a high volatility environment. Often times it also tests the middle of the range before starting a trend.
This script is a simplification of this observation I made and, I hope, a more logical explanation to what is sometimes called an order block.

Nothing in my content is financial advice.
I wish you good luck, and good trading.
Average True Range (ATR)blockCandlestick analysiscircleeducationalictinnerorderorderblocktrader

Script de código aberto

No verdadeiro espírito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam compreendê-lo e analisá-lo. Parabéns ao autor! Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Quer usar esse script no gráfico?

Aviso legal