signaux James Bond décalés d’une bougie

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #262076 quote
    Géraud Laveissiere
    Participant
    Average

    Nicolas,

    Sur ce script , les signaux de la condition 2 sont décalés d’une bougie vers la gauche. est il possible de les recaler? Merci d’avance.


    // Paramètres du SAR

    SARStep = 0.07

    SARMax = 0.7



    // Calcul du SAR

    SARValue = SAR[SARStep, SARStep, SARMax]



    // SAR vert (sous le prix) = haussier, SAR rouge (au-dessus) = baissier

    isBullishSAR = close > SARValue

    isBearishSAR = close < SARValue



    // Détection du premier changement de SAR (flip)

    SARFlipToBull = isBullishSAR AND NOT isBullishSAR[1]

    SARFlipToBear = isBearishSAR AND NOT isBearishSAR[1]



    // Condition 1 : SAR vert + bougie verte => trait rouge sur le plus bas (signal SELL)

    if isBullishSAR AND close > open then

    DRAWSEGMENT(barindex-1 , low[1], barindex + 2, low[1]) COLOURED(255, 0, 0) STYLE(line, 1)

    endif



    // Condition 2 : SAR rouge + bougie rouge => trait vert sur le plus haut (signal BUY)

    if isBearishSAR AND close < open then

    DRAWSEGMENT(barindex-1 , high[1], barindex + 2, high[1]) COLOURED(0, 255, 0) STYLE(line, 1)

    endif



    // Condition 3a : Flip SAR -> haussier + bougie verte => trait vert épais sur le plus haut (BUY)

    if SARFlipToBull AND close > open then

    DRAWSEGMENT(barindex-1 , high[1], barindex + 2, high[1]) COLOURED(0, 200, 0) STYLE(line, 2)

    endif



    // Condition 3b : Flip SAR -> baissier + bougie rouge => trait rouge épais sur le plus bas (SELL)

    if SARFlipToBear AND close < open then

    DRAWSEGMENT(barindex-1 , low[1], barindex + 2, low[1]) COLOURED(200, 0, 0) STYLE(line, 2)

    endif



    RETURN


    #262077 quote
    robertogozzi
    Moderator
    Master

    Les signaux partent tous de la même bougie (l’avant-dernière), ils devraient donc tous être désalignés.

    Cependant, cette version réaligne, uniquement pour la condition 2, sur la dernière bougie :

    // Paramètres du SAR
    SARStep = 0.07
    SARMax = 0.7
    // Calcul du SAR
    SARValue = SAR[SARStep, SARStep, SARMax]
    // SAR vert (sous le prix) = haussier, SAR rouge (au-dessus) = baissier
    isBullishSAR = close > SARValue
    isBearishSAR = close < SARValue
    // Détection du premier changement de SAR (flip)
    SARFlipToBull = isBullishSAR AND NOT isBullishSAR[1]
    SARFlipToBear = isBearishSAR AND NOT isBearishSAR[1]
    // Condition 1 : SAR vert + bougie verte => trait rouge sur le plus bas (signal SELL)
    if isBullishSAR AND close > open then
    DRAWSEGMENT(barindex-1 , low[1], barindex + 2, low[1]) COLOURED(255, 0, 0) STYLE(line, 1)
    endif
    // Condition 2 : SAR rouge + bougie rouge => trait vert sur le plus haut (signal BUY)
    if isBearishSAR AND close < open then
    DRAWSEGMENT(barindex , high, barindex + 2, high) COLOURED(0, 255, 0) STYLE(line, 4)
    endif
    // Condition 3a : Flip SAR -> haussier + bougie verte => trait vert épais sur le plus haut (BUY)
    if SARFlipToBull AND close > open then
    DRAWSEGMENT(barindex-1 , high[1], barindex + 2, high[1]) COLOURED(0, 200, 0) STYLE(line, 2)
    endif
    // Condition 3b : Flip SAR -> baissier + bougie rouge => trait rouge épais sur le plus bas (SELL)
    if SARFlipToBear AND close < open then
    DRAWSEGMENT(barindex-1 , low[1], barindex + 2, low[1]) COLOURED(200, 0, 0) STYLE(line, 2)
    endif
    RETURN
    
    Iván González thanked this post
    #262095 quote
    Géraud Laveissiere
    Participant
    Average

    ok merci

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

signaux James Bond décalés d’une bougie


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Géraud Laveissiere
10 hours, 43 minutes ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 06/18/2026
Status: Active
Attachments: No files
Logo Logo
Loading...