OBV oscillator

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #174690 quote
    rnesler
    Participant
    Average

    I don’t think that the (rather helpful) OBV oscillator has been included yet in the PRT library.

    Anyone happy to translate the tradingview code? It is freely available but please give credit to its creator. See below:

    // @author LazyBear
    //
    // Appreciate a note if you use this code anywhere.

    study(title=”On Balance Volume Oscillator [LazyBear]”, shorttitle=”OBVOSC_LB”)
    src = close
    length=input(20)
    obv(src) => cum(change(src) > 0 ? volume : change(src) < 0 ? -volume : 0*volume)
    os=obv(src)
    obv_osc = (os – ema(os,length))
    obc_color=obv_osc > 0 ? green : red
    plot(obv_osc, color=obc_color, style=line,title=”OBV-Points”, linewidth=2)
    plot(obv_osc, color=silver, transp=70, title=”OBV”, style=area)
    hline(0)

    #174694 quote
    robertogozzi
    Moderator
    Master

    Just search the forum for OBV and you will get it.

    Use the search box that opens when your mouse hovers your avatar on the upper right corner of the blue toolbar.

    #174789 quote
    rnesler
    Participant
    Average

    Thank you for the quick response Robert. Unfortunately the search as described above does not provide me with the “OBV cycle indicator” or similar, as coded above (just screeners, divergences, PPO on OBV etc.) The standard OBV in PRT is not helpful either, as it does not allow for down-adjustment of the (20) standard period unfortunately. Above indicator allows adjustment of a short and long OBV period. (See tradingview settings of the indicator above).

    Any way above can be transcribed?

    #174797 quote
    robertogozzi
    Moderator
    Master

    Probably it can be converted, but I can’t.

    Nicolas knows several languages and takes care of that, he will tell you asap.

    #177567 quote
    robertogozzi
    Moderator
    Master
    #204003 quote
    Regisnew
    Participant
    Junior

    Bonjour à vous à partir de l’indicateur

    1. On-Balance-Volume-Oscillator2.itf

    je souhaite intégrer à un screener la condition “Différence est supérieure à Ma3” or le screener ne me retourne aucune valeur.

    myDifference, myma3 = CALL “On Balance Volume Oscillator2″[20, 14]
    c1 = (myDifference > myma3)
    SCREENER[c1] (Variation AS “% Barre prec”)

    Avez vous une idée?

    Bien cordialement

    Régis

    hello to you from flag

    1. On-Balance-Volume-Oscillator2.itf

    I want to integrate the condition “Difference is greater than Ma3” into a screener, but the screener does not return any value to me.

    myDifference, myma3 = CALL “On Balance Volume Oscillator2″[20, 14]

    c1 = (myDifference > myma3)

    SCREENER[c1] (Variation AS “% Bar prev”)

    Any idea? Sincerely Regis

    #204005 quote
    robertogozzi
    Moderator
    Master

    @Regisnew

    Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.

    Thank you 🙂

    #204006 quote
    robertogozzi
    Moderator
    Master

    It’s better to embed custom indicators into your screener, rather than CALLing it:

    Periods  = 20
    Periods2 = 14
    MyOBV       = OBV(close)
    ma1         = 0
    IF BarIndex > max(Periods,Periods2) THEN
       Sma           = Average[Periods,0](MyOBV)
       Diff       = MyOBV - Sma
       ONCE wmaPERC = 1 / Periods2
       //ONCE maP = max(1,round(exp(0.5*log(Periods2))))
       ma1   = (Diff * wmaPERC) + (ma1[1] * (1 - wmaPERC))     //Wilder Average 1
       //ma2 = average[maP,0](ma1)
       ma3 = ma1 * exp(0.15*log(Periods2))
    ENDIF
    //myDifference, myma3 = CALL "On Balance Volume Oscillator2"[20, 14]
    //c1 =  (myDifference > myma3)
    c1 =  Diff > ma3
    SCREENER[c1] (Variation AS "% Bar prev")
    #204034 quote
    Regisnew
    Participant
    Junior

    merci beaucoup, c’est parfait
    thank you very much, it’s perfect

    #204041 quote
    robertogozzi
    Moderator
    Master

    @Regisnew

    Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.

    Thank you 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.

OBV oscillator


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
rnesler @rnesler Participant
Summary

This topic contains 9 replies,
has 3 voices, and was last updated by robertogozzi
3 years, 2 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 08/04/2021
Status: Active
Attachments: No files
Logo Logo
Loading...