STRUCTURE de marché (traduction de code)
Forums › ProRealTime forum Français › Support ProBuilder › STRUCTURE de marché (traduction de code)
- This topic has 5 replies, 3 voices, and was last updated 8 months ago by larouedegann.
Viewing 6 posts - 1 through 6 (of 6 total)
-
-
11/26/2023 at 8:09 PM #224324
Bonjour à tous,
Ci-joint dessous le code pinescript du MARKET STRUCTURE en libre service sur tradinview.
Ne connaissant pas ce langage, si les informaticiens du forum pourraient m’aider à la transcrire !
Merci d’avance.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161//@version=5indicator("Market Structure (Breakers) [LuxAlgo]", overlay = true, max_lines_count = 500, max_labels_count = 500)//-----------------------------------------------------------------------------}//Settings//-----------------------------------------------------------------------------{length = input.int(20, 'Swings Period', minval = 2)breaks = input.int(1, 'Maximum Breaks', minval = 1)maxDuration = input(1000, 'Breaker Maximum Duration')//StylebullCss = input(#089981, 'Bullish MS', inline = 'bull', group = 'Style')bullBreakCss = input(#f23645, 'Breaker', inline = 'bull', group = 'Style')bearCss = input(#f23645, 'Bearish MS', inline = 'bear', group = 'Style')bearBreakCss = input(#089981, 'Breaker', inline = 'bear', group = 'Style')//-----------------------------------------------------------------------------}//UDT//-----------------------------------------------------------------------------{type breakerline levelint breaks = 0//-----------------------------------------------------------------------------}//Bullish Breaker//-----------------------------------------------------------------------------{var phx = 0var phcross = falsevar bullms = array.new<breaker>(0)var os = 0n = bar_indexph = fixnan(ta.pivothigh(length, length))if ph != ph[1]phx := n-lengthphcross := false//Test for bullish market structureif close > ph and not phcrossline.new(phx, ph, n, ph, color = bullCss)//MS labellabel.new(int(math.avg(phx, n)), ph, os == -1 ? 'MSS' : 'MSB', textcolor = bullCss, color = color(na), size = size.small, style = label.style_label_down)bullms.unshift(breaker.new(line.new(n, ph, n, ph, color = bullBreakCss, style = line.style_dotted)))phcross := trueif bullms.size() > 100bullms.pop()os := 1//Iterate trough existing bullish structures and test for breaksbreak_down = falseif bullms.size() > 0for i = bullms.size()-1 to 0get = bullms.get(i)get.level.set_x2(n)if close < get.level.get_y2() and open > get.level.get_y2()get.breaks += 1if get.breaks == breaksbullms.remove(i)break_down := trueelse if (n - get.level.get_x1()) >= maxDurationbullms.remove(i).level.delete()//Support eventssupport = falseif bullms.size() > 0lvl = bullms.get(0).level.get_y2()support := low < lvl and math.min(close, open) > lvl//-----------------------------------------------------------------------------}//Bearish Breaker//-----------------------------------------------------------------------------{var plx = 0var plcross = falsevar bearms = array.new<breaker>(0)pl = fixnan(ta.pivotlow(length, length))if pl != pl[1]plx := n-lengthplcross := false//Test for bearish market structureif close < pl and not plcrossline.new(plx, pl, n, pl, color = bearCss)//MS labellabel.new(int(math.avg(plx, n)), pl, os == 1 ? 'MSS' : 'MSB', textcolor = bearCss, color = color(na), size = size.small, style = label.style_label_up)bearms.unshift(breaker.new(line.new(n, pl, n, pl, color = bearBreakCss, style = line.style_dotted)))plcross := trueif bearms.size() > 100bearms.pop()os := -1//Iterate trough existing bearish structures and test for breaksbreak_up = falseif bearms.size() > 0for i = bearms.size()-1 to 0get = bearms.get(i)get.level.set_x2(n)if close > get.level.get_y2() and open < get.level.get_y2()get.breaks += 1if get.breaks == breaksbearms.remove(i)break_up := trueelse if (n - get.level.get_x1()) >= maxDurationbearms.remove(i).level.delete()//Resistance eventsresistance = falseif bearms.size() > 0lvl = bearms.get(0).level.get_y2()resistance := high > lvl and math.max(close, open) < lvl//-----------------------------------------------------------------------------}//Plots//-----------------------------------------------------------------------------{plotchar(break_up, 'Bull MSB Breakout', '▲', location.belowbar, #089981)plotchar(break_down, 'Bear MSB Breakout', '▼', location.abovebar, #f23645)//Support eventsplotcandle(high, high, low, low, 'Support Events', na, na, bordercolor = support ? #089981 : na, display = display.all - display.status_line)//Resistance eventsplotcandle(high, high, low, low, 'Resistance Events', na, na, bordercolor = resistance ? #f23645 : na, display = display.all - display.status_line)//-----------------------------------------------------------------------------}11/26/2023 at 8:55 PM #224329c’est pas la meme chose que le lien ci dessous
https://www.prorealcode.com/prorealtime-indicators/ict-donchian-smart-money-structure/
11/28/2023 at 6:32 PM #224524non rien à voir à part support résistance
11/29/2023 at 7:03 PM #224596Une idée de traduction ?
03/15/2024 at 1:09 PM #229843Hola Ici, vous avez le code traduit par Prorealtime :
https://www.prorealcode.com/prorealtime-indicators/market-structure-breakers-indicator/
PRC_Rupteurs de structure de marché123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687//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 //$ph[max(0,lastset($ph))] as "Pivot High"coloured("blue"), $pl[max(0,lastset($pl))] as "Pivot Low"coloured("purple")03/16/2024 at 6:37 PM #229904muchas gracias yvan
-
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)