Order Blocks Volume indicator

Order Blocks Volume indicator

Introduction

Order Blocks are critical concepts in technical analysis that help traders identify key areas where major market players have conducted significant buying or selling activities. These order blocks represent price levels at which there has been significant consolidation by institutional operators before a substantial price change. Identifying these can be crucial for determining efficient entry and exit points.

Theory of Order Blocks

An Order Block is essentially an accumulation of buy or sell orders that occur within a compact price range and can signal future price direction. These blocks are primarily categorized into two types:

  • Bullish Order Block: Forms after a downward movement, indicating an area where prices may be undervalued and where buyers might start to dominate.
  • Bearish Order Block: Develops after an upward movement and suggests an area where prices might be overvalued, attracting sellers.

The formation of these blocks indicates a pause before the market makes a significant move, making them strategic points for trading operations. There are several methodologies to calculate Order Blocks:

  • Volume-based pivots: Identify blocks where there is a significant increase in volume, suggesting an accumulation of orders.
  • Price-based pivots: Use price extremes to identify zones where the price has reacted strongly, suggesting a possible order accumulation.
  • Combination of volume and price: Analyzes both changes in volume and price for a more robust signal.

In the provided code, a volume-based pivot approach is used, where a peak in volume coinciding with a price direction change indicates the formation of an Order Block.

Indicator Configuration

The Order Block Detector indicator uses several settings to identify and visualize these important market levels:

  • length: Defines the number of bars to consider to identify a volume peak or trough, essential for determining an “Order Block”.
  • bullextlast and bearextlast: Set the number of bullish or bearish blocks to display, respectively.
  • mitigation: Decides whether the block is evaluated by the closing price or by the wick’s extreme, affecting the accuracy of the detected block.

Code of the Indicator

The code for ProRealTime facilitates the automatic implementation of the Order Block Detector. The script is designed to analyze market data and highlight areas where Order Blocks may be forming. It uses a combination of volume and price comparisons to detect these critical levels.

Interpretation of Results

Interpreting detected Order Blocks is straightforward: a bullish block suggests a potential support area and an entry point for long positions, while a bearish block indicates resistance and an entry point for short positions. The trader should observe these blocks in conjunction with other technical analysis signals to validate and strengthen trading decisions.

Conclusions

Order Blocks are powerful tools for any technical trading arsenal. Their correct identification and analysis can provide traders with a significant advantage, offering entry and exit points based on the historical activity of the market’s most influential operators. With practice and integration of this indicator, traders can significantly improve their accuracy and operational efficiency.

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Ciccarelli Franco • 218 days ago #

    Scusa, mi sembra molto simile al precedente indicatore postato da te “Demand/Supply Zone” , oppure sono diversi e io non capisco la differenza.
    Grazie

    • Iván • 218 days ago #

      Una differenza importante è che questo indicatore calcola i blocchi in base ai punti di rotazione del volume.

  2. Ciccarelli Franco • 218 days ago #

    E quindi dovrebbe essere più preciso nell’indicare le zone?

    • Iván • 215 days ago #

      No, semplicemente diverso

  3. soulintact • 217 days ago #

    Estimado Iván, gracias por publicar estos indicadores, ¡gran trabajo! Dos indicadores que realmente echo de menos de TradingView son: Chandelier Exit de Alex Orekhov y Nadaraya-Watson Envelope de LuxAlgo. Incluyo los códigos por si te gustaría programarlos en PRT, ¡gracias!

    //………………………………………………………………………………………………………………..//

    //@version=5
    // Copyright (c) 2019-present, Alex Orekhov (everget)
    // Chandelier Exit script may be freely distributed under the terms of the GPL-3.0 license.
    indicator(‘Chandelier Exit’, shorttitle=’CE’, overlay=true)

    var string calcGroup = ‘Calculation’
    length = input.int(title=’ATR Period’, defval=22, group=calcGroup)
    mult = input.float(title=’ATR Multiplier’, step=0.1, defval=3.0, group=calcGroup)
    useClose = input.bool(title=’Use Close Price for Extremums’, defval=true, group=calcGroup)

    var string visualGroup = ‘Visuals’
    showLabels = input.bool(title=’Show Buy/Sell Labels’, defval=true, group=visualGroup)
    highlightState = input.bool(title=’Highlight State’, defval=true, group=visualGroup)

    var string alertGroup = ‘Alerts’
    awaitBarConfirmation = input.bool(title=”Await Bar Confirmation”, defval=true, group=alertGroup)

    atr = mult * ta.atr(length)

    longStop = (useClose ? ta.highest(close, length) : ta.highest(length)) – atr
    longStopPrev = nz(longStop[1], longStop)
    longStop := close[1] > longStopPrev ? math.max(longStop, longStopPrev) : longStop

    shortStop = (useClose ? ta.lowest(close, length) : ta.lowest(length)) + atr
    shortStopPrev = nz(shortStop[1], shortStop)
    shortStop := close[1] shortStopPrev ? 1 : close math.exp(-(math.pow(x, 2)/(h * h * 2)))

    //—————————————————————————–}
    //Append lines
    //—————————————————————————–{
    n = bar_index

    var ln = array.new_line(0)

    if barstate.isfirst and repaint
    for i = 0 to 499
    array.push(ln,line.new(na,na,na,na))

    //—————————————————————————–}
    //End point method
    //—————————————————————————–{
    var coefs = array.new_float(0)
    var den = 0.

    if barstate.isfirst and not repaint
    for i = 0 to 499
    w = gauss(i, h)
    coefs.push(w)

    den := coefs.sum()

    out = 0.
    if not repaint
    for i = 0 to 499
    out += src[i] * coefs.get(i)
    out /= den
    mae = ta.sma(math.abs(src – out), 499) * mult

    upper = out + mae
    lower = out – mae

    //—————————————————————————–}
    //Compute and display NWE
    //—————————————————————————–{
    float y2 = na
    float y1 = na

    nwe = array.new(0)
    if barstate.islast and repaint
    sae = 0.
    //Compute and set NWE point
    for i = 0 to math.min(499,n – 1)
    sum = 0.
    sumw = 0.
    //Compute weighted mean
    for j = 0 to math.min(499,n – 1)
    w = gauss(i – j, h)
    sum += src[j] * w
    sumw += w

    y2 := sum / sumw
    sae += math.abs(src[i] – y2)
    nwe.push(y2)

    sae := sae / math.min(499,n – 1) * mult
    for i = 0 to math.min(499,n – 1)
    if i%2
    line.new(n-i+1, y1 + sae, n-i, nwe.get(i) + sae, color = upCss)
    line.new(n-i+1, y1 – sae, n-i, nwe.get(i) – sae, color = dnCss)

    if src[i] > nwe.get(i) + sae and src[i+1] < nwe.get(i) + sae
    label.new(n-i, src[i], '▼', color = color(na), style = label.style_label_down, textcolor = dnCss, textalign = text.align_center)
    if src[i] nwe.get(i) – sae
    label.new(n-i, src[i], ‘▲’, color = color(na), style = label.style_label_up, textcolor = upCss, textalign = text.align_center)

    y1 := nwe.get(i)

    //—————————————————————————–}
    //Dashboard
    //—————————————————————————–{
    var tb = table.new(position.top_right, 1, 1
    , bgcolor = #1e222d
    , border_color = #373a46
    , border_width = 1
    , frame_color = #373a46
    , frame_width = 1)

    if repaint
    tb.cell(0, 0, ‘Repainting Mode Enabled’, text_color = color.white, text_size = size.small)

    //—————————————————————————–}
    //Plot
    //—————————————————————————–}
    plot(repaint ? na : out + mae, ‘Upper’, upCss)
    plot(repaint ? na : out – mae, ‘Lower’, dnCss)

    //Crossing Arrows
    plotshape(ta.crossunder(close, out – mae) ? low : na, “Crossunder”, shape.labelup, location.absolute, color(na), 0 , text = ‘▲’, textcolor = upCss, size = size.tiny)
    plotshape(ta.crossover(close, out + mae) ? high : na, “Crossover”, shape.labeldown, location.absolute, color(na), 0 , text = ‘▼’, textcolor = dnCss, size = size.tiny)

    //—————————————————————————–}

    • Iván • 215 days ago #

      Hola
      Claro, no hay problema pero necesito que lo hagas a través de aquí: https://www.prorealcode.com/free-code-conversion/
      Si puedes compartir una imagen del indicador sería de gran ayuda

  4. Quino • 216 days ago #

    Félicitation Yvan.
    Cet indicateur est le plus intéressant et le plus pertinent que j’ai vu depuis longtemps. Il apporte une information précieuse sur la probabilité de réussite au moment de placer un trade short ou long. Il a une capabilité de prédiction sur l’évolution d’un cours bien meilleure que bien d’autres indicateur.

  5. roccafragius • 210 days ago #

    Felicitaciones Ivan, este indicador me parece muy útil y mucho más rápido que las zonas de oferta y demanda publicadas en el pasado en PRT. Estoy intentando usarlo para crear una estrategia automática de entrada y salida, pero no puedo entender en la barra actual si estoy cerca de un bloque rojo (posible cierre corto o largo) o cerca de una banda verde (posible cierre largo o corto). ¿Podrías crear una estrategia de entrada sobre esta base, para que luego cada uno pueda añadir otros filtros de entrada según su propia filosofía? ¡¡¡Gracias de antemano!!! Franco

  6. roccafragius • 208 days ago #

    Congratulations Ivan, this indicator seems to me to be very useful and much quicker than the offer and demand areas published in the past on PRT. I’m trying to use it to create an automatic entry and exit strategy, but I can’t read it in the actual bar if I’m looking for a red block (possible short or wide lock) or looking for a green band (possible wide or short lock). Could we create an entry strategy on this basis, so that at some point one can add other entry filters according to one’s philosophy? ¡¡¡Thanks in advance!!! Franco

  7. giumagi • 208 days ago #

    Hi Ivan …GREAT! thank you

  8. Regisnew • 204 days ago #

    Hello Ivan, thank you for your good work, is it possible to create a sceener to find actions with close inside the green or red bock?

    • Iván • 204 days ago #

      Hi! Yes it’s possible. I will add this to my list of tasks to do 🙂

  9. Regisnew • 203 days ago #

    finaly the screener could be something like this for green blocks but it probably could be better
    //////
    length = 5 //Volume Pivot Length
    bullextlast = 3 //Bullish OB

    mitigation = 0 //0=Wick 1=Close
    //———————————————————————-//
    //—–Global elements————————————————–//

    upper = highest[length](high)
    lower = lowest[length](low)

    if mitigation then
    targetbull = lowest[length](close)

    else
    targetbull = lower

    endif

    if high[length] > upper then
    os = 0
    elsif low[length] < lower then
    os = 1
    else
    os = os[1]
    endif
    //———————————————————————-//
    //—–Pivot Points – Volume——————————————–//
    if volume < volume[length] and highest[length](volume)highest[length](volume)[length+1] then
    $phvol[t+1]=volume[length]
    $phvolx[t+1]=barindex[length]
    t=t+1
    endif
    phv = $phvol[t]
    //———————————————————————-//
    //—–Get bullish/bearish order blocks coordinates———————//
    //—–Bullish OB
    if isset($phvol[t]) and phvphv[1] and os=1 then
    $bulltop[m+1] = (high[length]+low[length])/2
    $bullbtm[m+1] = low[length]
    $bullavg[m+1] = ((high[length]+low[length])/2+low[length])/2
    $bullleft[m+1] = barindex-length
    $bullob[m+1] = low[length]
    m=m+1
    endif
    //—–Remove mitigated order blocks————————————//
    if islastbarupdate then
    //—–Set only last x Bullish OB not mitigated
    t=0
    inside = 0
    zone = 0
    for i=m downto 0 do
    if targetbull > $bullbtm[i] then
    $bullishTOP[T+1] = $bulltop[i]
    $bullishBOT[T+1] = $bullbtm[i]
    $bullishAVG[T+1] = $bullavg[i]
    $bullishLEFT[T+1] = $bullleft[i]
    t=t+1
    Zone = 1
    if close > min($bullishTOP [t],$bullishBOT[T]) and close = bullextlast then
    break
    endif
    endif
    next
    endif
    //———————————————————————-//
    screener [Zone = 1 and inside = 1]

  10. efahmy • 95 days ago #

    the support and resistance colors become darker and darker with the time, could you please change that and make it fixed and even better if it is light colors

    • Iván • 95 days ago #

      Hi. You can change colors in lines 75,76,91,92

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Iván
3 weeks ago
Madrosat Bonjour Ivan je ne sais pas si je dois écrire en Français ,anglais ,espagnol ,il y a les 3 ...
Iván Bonjour, la vérité est que ce n'est pas aussi facile qu'il n'y paraît.... Un indicateur peut...
Madrosat Merci Ivan j'espère que ce jour viendra bientôt , je sais que ce n'est pas facile car les in...
adeelq79 Hi Ivan, thank you for this indicator. Is it possible to include the volume of buys and sell...
achel J'ai la même erreur sur ligne 1 avec une importation dans les règles de l'art. Comment faire?
Iván Cela est probablement dû au fait que vous avez une ancienne version de l'outillage. Vérifi...
Razz Hello, thank you for your indicator. Can you please tell me how I can change the text size,...
Iván Hi! you have all information about it here (https://www.prorealcode.com/documentation/drawte...
Miro Mis felicitaciones por este indicador. Funciona muy bien en el corto plazo. Gracias gracias ...
Iván
8 months ago
Iván Hi, Sorry, but what do you mean?
luiskohnen Hola, queria saber si el indicador repinta, porque a mi me parecio que si. Saludos y gracias...
Diamant Bonsoir, L'un d'entre vous peut-il me donner les définissions de LL-HH-LH et HL. Merci d'av...
MrMagic This is amazing work. Well done, Ivan!
Regisnew Bonjour Ivan serait il possible de proposer un screener pour détecter les zones de support v...
lee Thank you!
Iván Hi We could find stocks with sweep on: //PRC_Sweep Institucional //version = 0 //28.0...
inverse Like the way you think Ivan ... :)
ar Bonjour Ivan et merci pour ton partage, Est-il possible d'avoir ce code en ITF
amiri bonjour Khaled pouvez vous me dire comment regler l'indicateur pour qu'il affiche les block...
pintris Hi, same request. Could someone help in creating a screener for this great indicator that sc...
gaby IDE merci beaucoup, je l'ai mais il se place en bas avec le rsi, comment le placer au dessus sur...
YvesRobert Hi smp, how should I configure this indicator because everything is at zero -> High, Clos...
smp Hi, this is an end of day pivots indicator, so you need to find the end of day pivot info; t...
YvesRobert Thank you smp.
smp I also have an End Of Day (EOD) cash pivot indicator for use on cash markets; this indicator...
cdc.andersson Hej! Jag försöker lära mig att koda PRT. Jag vill testa en strategi med RSI-värde, ATR-värde...
Swingforfortune Du kan väl jämföra om open > close (röd) eller open < close (grön)
IV Mcm I don't speak English and the translation is not clear. Do you have a different turn of ...
IV Mcm stonk ?
avatar
Anonymous Thanks very much for sharing, look forward to testing this idea out.
Noobywan (My apologies for unformatted code, the formatting only works in forum or library posts not ...
Noobywan Hi FXTT, no problem for requests (as long as no one requests me singing), just usually it’s ...
JC_Bywan Bug fix at line 38, should be: if changebarre or (opentime[1]=start) then (same as in ...
Nicolas Oui le code est correct et il fonctionne, j'ai de bons résultats sur la liste NASDAQ par exe...
pincherman Bonjour :-) J'ai coller le script dans prorealtime pour jouer avec le supertrend et j'ai un...
Nicolas Vous l'avez sans doute collé au mauvais endroit, dans l'éditeur de code pour les stratégies,...
Bard Very interesting approach Vonasi! I'm getting a 404 error when trying to download though?
Vonasi I just tested and I was able to download with no error.
Psari Hi Vonasi, I am a newbie and was wondering whether you could possibly help me with this pro...
Juanjo Hola?. Exactamente cuál es su utilización?.
bolsatrilera Hola Juanjo, su principio esparecido a las bandas de Bollinguer.Las lineas de las bandas son...
Vonasi The indicator code can easily be adapted for use as a filter in strategies as well. For exam...
AVT Tested today in manual DAX trading (transcripted to MT and changed look into aka oszillator)...
Vonasi I think that short time frame charts will be too noisy for this indicator. One blue bar real...
Vonasi I forgot to mention in the description that Sunday pivot lines are ignored and Monday's pivo...
AVT Like that, simple and clear!
Vonasi Thanks AVT. I like simple - some people would say that I do simple very well! Sometimes you ...
Nicolas Please open a new forum topic, and respect the posting rules. Add a precise description of w...
FXTT ok will do, apologies, as I said I am new here. many thanks
Noobywan Version v2 including requested additions: https://www.prorealcode.com/prorealtime-indicators...
Trading_En_El_Ibex35 Para calcular el punto pivote y los niveles de soporte y resistencia para operar durante la ...
supertiti Hola mis disculpas, creia que tu eres Jose Antonio Madrigal ! gracias por las explicaci...
Trading_En_El_Ibex35 espero que las explicaciones te hayan sido de ayuda saludos

Top