SAR de Wilder programmé

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #138088 quote
    ATS_Eric
    Participant
    New

    Bonjour tout le monde 🙂

    Je viens vers vous car j’ai un problème avec mon SAR de Wilder programmé. Je ne comprends pas pourquoi j’ai 2 points verts dans les points rouges, le 22 juin et le 24 juin !?… Je vous insère le code ci-dessous, si vous avez une idée de ce qui cloche je suis preneur. Merci par avance.

    // Indicateur SAR de Wilder AT.S. v11
    // Mis à jour part J.M.
    
    once facteur=0.02
    once increment=0.02
    once maxfacteur=0.2
    extreme1=extreme[1]
    tendance1=tendance[1]
    tmpsar1=tmpSAR[1]
    high1=high[1]
    low1=low[1]
    
    if tendance1 = 1 then
    extreme = max(extreme1, high)
    if tmpsar1 > low then
    tendance = -1
    facteur = 0.02
    tmpSAR = extreme
    extreme = low
    else
    if extreme > extreme1 and facteur <maxfacteur then
    facteur = min( maxfacteur, facteur + increment)
    endif
    tmpSAR =tmpsar1+facteur*(extreme-tmpsar1)
    tmpSAR = min(tmpSAR,min(low,low1))
    endif
    elsif tendance1 = -1 then
    extreme = min(extreme1, low )
    if tmpsar1 <high then
    tendance = 1
    facteur = 0.02
    tmpSAR = extreme
    extreme = high
    else
    if extreme < extreme1 and facteur <maxfacteur then
    facteur = min( maxfacteur, facteur + increment )
    endif
    tmpSAR = tmpsar1+facteur*(extreme-tmpsar1)
    tmpSAR = max(tmpSAR,max(high,high1))
    endif
    else
    facteur = 0.02
    tmpSAR = low
    extreme = high
    tendance = 1
    endif
    // couleur du SAR
    if tmpSAR>=tmpSAR[1] then
    col=1
    else
    col=-1
    endif
     
    return tmpSAR[1] coloured by col as "SAR"
    
    IMAGE.png IMAGE.png
    #138093 quote
    ATS_Eric
    Participant
    New

    Je vous insère ci-dessous la version précédente pour ProRealTime 10, qui fonctionnait bien. Cela pourrait vous éclairer.

    // Indicateur SAR de Wilder AT.S. v.10
    
    once facteur=0.02
    once increment=0.02
    once maxfacteur=0.2
    extreme1=extreme[1]
    tendance1=tendance[1]
    tmpsar1=tmpSAR[1]
    high1=high[1]
    low1=low[1]
    
    if tendance1 = 1 then
    extreme = max(extreme1, high)
    if tmpsar1 > low then
    tendance = -1
    facteur = 0.02
    tmpSAR = extreme
    extreme = low
    else
    if extreme > extreme1 and facteur <maxfacteur then
    facteur = min( maxfacteur, facteur + increment)
    endif
    tmpSAR =tmpsar1+facteur*(extreme-tmpsar1)
    tmpSAR = min(tmpSAR,min(low,low1))
    endif
    elsif tendance1 = -1 then
    extreme = min(extreme1, low )
    if tmpsar1 <high then
    tendance = 1
    facteur = 0.02
    tmpSAR = extreme
    extreme = high
    else
    if extreme < extreme1 and facteur <maxfacteur then
    facteur = min( maxfacteur, facteur + increment )
    endif
    tmpSAR = tmpsar1+facteur*(extreme-tmpsar1)
    tmpSAR = max(tmpSAR,max(high,high1))
    endif
    else
    facteur = 0.02
    tmpSAR = low
    extreme = high
    tendance = 1
    endif
    return tmpsar1 coloured by tendance[1]
    #139273 quote
    Nicolas
    Keymaster
    Legend

    Ces points rouges sont en vert car la variable “col” est égale à 1 sur ces chandeliers. Tu demandes la couleur verte quand le SAR est identique à sa valeur précédente et c’est bien le cas sur ces bougies.

    #139448 quote
    ATS_Eric
    Participant
    New

    Ces points rouges sont en vert car la variable “col” est égale à 1 sur ces chandeliers. Tu demandes la couleur verte quand le SAR est identique à sa valeur précédente et c’est bien le cas sur ces bougies.

    Merci pour la réponse ! La solution m’a été donnée par ailleurs sur Twitter. Il fallait faire :

    If tendance[1]= 1 then
    Col=1
    Else
    col=-1
    Endif

    Au lieu de :

    if tmpSAR>=tmpSAR[1] then
    col=1
    else
    col=-1
    endif
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

SAR de Wilder programmé


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
ATS_Eric @ats_eric Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by ATS_Eric
6 years, 1 month ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 07/02/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...