gabri

Bear and Bull volume indicator

Category: Indicators By: gabri Created: February 5, 2018, 7:59 AM
February 5, 2018, 7:59 AM
Indicators
57 Comments
Bear and Bull volume indicator

This code is mainly for Wyckoffians and can be used in accumulation/distribution phases to spot the change of forces.

The volume bars are showing who is stronger in the period defined in the timeframe (more green means that bulls are running the show, in this case, in the weekly period).

The moving averages are showing the same information but based on an historical point of view (when the bull line crosses over the bear line bulls are becoming stronger in the longer period).

I suggest to use a period of 22 or more and always based on the timeframe in use.

Blue skies!!

ref=(close-low)/range
volbull=ref*volume
volbear=volume

if close>=open then
 greenbarcount=1
 greenvolume=volume
 redbarcount=0
 redvolume=0
else
 greenbarcount=0
 greenvolume=0
 redbarcount=1
 redvolume=volume
endif
//media volumi rossi e verdi per media mobile semplice
mmred=summation[period](redvolume)/summation[period](redbarcount)
mmgreen=summation[period](greenvolume)/summation[period](greenbarcount)

return volbear coloured (205,0,0) style (histogram), volbull coloured (0,190,0) style (histogram), mmred coloured (255,0,0) as "Bear average",mmgreen as "Bull average"

 

Download
Filename: bear-bull-volume.itf
Downloads: 1092
gabri
gabri Master
Code artist, my biography is a blank page waiting to be scripted. Imagine a bio so awesome it hasn't been coded yet.
Author’s Profile

Comments

SkrHugo
3 years ago
#

Bonjour, J'essaye d'utiliser le script avec le graphique renko mais sa ne marche pas, quelqu'un pourrait m'aider. Merci Hugo

marcov66
6 years ago
#

Perfetto! Funziona. Grazie di tutto!

gabri
6 years ago
#

Ha ragione in computer, ho sbagliato io BullAD = summation[period](ADvolbull*((Close-Low) – (High-Close)) / (High-Low)) BearAD = summation[period](ADvolbear*((Close-Low) – (High-Close)) / (High-Low))

marcov66
6 years ago
#

non riconosce su riga 6 e 7 summation. Ho aggiunto anche su ultima riga ,BullAD as “AD volume Bull”, BearAD as “AD volume Bear”

gabri
6 years ago
#

ref=(close-low)/range volbull=ref*volume volbear=volume ADvolbull = volbull ADvolbear = volume – ADvolbull BullAD = summation[ADvolbull*((Close-Low) – (High-Close)) / (High-Low)] BearAD = summation[ADvolbear*((Close-Low) – (High-Close)) / (High-Low)] if close>=open then greenbarcount=1 greenvolume=volume redbarcount=0 redvolume=0 else greenbarcount=0 greenvolume=0 redbarcount=1 redvolume=volume endif //media volumi rossi e verdi per media mobile semplice mmred=summation[period](redvolume)/summation[period](redbarcount) mmgreen=summation[period](greenvolume)/summation[period](greenbarcount) return volbear coloured (205,0,0) style (histogram), volbull coloured (0,190,0) style (histogram), mmred coloured (255,0,0) as “Bear average”,mmgreen as “Bull average”

marcov66
6 years ago
#

Ciao, mi da il seguente errore: "la seguente variabile non è definita: sum"

gabri
6 years ago
#

ref=(close-low)/range volbull=ref*volume volbear=volume ADvolbull = volbull ADvolbear = volume – ADvolbull BullAD = sum[ADvolbull*((Close-Low) – (High-Close)) / (High-Low)] BearAD = sum[ADvolbear*((Close-Low) – (High-Close)) / (High-Low)] if close>=open then greenbarcount=1 greenvolume=volume redbarcount=0 redvolume=0 else greenbarcount=0 greenvolume=0 redbarcount=1 redvolume=volume endif //media volumi rossi e verdi per media mobile semplice mmred=summation[period](redvolume)/summation[period](redbarcount) mmgreen=summation[period](greenvolume)/summation[period](greenbarcount) return volbear coloured (205,0,0) style (histogram), volbull coloured (0,190,0) style (histogram), mmred coloured (255,0,0) as “Bear average”,mmgreen as “Bull average”,BullAD as “AD volume Bull”, BearAD as “AD volume Bear”

gabri
6 years ago
#

ho capito..... hai aggiunto due istruzioni return. Avevo detto qualcosa di differente io alla fine dell’istruzione return aggiungi una virgola e poi il seguente testo: BullAD as “AD volume Bull”, BearAD as “AD volume Bear”

gabri
6 years ago
#

che errore da?

marcov66
6 years ago
#

Ho provato in questo modo ma da errore: ref=(close-low)/range volbull=ref*volume volbear=volume ADvolbull = volbull ADvolbear = volume - ADvolbull BullAD = sum[ADvolbull*((Close-Low) - (High-Close)) / (High-Low)] BearAD = sum[ADvolbear*((Close-Low) - (High-Close)) / (High-Low)] Return BullAD as "AD volume Bull", BearAD as "AD volume Bear" if close>=open then greenbarcount=1 greenvolume=volume redbarcount=0 redvolume=0 else greenbarcount=0 greenvolume=0 redbarcount=1 redvolume=volume endif //media volumi rossi e verdi per media mobile semplice mmred=summation[period](redvolume)/summation[period](redbarcount) mmgreen=summation[period](greenvolume)/summation[period](greenbarcount) return volbear coloured (205,0,0) style (histogram), volbull coloured (0,190,0) style (histogram), mmred coloured (255,0,0) as "Bear average",mmgreen as "Bull average"

marcov66
6 years ago
#

Ciao Gabry, provo a spiegarmi meglio in italiano. Innanzitutto complimenti per l´indicatore. Trovo che la suddivisione che hai fatto tra i volumi in buy e i volumi in sell sia la parte + geniale. Abbinato ai volumi Buy/sell utilizzo l´indicatore Accumulation-Distribution (indicatore di default). L´indicatore classico AD tuttavia, nel calcolo considera i volumi totali per ogni barra senza scindere quelli in buy o in sell. Io ho fatto una simulazione in Excel (non so come condividertela) dove oltre all´AD classico ci sono AD buy e Ad sell. Io non sono un programmatore, ma vedo che tu sei molto bravo. Saresti in grado eventualmente di programmare questo nuovo indicatore con 3 linee AD/AD buy/AD sell? Grazie per il supporto. Un saluto Marco

gabri
6 years ago
#

Ciao, ora ho capito. Devi aggiungere le seguenti righe: riga 4: ADvolbull = volbull ADvolbear = volume - ADvolbull riga 5: BullAD = sum[ADvolbull*((Close-Low) - (High-Close)) / (High-Low)] BearAD = sum[ADvolbear*((Close-Low) - (High-Close)) / (High-Low)] alla fine dell'istruzione return aggiungi una virgola e poi il seguente testo: BullAD as "AD volume Bull", BearAD as "AD volume Bear" la visualizzazione potrebbe diventare un problema a causa delle scale, disattiva magari quali linee non vedere dalla finestra principale

gabri
6 years ago
#

Si, dovrebbe essere un accumulation/distribution indicator in grado di dirti quando il mercato diventa bull o bear

marcov66
6 years ago
#

What I mean is not a bear/bull Average as integrated in the indicator but a new Accumulation-Distribution Indicator able to splitted the buy volume and the sell volume. It means AD buy line + AD sell line. Ho fatto una simulazione in Excel con 3 linee (AD/ADbuy/ADsell). Thanks M

marcov66
6 years ago
#

Very useful indicator! Great! just a question. According to you is it possible to create a double Accumulation-Distribution indicator, with two lines? one for buy volume and one for sell volume. Thanks for your feedback. M

gabri
6 years ago
#

Hi, this would be the idea behind.

427trading
6 years ago
#

when pasted into the indicator area it says THE FOLLOWING VARIABLE IS UNDEFINED:PERIOD any idea why? ref=(close-low)/range volbull=ref*volume volbear=volume if close>=open then greenbarcount=1 greenvolume=volume redbarcount=0 redvolume=0 else greenbarcount=0 greenvolume=0 redbarcount=1 redvolume=volume endif //media volumi rossi e verdi per media mobile semplice mmred=summation[period](redvolume)/summation[period](redbarcount) mmgreen=summation[period](greenvolume)/summation[period](greenbarcount) return volbear coloured (205,0,0) style (histogram), volbull coloured (0,190,0) style (histogram), mmred coloured (255,0,0) as "Bear average",mmgreen as "Bull average"

Nicolas
6 years ago
#

yes, because it is not defined in the code. I would recommend to download the itf file and import it into your platform to get all the extern variables.

427trading
6 years ago
#

hello, im getting an error when i paste in the code... return volbear coloured (205,0,0) style (histogram), volbull coloured (0,190,0) style (histogram), mmred coloured (255,0,0) as "Bear average",mmgreen as "Bull average" this is the issue, please can you adise me on this many thanks

Nicolas
6 years ago
#

This code should work for all prorealtime trading platform v10.3 onwards.

inder1211
8 years ago
#

bro volume indicator works on mt 4 ?

Nicolas
8 years ago
#

This indicator is for ProRealTime (PRT), you can ask for private job on this page: https://www.prorealcode.com/trading-programming-services/

gabri
8 years ago
#

Segie, I can add text on the graph of THIS indicator. To add text ALSO on the price graph you need to do another code and everytime you change the settings on the bear bull volume indicator you need to change the settings also on the second one....you might end up having not the same info and this is not good in my opinion.

segie
8 years ago
#

Hi Guys, Will it be possible to add "Texts" to this code. When the bull line crosses over the bear line I would like to insert a “BULL” text on the: 1.Corresponding volume bar or histogram on this indicator 2.On the corresponding Price candle. I would like the “Bull” text to appear just above the candle stick. 3.Vice versa for when the bear line crosses the bull line. Regards, Segie

gabri
8 years ago
#

Kris, I will answer on the forum at the following address https://www.prorealcode.com/topic/strategie-sur-bull-bear-volumes/#post-66030. Give me a few days since I am in the process of moving.

gabri
9 years ago
#

Cambia la riga cosi': return volbear coloured (205,0,0) , volbull coloured (0,190,0) , mmred coloured (255,0,0) as "Bear average",mmgreen as "Bull average" non verra' visualizzato un istogramma ma una linea normale

Kris75
8 years ago
#

Hi Gabri, I am trying to set a simple strategy based on your very cool indicator Here are the conditions: BUY = ENTRY : if the bull-volume-green-bar CROSSES (i.e is superior) the simple moving average of the past 23 bull-volumes if the bull-volume-green-bar CROSSES (i.e is superior) the simple moving average of the past 23 bear-volumes SELL = EXIT: if the bear-volume-green-bar CROSSES the simple moving average of the past 23 bull-volumes if the bear-volume-green-bar CROSSES the simple moving average of the past 23 bear-volumes I tried to use the automatic coding system but it does not work; I tried also to code it myself using moving average but it is not working either. Can you help me on this? Thanks ! Chris

poldoposta
9 years ago
#

LINEA 20 CARATTERE 35 ..... link sopra con screenshot. Grazie mille

poldoposta
9 years ago
#

https://ibb.co/hpjcuc

poldoposta
9 years ago
#

scusami non appena sono a casa ti posto la riga 12 (ma non è altro che quella del file itf. Rigrazie

ProRealCode ProRealCode
Loading...