Market Structure Brealkers Indicator
Forums › ProRealTime forum Français › Support ProBuilder › Market Structure Brealkers Indicator
- This topic has 2 replies, 2 voices, and was last updated 4 months ago by finplus.
-
-
06/27/2024 at 12:03 PM #234425Market Structure Breakers123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687//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 = 0endif//-----Test for bullish market structure--------------------if close > $ph[max(0,lastset($ph))] and not phcross thendrawsegment($phx[max(0,lastset($phx))],$ph[max(0,lastset($ph))],barindex,$ph[max(0,lastset($ph))])style(line,2)coloured(8,153,129)//MS Labelif os = -1 thendrawtext("MSS",(barindex+$phx[max(0,lastset($phx))])/2,$ph[max(0,lastset($ph))]+0.25*tr)elsedrawtext("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] = barindexbreakdown = 0checkup = 0phcross = 1os = 1endif//------Iterate trough existing bullish structures and test for breaksif close < $lasty2[max(0,lastset($lasty2))] and open > $lasty2[max(0,lastset($lasty2))] and breakdown=0 thenbreakdown = 1checkup = 1drawsegment($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 thendrawcandle(high,high,low,low)coloured("black",90)checkup=1endif//----------------------------------------------------------////----------------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 = 0endif//---------------------------------------------------------//-----Test for bearish market structure--------------------if close < $pl[max(0,lastset($pl))] and not plcross thendrawsegment($plx[max(0,lastset($plx))],$pl[max(0,lastset($pl))],barindex,$pl[max(0,lastset($pl))])coloured(242, 54, 69)style(line,2)//MS Labelif os = 1 thendrawtext("MSS",(barindex+$plx[max(0,lastset($plx))])/2,$pl[max(0,lastset($pl))]-0.25*tr)elsedrawtext("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]=barindexplcross=1os = -1breakup=0checkdw=0endif//------Iterate trough existing bearish structures and test for breaksif close > $lasty[max(0,lastset($lasty))] and open < $lasty[max(0,lastset($lasty))] and breakup=0 thenbreakup = 1checkdw = 1drawsegment($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 thendrawcandle(high,high,low,low)coloured("black",90)checkdw=1endifreturn
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.
06/27/2024 at 2:40 PM #234431Salut. 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 :
1drawsegment($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
1 user thanked author for this post.
06/27/2024 at 3:55 PM #234443Bonjour,
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.
-
AuthorPosts
Find exclusive trading pro-tools on