screener de retracement prix haut MACD

Forums ProRealTime forum Français Support ProScreener screener de retracement prix haut MACD

Viewing 2 posts - 1 through 2 (of 2 total)
  • #249792

    if MACD[12,26,9](close) crosses over 0 then
    barcrossup=BarIndex
    nbarres1=barindex-barcrossdown
    $redbottom[0]=lowest[nbarres1](low[1])
    barbottom=barindex-barssince(low=$redbottom[0])
    DRAWSEGMENT(bartop, $greentop[0], barbottom, $redbottom[0]) COLOURED(“red”)
    ELSIF MACD[12,26,9](close) crosses under 0 then
    barcrossdown=BarIndex
    nbarres1=barindex-barcrossup
    $greentop[0]=highest[nbarres1](high[1])
    bartop=barindex-barssince(high=$greentop[0])
    DRAWSEGMENT(barbottom, $redbottom[0], bartop, $greentop[0]) COLOURED(“green”)
    ENDIF
    return

    Bonjour à la communauté PROREALCODE.

    J’aurais besoin de votre aide pour me “transformer” l’indicateur ci-joint en screener.

    Cet indicateur trace des segments verts et des segments rouges sur les prix en se basant sur les cycles MACD. Il relie le prix le plus bas d’un cycle baissier du MACD au prix le plus haut d’un cycle haussier du MACD et inversement.

    J’aimerai que ce screener me détecte les actions qui retracent  dans la zone 38,2% et 61.8 % uniquement par rapport au dernier segment vert établi.

    Merci par avance. (que ce soit possible ou pas)

    Bonne soirée à tous.

    (PS:J’essaie de respecter le protocole mais je ne suis pas certain de bien faire avec la touche “insert PRT CODE” qui semble mélanger mon message avec le code…)
    Milles excuses par avance

    #249798

    Hello essayez ceci:

    // MACD Parameters
    fast = 12
    slow = 26
    signal = 9
    macda = MACD[fast, slow, signal](close)

    // Initialize variables
    IF macda CROSSES OVER 0 THEN
    barcrossup = BarIndex
    nbarres1 = barindex – barcrossdown
    $redbottom[0] = lowest[nbarres1](low[1])
    //barbottom = barindex – barssince(low = $redbottom[0])
    ELSIF macda CROSSES UNDER 0 THEN
    barcrossdown = BarIndex
    nbarres1 = barindex – barcrossup
    $greentop[0] = highest[nbarres1](high[1])
    //bartop = barindex – barssince(high = $greentop[0])
    ENDIF

    // Calculate Fibonacci retracement levels for the last green segment
    segmentHeight = $greentop[0] – $redbottom[0]
    fib382 = $greentop[0] – (segmentHeight * 0.382) // 38.2% retracement
    fib618 = $greentop[0] – (segmentHeight * 0.618) // 61.8% retracement

    // Screener condition: price is within 38.2% and 61.8% retracement of the last green segment
    condition = (close >= fib618 AND close <= fib382 AND macda < 0)

    // Return the screener result
    SCREENER[condition]

Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login