DIVERGENCE ON BALANCE VOLUME

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #69408 quote
    Meta Signals Pro
    Participant
    Veteran

    Bonjour à tous,

    Quelqu’un aurait-il codé une amélioration de l’OBV en y intégrant un indicateur interne de divergence avec l’évolution des prix comme il en existe pour le MACD et le RSI ?

    Merci de votre aide,

    Bonne journée à tous !

    #76817 quote
    Meta Signals Pro
    Participant
    Veteran

    Sur la base d’un travail réalisé par Gabriel @gabri (https://www.prorealcode.com/prorealtime-indicators/rsi-divergences-finder)

    voici une petite contribution sur l’OBV ; j’y ai rajouté un signal sous forme d’histogramme pour mieux visualiser  ;

    NB : l’OBV n’est pas un indicateur à utiliser seul par expérience mais il contribue à affirmer un potentiel retournement ;

    [attachment file=76818]

     

    //Variables
    a=obv(close)
    once RefCloseDownOld=0
    once RefRSIDownOld=0
    once RefCloseUpOld=0
    once RefRSIUpOld=0
    once BarBullOld=0
    once BarBearOld=0
    //Conditions to identify max and min
    c1=a[4]>a[2] and a[3]>a[2] and a[1]>a[2] and a>a[2]
    c2=a[4]<a[2] and a[3]<a[2] and a[1]<a[2] and a<a[2]
    //finding the double bottom
    if c1 then
    RefCloseDownNew=close[2]
    RefRSIDownNew=a[2]
    BarBullNew=barindex[2]
    endif
    if RefCloseDownNew<RefCloseDownOld and RefRSIDownNew>RefRSIDownOld then
    //double slash next line if you don't needed the mark on a different window
    bulldiv=a*0.95
    //entry price for long on price window // double slash next line if not needed
    //DRAWSEGMENT(BarBullNew, highest[(BarBullnew-BarBullOld)](close), BarBullNew+10, highest[(BarBullnew-BarBullOld)](close))
    //entry price for long on RSI window // double slash next line if not needed
    if RefRSIDownOld >0 then
    DRAWSEGMENT(BarBullOld, RefRSIDownOld *0.99, BarBullNew, RefRSIDownNew *0.99)coloured(255,0,0)
    else
    DRAWSEGMENT(BarBullOld, RefRSIDownOld *1.01, BarBullNew, RefRSIDownNew *1.01)coloured(255,0,0)
    endif
    
    else
    bulldiv=0
    endif
    //Finding the double top
    if c2 then
    RefCloseUpNew=close[2]
    RefRSIUpNew=a[2]
    BarBearNew=barindex[2]
    endif
    if RefCloseUpNew>RefCloseUpOld and RefRSIUPNew<RefRSIUpOld then
    //double slash next line if you don't needed the mark on a different window
    beardiv=a*0.95
    //entry price for short on price window // double slash next line if not needed
    //DRAWSEGMENT(BarBearOld, RefCloseUpOld *1.01, BarBearNew, RefCloseUpNew *1.01)coloured(255,0,0)
    //entry price for short on RSI window // double slash next line if not needed
    if RefRSIUpOld >0 then
    DRAWSEGMENT(BarBearOld, RefRSIUpOld *1.01, BarBearNew, RefRSIUpNew *1.01)coloured(255,0,0)
    else
    DRAWSEGMENT(BarBearOld, RefRSIUpOld *0.99, BarBearNew, RefRSIUpNew *0.99)coloured(255,0,0)
    endif
    else
    beardiv=0
    endif
    //grafica
    RefCloseDownOld=RefCloseDownNew
    RefRSIDownOld=RefRSIDownNew
    RefCloseUpOld=RefCloseUpNew
    RefRSIUpOld=RefRSIUpNew
    BarBullOld=BarBullNew
    BarBearOld=BarBearNew
    
    return bulldiv coloured (0,255,0) style(histogram,1) , beardiv coloured (255,0,0)style(histogram,1)
    swapping, Alai-n and bolsatrilera thanked this post
    Image1.png Image1.png
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

DIVERGENCE ON BALANCE VOLUME


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
Summary

This topic contains 1 reply,
has 1 voice, and was last updated by Meta Signals Pro
7 years, 7 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 04/30/2018
Status: Active
Attachments: 1 files
Logo Logo
Loading...