Bull & Bear Volume-by-Price levels

Bull & Bear Volume-by-Price levels

This “Volume-by-Price” indicator shows the amount of volume for a particular price range selected with the “lookback” setting, which is based on closing prices. The bars are horizontal and shown on the left side of the chart to correspond with these price ranges. The bars are separated into 2 colors to clearly identify the bull and bear Volumes in each price range. By combining volume and closing prices, this indicator can be used to identify high-volume price ranges to mark support or resistance.

The code shows 12 Volume-by-Price bars by default, but users can increase or decrease this number to suit their preferences with the “NbrBars” setting. Be aware that due to some ProBuilder limitations, this setting, as well as the lookback one, cannot be extended very much.

For a better visualization of which side has higher volumes on each price range, I added a small square of the corresponding color.

The ScaleFactor setting is used to adapt the length of the bars, depending of your choice to have small or big bars plotted over the price chart.


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?

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

  1. juanj • 195 days ago #

    Love It!

  2. Marcel • 195 days ago #

    Great job, just what I needed.

  3. juanj • 195 days ago #

    The only problem is that it takes forever to load, even after changing calculateonlastbars=200

    • Nicolas • 195 days ago #

      You’ll need at least 201 bars for a 200 bars lookback. About loading time, I can’t help more sorry …

  4. Marcel • 194 days ago #

    Loading time is surmountable if you trade om the daily timeframe.

  5. ALE • 194 days ago #


  6. James Bonnd • 190 days ago #

    do u have indicator for binary???

  7. Eloi • 187 days ago #

    Bonjour Nicolas, Merci ! Excellent code. Les zones sont à égales distances les unes des autres. Y aurait pas moyen d’affiner ?

    • Nicolas • 187 days ago #

      Désolé je n’ai pas compris la question.

  8. Eloi • 187 days ago #

    Excuse-moi, je n’étais peut être pas clair. Sur certaines zones, le prix passe à de très nombreuses reprises sur d’autres beaucoup moins. J’aimerai pouvoir différencier cela. Est-ce possible ?

    • Nicolas • 187 days ago #

      Je ne comprends pas de quelles zones on parle ? Le graphique représenté ici est simplement une somme des volumes sur les x dernières périodes et divisé en 12 parts égales.

  9. Eloi • 187 days ago #

    Ok je comprend mieux. Merci Nicolas

  10. macbartin • 179 days ago #

    Bonjour, si je souhaite utiliser l’indicateur “Market profile” : “Bull & Bear Volume-by-Price levels” et que je travaille sur une unité de temps 30Min! Alors je voudrais l’avoir en debut de journée. par exemple : ouverture DAX30 8:00 la ligné de départ comme a partir de 8:00.
    Il faut donc calculer comme cela : 22:00 (heure fermeture DAX30) – 8:00 (ouverture DAX30) = 14h00 de temps donc pour des bougies de 30Min il faut 14*2=28 (28 correspond au nombre de périodes à renseigner ?) pour pouvoir commencer au debut de la journée ?

  11. peppe novellino • 128 days ago #

    Hi Nicholas…the system shows me two errors. The first one is this: PRC_Bull&Bear Volume on Price (5 12 200); the second one is on the line 6, character 10 (defparam drawonlastbaronly=true). I took a picture of it but I dont’k how to attach it here.
    Thanks in advance

    • Nicolas • 128 days ago #

      Indicator is compatible from version 10.3
      To avoid code problems with bad copy paste, you should download the. .itf file and import it into your platform.

  12. peppe novellino • 127 days ago #

    Thanks Nicholas: I did it. I mean that I’ve imported the itf file that you’ve charged above, but it isn’t still working. I can’t understand what’s the problem

  13. peppe novellino • 117 days ago #

    Hallo Nicholas…I’ve been waiting for your aswer: maybe you can’t help me. All the best

    • Nicolas • 117 days ago #

      I think you have not a compatible version of PRT. What’s your broker?

  14. peppe novellino • 117 days ago #

    My broker is Binck bank, and I’m actually using version 10.2 (I think that Binck as a kind of use license for prorealtime)

    • peppe novellino • 117 days ago #

      Has a kind…sorry for the mistake

    • Nicolas • 117 days ago #

      Ok, so that confirm what I replied to you 7 days ago, your PRT version is too old and not compatible for graphics objects created by code.

  15. odin • 81 days ago #

    i nicoles i have posted a new forum topic with your indicator, to search for help.

  16. TAC Bolsa • 75 days ago #

    Hola Nicolas enhorabuena por el indicador podrías agregar una linea al indicador, indicado el Volumen Maximo.. en modo VPOC.

  17. TAC Bolsa • 68 days ago #

    Gracias Nicolas no te molestes.

    Ya he realizado mi propio indicador con un Volumen profile y un marker profile para el intradia para Prorealtime.

  18. TAC Bolsa • 68 days ago #

    Como sabes todo mis indicadores están bloqueados pero te dejo el enlace por si te interesa probarlo y compartir ideas o mejoras…..


    Mucho de este indicador parte de tu idea inicial, solo se tenia que mejorar.

  19. TAC Bolsa • 67 days ago #

    He publicado una nueva version para todos los valores



  20. oracle • 61 days ago #

    Nicolas “podrías agregar una línea en el indicador, indicado el Volumen Máximo .. en modo VPOC”. como se pide por varios foreros y o no se puede hacer. ¿?.

    • Nicolas • 61 days ago #

      Se puede hacer, por favor haga una solicitud específica en el foro, gracias.

    • oracle • 61 days ago #

      Es esto lo que necesitas Nicolas


      Si no dime como lo solicito..

    • oracle • 56 days ago #

      Me puede indicar si esto es suficiente para realizar su colaboración.

  21. Kris75 • 7 days ago #

    Hi Nicolas,
    Just a quick question:
    > how come the “volume on price” indicator of PRT is so quick and this great one you developped so “slow”;
    I makes no sens to me!
    Thanks anyway for this;

  22. Kris75 • 6 days ago #

    😉 ok thanks

    What about creating a strategy based on this indicator using the same trick you used in “swing lines : https://www.prorealcode.com/topic/swing-lines-strategy/“, registering the different maximimums of volume level which are a definition of a support or resistance?

    • Nicolas • 6 days ago #

      no real trick, just storing each segment value into a variable.. 😉

  23. Kris75 • 6 days ago #

    BTW I tried to add a piece of code which makes the indicator automaticaly starts the “llokback” at the highest of the time frame but it did not work: here is what I tried (FYI the Add PRT code is down)

    but it givest me an error saying the highest only accept positive integer (I debugged it but could not make it work)

    for i=400 to barindex

    if high = StartVol then
    StartBar = barindex
    StartBar =0

    if StartBar > StartBar[1] then
    LastStartBar = StartBar

    div = (hh-ll)/NbrBars

    while i=lrange and close[j]open[j] then
    bullbar = round((volbull*LastStartBar)/volsum)*scalefactor
    bearbar = round((volbear*LastStartBar)/volsum)*scalefactor

    drawrectangle(LastStartBar,lrange,LastStartBar+bullbar,hrange) coloured(46,139,87,255)
    drawrectangle(LastStartBar,lrange,LastStartBar+bearbar,hrange) coloured(255,0,0,255)

    if bullbar>bearbar then
    drawtext(“■”,LastStartBar+bullbar,(lrange+hrange)/2,Dialog,Bold,22) coloured(46,139,87)
    drawtext(“■”,LastStartBar+bearbar,(lrange+hrange)/2,Dialog,Bold,22) coloured(255,0,0)


    • Nicolas • 6 days ago #

      Because your variable “LastStartBar” is sometimes equal to 0 or even negative, you should declare it in a way that it has a positive value in any case, like this:
      LastStartBar = max(1,startbar)

  24. Kris75 • 6 days ago #

    thanks for your help

Register or


avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar

+2 more likes

Related users ' posts
Nicolas ok, but 1. you are comparing different data (same broker or not?), same timezone? same custo...
fxforex93 Bonjour Nicolas. je vais vous parler en français. j'ai un simple abonnement prorealtime (je ...
Nicolas Si il n'y a pas de volumes, le TVI ne pourra pas se calculer, donc oui le "problème" vient b...
luxrun Thanks, bolsatrilera, for a very good and solid screener!
luxrun sorry... indicator!
Lily Rios Gracias por el indicador, tengo una pregunta necesito programar un screener de valores que e...
bolsatrilera EM MONEY FLOW INDEX + ALERTS //@version=3 // on platform Tradingview by DreamsDefined //a...
Carlos Garcia Enorme. Gracias!
Andraxx Buen indicador.... Gracias
Kris75 Hi TAC, Thanks a lot for this great piece of work; -) MUCHAS gracias ;-) did I read right,...
TAC Bolsa All indicators share some code of other TAC indicators that improve the functioning of this ...
ramonjp Hi Tac, Great job. Please, can you provide latest code version of this indicator without ...
TAC Bolsa Estas equivocado al 99,9%. La correlación entre las series de precios y volúmenes las des...
Domenec Si hablas de un indice regional como el Ibex es posible que sea asi yo nunca lo he operado y...
TAC Bolsa Regional de Mostoles, en una cosa tienes razón mejor dejarlo aquí...
Nicolas Thank you Xusto. Thank you a lot for your contribution :) Since your code is a Pathfinder'...
Xusto Hello, Fully Agree, I will update it with your advice. Btw Can would you like share you co...
Niklas johansson hägglund do you now if it's possible to use this strategy with this code in tradingview also?
TAC Bolsa
8 months ago
luxrun Thank you so much Tac BOLSA, I can not post the picture tonight I'll try tomorrow. I loaded ...
TAC Bolsa A new version of TAC Volume HPI DIV10.4 is available. that marks the divergence In the fo...
Raymundo Buenas tardes. Como puedo descargar algunos indicadores de esta pagina ?
claudio1964 Hello Nicolas great indicator, I use it on prorealtime, can I have a code version for Webank...
Nicolas I think that it could work if you remove "style(histogram)" from the last line of the code.
Bretty86 Great work Nicolas! Thank you!
Real Pro working now, sorry for the bother
David29 BONJOUR, Félicitations pour cet indicateur. Avez-vous une idée de comment créer une strat...
Nicolas Je pense que ça a déjà été codé quelque part sur le forum. Dans la négative merci d'ouvrir u...
Nicolas question posée et répondue 2 messages plus haut: Je le retrouve très rapidement dans notre...
Al Wikah Bonjour et merci beaucoup Nicolas J'avais identifié et testé le code en question Mais, le...
Nicolas Ce sujet en Français et plus complet devrait t'intéresser. A noter que l'historique de ProSc...
gabri Segie, I can add text on the graph of THIS indicator. To add text ALSO on the price graph yo...
inder1211 bro volume indicator works on mt 4 ?
Nicolas This indicator is for ProRealTime (PRT), you can ask for private job on this page: https://w...