conversion indicateur BUY VS SELL de TV

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #192080 quote
    maxlys
    Participant
    Senior

    Bonjour,

     

    je n’ai pas su trouve un équivalent en standard sur PRT ou développé sur le forum concernant un indicateur comparant la force des acheteurs contre celle des vendeurs, que l’on peut trouver sur TV, appelé Buy Vs Sell power X ( voir image jointe)

    pourriez vous m’indiquer un nom si existant en standard, un lien sur le forum si déjà développé ou sinon est il possible de faire le code correspondant ? Voici celui original sur TV

    //@version=3
    study("buy vs sell power x",overlay=false)
    source = close
    hilow = ((high - low)*100)
    openclose = ((close - open)*100)
    vol = (close / hilow)
    spreadv = (openclose * close)
    pt = spreadv + cum(spreadv)
    s = input(5) 
    m = input(9) 
    l = input(14)  
    a = ema(pt, l) - ema(pt, m)
    b = ema(pt, s) - ema(pt, m)
    p=a+b
    plot(b, color=blue,style=line, linewidth=3)
    plot(p,color=red,style=line, linewidth=3)
    //
    showZones   = input(true, title="Show Bullish/Bearish Zones")
    
    // bullish signal rule: 
    bullishRule =b>=p
    // bearish signal rule: 
    bearishRule =b<=p
    // current trading State
    ruleState = 0
    ruleState := bullishRule ? 1 : bearishRule ? -1 : nz(ruleState[1])
    bgcolor(showZones ? ( ruleState==1 ? blue : ruleState==-1 ? red : orange ) : na , title=" Bullish/Bearish Zones", transp=70)
    

    Merci beaucoup

    buy-vs-sell.jpg buy-vs-sell.jpg
    #192096 quote
    robertogozzi
    Moderator
    Master

    Voilà:

    // Buy vs Sell power X
    //
    // https://www.tradingview.com/script/XZ3UXRvL-buy-vs-sell-power-x/
    //
    ONCE pt     = 0
    ONCE s      = 5
    ONCE m      = 9
    ONCE l      = 14
    HiLow       = ((high - low) * 100)
    OpenClose   = ((close - open) * 100)
    VolX        = (close / HiLow)
    SpreadV     = (OpenClose * close)
    pt          = SpreadV + pt
    a           = Average[l,1](pt) - Average[m,1](pt)
    b           = Average[s,1](pt) - Average[m,1](pt)
    p           = a + b
    bullishRule = (b > p)   //original (b >= p)
    bearishRule = (b < p)   //original (b <= p)
    //ruleState = 0         //not used
    IF bullishRule THEN
       //ruleState= 1       //not used
       BackGroundColor(0,0,255,70)     //BLUE background (70 can be changed to any value between 0 and 255, 0=invisible, 255=plain)
    ELSIF bearishRule THEN
       //ruleState= -1      //not used
       BackGroundColor(255,0,0,70)     //RED  background (70 can be changed to any value between 0 and 255, 0=invisible, 255=plain)
    ENDIF
    RETURN a AS "a",p AS "p"
    Buy-vs-Sell-power-X.itf
    #192128 quote
    maxlys
    Participant
    Senior

    Merci pour ce retour rapide. Top !

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

conversion indicateur BUY VS SELL de TV


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
maxlys @maxlys Participant
Summary

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

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 04/22/2022
Status: Active
Attachments: 2 files
Logo Logo
Loading...