Market Structure Brealkers Indicator

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #234425 quote
    finplus
    Participant
    Master
    //PRC_Market Structure Breakers
    //version = 0
    //15.03.24
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //---------------------Inputs------------------------------
    lenght = 20
    //----------------------------------------------------------//
    //----------------Bullish Breaker---------------------------//
    //----------------------------------------------------------//
    //-----Calculate pivots high------------------------------------------
    if high < high[lenght] and highest[lenght](high)<high[lenght] and high[lenght]>highest[lenght](high)[lenght+1] then
    $ph[lastset($ph)+1]=high[lenght]
    $phx[lastset($phx)+1]=barindex[lenght]
    phcross = 0
    endif
    //-----Test for bullish market structure--------------------
    if close > $ph[max(0,lastset($ph))] and not phcross then
    drawsegment($phx[max(0,lastset($phx))],$ph[max(0,lastset($ph))],barindex,$ph[max(0,lastset($ph))])style(line,2)coloured(8,153,129)
    //MS Label
    if os = -1 then
    drawtext("MSS",(barindex+$phx[max(0,lastset($phx))])/2,$ph[max(0,lastset($ph))]+0.25*tr)
    else
    drawtext("MSB",(barindex+$phx[max(0,lastset($phx))])/2,$ph[max(0,lastset($ph))]+0.25*tr)
    endif
    $lasty2[lastset($lasty2)+1] = $ph[max(0,lastset($ph))]
    $lastx2[lastset($lastx2)+1] = barindex
    breakdown = 0
    checkup = 0
    phcross = 1
    os = 1
    endif
    //------Iterate trough existing bullish structures and test for breaks
    if close < $lasty2[max(0,lastset($lasty2))] and open > $lasty2[max(0,lastset($lasty2))] and breakdown=0 then
    breakdown = 1
    checkup = 1
    drawsegment($lastx2[max(0,lastset($lastx2))],$lasty2[max(0,lastset($lasty2))],barindex,$lasty2[max(0,lastset($lasty2))])coloured(242, 54, 69)style(dottedline,2)
    drawtext("▼",barindex,high+0.25*tr)coloured("red")
    endif
    //------Check for support events-------------------------------------
    lvl2 = $lasty2[max(0,lastset($lasty2))]
    if low < lvl2 and min(close,open)> lvl2 and not checkup then
    drawcandle(high,high,low,low)coloured("black",90)
    checkup=1
    endif
    //----------------------------------------------------------//
    //----------------Bearish Breaker---------------------------//
    //----------------------------------------------------------//
    //-----Calculate pivots low------------------------------------------
    if low > low[lenght] and lowest[lenght](low) > low[lenght] and low[lenght] < lowest[lenght](low)[lenght+1] then
    $pl[lastset($pl)+1] = low[lenght]
    $plx[lastset($plx)+1] = barindex[lenght]
    plcross = 0
    endif
    //---------------------------------------------------------
    //-----Test for bearish market structure--------------------
    if close < $pl[max(0,lastset($pl))] and not plcross then
    drawsegment($plx[max(0,lastset($plx))],$pl[max(0,lastset($pl))],barindex,$pl[max(0,lastset($pl))])coloured(242, 54, 69)style(line,2)
    //MS Label
    if os = 1 then
    drawtext("MSS",(barindex+$plx[max(0,lastset($plx))])/2,$pl[max(0,lastset($pl))]-0.25*tr)
    else
    drawtext("MSB",(barindex+$plx[max(0,lastset($plx))])/2,$pl[max(0,lastset($pl))]-0.25*tr)
    endif
    $lasty[lastset($lasty)+1]=$pl[max(0,lastset($pl))]
    $lastx[lastset($lastx)+1]=barindex
    plcross=1
    os = -1
    breakup=0
    checkdw=0
    endif
    //------Iterate trough existing bearish structures and test for breaks
    if close > $lasty[max(0,lastset($lasty))] and open < $lasty[max(0,lastset($lasty))] and breakup=0 then
    breakup = 1
    checkdw = 1
    drawsegment($lastx[max(0,lastset($lastx))],$lasty[max(0,lastset($lasty))],barindex,$lasty[max(0,lastset($lasty))])coloured(8,153,129)style(dottedline,2)
    drawtext("▲",barindex,low-0.25*tr)coloured("green")
    endif
    //------Check for resistance events-------------------------------------
    lvl = $lasty[max(0,lastset($lasty))]
    if high > lvl and max(close,open)<lvl and not checkdw then
    drawcandle(high,high,low,low)coloured("black",90)
    checkdw=1
    endif
     
     
    return

    Bonjour,

    une question stp : comment faire pour prolonger les lignes de Drawsegment sur une période plus longue (par exemple un jour ou une semaine)?

    Merci.

    #234431 quote
    Iván González
    Moderator
    Master

    Salut. Je ne sais pas quelles lignes vous souhaitez modifier (toutes, juste les lignes pleines ou les lignes pointillées). Pour modifier la longueur il faut changer les lignes 19 et 58 (lignes pleines) et 37 et 76 (lignes pointillées). Je vous donne un exemple :

    drawsegment($lastx[max(0,lastset($lastx))],$lasty[max(0,lastset($lasty))],barindex+10,$lasty[max(0,lastset($lasty))])coloured(8,153,129)style(dottedline,2)

    Ce code étend la ligne de 10 barres puisque nous avons défini barindex+10

    finplus thanked this post
    #234443 quote
    finplus
    Participant
    Master

    Bonjour,

    c’est exactement ce que je cherchais. Il faut donc modifier le barindex. L’idéal serait que cette ligne perdure tant que le cours ne l’a pas franchi à la hausse ou à la baisse. je vais voir si je peux programmer quelque chose en ce sens.

    Merci.

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

Market Structure Brealkers Indicator


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
finplus @finplus Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by finplus
1 year, 7 months ago.

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