Réglage d’une alerte sur indicateur

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #246032 quote
    Prestige-trade
    Participant
    New

    Bonjour a tous,

    J’aimerai mettre une alerte sonore au moment ou cette indicateur me donne le signal (achat ou vente)

    J’ai essayé différentes façon sans parvenir au résultat peut -être faudrait t-il modifier la dernière ligne de code et renvoyer une autre information?

    ou est il possible de directement intégrer un son dans l’indicateur?

    Merci par avance

     

     

     

    //06.05.2021
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //converted from MQL5
    
    // --- settings
    //RISK=3
    //SSP=9
    //AtrRatio=0.375
    // --- end of settings
    
    once K = 33-RISK
    once ATRPeriod=15
    
    if barindex>max(SSP,ATRPeriod) then
    //---
    //trend=oldtrend
    WPR = Williams[SSP](close)
    ATR = AverageTrueRange[ATRPeriod](close)
    if(WPR<-100+K) then
    trend=-1
    endif
    if(WPR>-K) then
    trend=1
    endif
    irange=AtrRatio*ATR
    //---
    if(trend[1]<0 and trend>0) then
    BuyBuffer=low-irange
    else
    Buybuffer = 0 //nst
    endif
    if(trend[1]>0 and trend<0) then
    SellBuffer=high+irange
    else
    SellBuffer = 0 //nst
    endif
    
    if(trend>0) then
    if(BuyBuffer) then
    UpBuffer1=BuyBuffer
    DnBuffer1=DnBuffer1[1]
    else
    istop=low-irange
    if(istop<UpBuffer1[1]) then
    istop=UpBuffer1[1]
    endif
    UpBuffer1=istop
    endif
    endif
    
    
    if(trend<0) then
    if(SellBuffer) then
    DnBuffer1=SellBuffer
    UpBuffer1=UpBuffer1[1]
    else
    istop=high+irange
    if(istop>DnBuffer1[1]) then
    istop=DnBuffer1[1]
    endif
    DnBuffer1=istop
    endif
    endif
    endif
    
    //---
    
    if (trend[1]>0 and trend>0) then
    r=50
    g=205
    b=50
    dn=0
    up=255
    elsif (trend[1]<0 and trend<0) then
    r=148
    g=0
    b=211
    dn=255
    up=0
    endif
    
    if buybuffer then
    drawtext("✵",barindex,upbuffer1,dialog,bold,25) coloured(50,205,50)
    elsif sellbuffer then
    drawtext("✵",barindex,dnbuffer1,dialog,bold,25) coloured(148,0,211)
    endif
    
     
    
    return upbuffer1 coloured(r,g,b,up) style(line,2),dnbuffer1 coloured(r,g,b,dn) style(line,2),TREND
    
    #246056 quote
    Iván González
    Moderator
    Master

    Bonjour. Vous pourriez conserver uniquement la partie du code qui calcule la tendance et à partir de là créer une alerte (voir captures d'écran).

    // --- settings
    RISK=3
    SSP=9
    AtrRatio=0.375
    // --- end of settings
    once K = 33-RISK
    once ATRPeriod=15
    if barindex>max(SSP,ATRPeriod) then
    WPR = Williams[SSP](close)
    ATR = AverageTrueRange[ATRPeriod](close)
    if(WPR<-100+K) then
    trend=-1
    endif
    if(WPR>-K) then
    trend=1
    endif
    endif
    
    return TREND as "trend"
    robertogozzi thanked this post
    #246280 quote
    Prestige-trade
    Participant
    New

    parfait un grand merci!

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

Réglage d’une alerte sur indicateur


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Prestige-trade
9 months, 2 weeks ago.

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