Conversion de l’indicateur Boom Hunter Pro de Tradingview
Forums › ProRealTime forum Français › Support ProBuilder › Conversion de l’indicateur Boom Hunter Pro de Tradingview
- This topic has 5 replies, 5 voices, and was last updated 8 months ago by Iván.
-
-
10/09/2022 at 7:28 PM #202229
Bonjour,
Après avoir chercher sur le forum et essayé moi même en utilisant un indicateur COG et ETO, j’abandonne et je vous demande de l’aide.
J’aurais besoin d’une conversion “partielle” du code qui va suivre. Je n’ai besoin que des deux courbes (Rouge et Blanche) qui seront dans le lien de la vidéo youtube.
Tout d’abord le lien du code code complet : https://fr.tradingview.com/script/coMNKN7M-Boom-Hunter-Pro/
La vidéo youtube sur laquelle les modification sont faite entre 4.04min et 4.17min : https://www.youtube.com/watch?v=wtB4fHM-IxM
Image de l’indicateur en image jointe.
Les deux courbes bleu et la jaune peuvent être supprimer et une des deux courbes rouge (la supérieure), le remplissage ainsi que les points d’entrés peuvent aussi être supprimés.
D’avance merci pour votre aide.
10/12/2022 at 7:40 AM #20234010/20/2022 at 10:30 AM #202841123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410title = 'Boom Hunter Pro'stitle = 'Boom Pro'version = ' 1.022'indicator(title=title + version, shorttitle=stitle, overlay=false, timeframe='')theme = 'Dark' //, "Theme:", options=["Dark", "Light"], group = "Main Settings", inline = "main")showfib = input.bool(defval=false, title='Show Fibonacci Lines?', group='Main Settings', inline='main2')showentry = input.bool(defval=true, title='Show Entry and Exit Points?', group='Main Settings')square = input.bool(true, title='Square Line?', group='Main Settings')showdboom = input.bool(true, title='Show Downward Boom Line?', group='Main Settings')showlongs = input.bool(true, title='Show Long Entries?', group='Main Settings')showshorts = input.bool(true, title='Show Short Entries?', group='Main Settings')//showsignals = input(defval = false, title = "Show Alerts?", group = "Main Settings")//QuotientLPPeriod = input.int(6, title='Quotient | LPPeriod', inline='quotient', group='EOT 1 (Main Oscillator)')K1 = input.int(0, title='K1', inline='quotient', group='EOT 1 (Main Oscillator)')K2 = 0.3esize = 60 //, title = "Size", inline = "quotient2", group = "EOT 1 (Main Oscillator)")ey = 50 //, title = "Y axis", inline = "quotient2", group = "EOT 1 (Main Oscillator)")trigno = input.int(2, 'Trigger Length', group='EOT 1 (Main Oscillator)', inline='quotient2')osccol = input.color(color.blue, title='Oscillator Color:', group='EOT 1 (Main Oscillator)', inline='q2')trigcol = input.color(color.white, title='Trigger Color:', group='EOT 1 (Main Oscillator)', inline='q2')// EOT 2//InputsLPPeriod2 = input.int(27, title='LPPeriod2', group='EOT 2 (Red Wave)', inline='q2')K12 = input.float(0.8, title='K1', group='EOT 2 (Red Wave)', inline='q2')K22 = input.float(0.3, title='K2', group='EOT 2 (Red Wave)', inline='q2')esize3 = 60 //, title = "Size", inline = "quotient2", group = "EOT 2 (Red Wave)")ey3 = 50 //, title = "Y axis2", inline = "quotient2", group = "EOT 2 (Red Wave)")osccol2 = input.color(color.red, title='Line Color:', inline='quotient22', group='EOT 2 (Red Wave)')osccol22 = input.color(color.red, title='Fill Color:', inline='quotient22', group='EOT 2 (Red Wave)')// EOT 3//InputsLPPeriod3 = input.int(11, title='LPPeriod3', group='EOT 3 (Yellow Line)', inline='q2')K13 = input.float(0.99, title='K1', group='EOT 3 (Yellow Line)', inline='q2')K33 = K13 * -1esize2 = 60 //, title = "Size", inline = "quotient3", group = "EOT 3 (Yellow Line)")ey2 = 50 //, title = "Y axis", inline = "quotient3", group = "EOT 3 (Yellow Line)")osccol3 = input.color(color.yellow, title='Line Color:', group='EOT 3 (Yellow Line)', inline='quotient3')// LSMAWTn1 = input.int(9, 'WT | master', inline='lsma', group='LSMA Wave Trend Settings')n2 = input.int(6, 'time 1', inline='lsma', group='LSMA Wave Trend Settings')n3 = input.int(3, '2', inline='lsma', group='LSMA Wave Trend Settings')n4 = input.int(21, 'LSMA | 1', inline='LSMA', group='LSMA Wave Trend Settings')n5 = input.int(0, '2', inline='LSMA', group='LSMA Wave Trend Settings')smalen = 2lsmaline = input.int(200, title='LSMA Long', group='LSMA Wave Trend Settings', inline='LSMA')if squareK13 := 0.9999K33 := -0.9999K33//FIB LINEShline(showfib ? 84 : na, linestyle=hline.style_solid, color=color.new(color.blue, 50))hline(showfib ? 64 : na, linestyle=hline.style_solid, color=color.new(color.blue, 50))hline(showfib ? 50 : na, linestyle=hline.style_solid, color=color.new(color.blue, 50))hline(showfib ? 36 : na, linestyle=hline.style_solid, color=color.new(color.blue, 50))hline(showfib ? 18 : na, linestyle=hline.style_solid, color=color.new(color.blue, 50))//EOT 1//Varsalpha1 = 0.00HP = 0.00a1 = 0.00b1 = 0.00c1 = 0.00c2 = 0.00c3 = 0.00Filt = 0.00Peak = 0.00X = 0.00Quotient1 = 0.00Quotient2 = 0.00pi = 2 * math.asin(1)//Highpass filter cyclic components//whose periods are shorter than 100 barsalpha1 := (math.cos(.707 * 2 * pi / 100) + math.sin(.707 * 2 * pi / 100) - 1) / math.cos(.707 * 2 * pi / 100)HP := (1 - alpha1 / 2) * (1 - alpha1 / 2) * (close - 2 * nz(close[1]) + nz(close[2])) + 2 * (1 - alpha1) * nz(HP[1]) - (1 - alpha1) * (1 - alpha1) * nz(HP[2])//SuperSmoother Filtera1 := math.exp(-1.414 * pi / LPPeriod)b1 := 2 * a1 * math.cos(1.414 * pi / LPPeriod)c2 := b1c3 := -a1 * a1c1 := 1 - c2 - c3Filt := c1 * (HP + nz(HP[1])) / 2 + c2 * nz(Filt[1]) + c3 * nz(Filt[2])//Fast Attack - Slow Decay AlgorithmPeak := .991 * nz(Peak[1])if math.abs(Filt) > PeakPeak := math.abs(Filt)Peak//Normalized Roofing Filterif Peak != 0X := Filt / PeakXQuotient1 := (X + K1) / (K1 * X + 1)Quotient2 := (X + K2) / (K2 * X + 1)// EOT 2//Varsalpha1222 = 0.00HP2 = 0.00a12 = 0.00b12 = 0.00c12 = 0.00c22 = 0.00c32 = 0.00Filt2 = 0.00Peak2 = 0.00X2 = 0.00Quotient3 = 0.00Quotient4 = 0.00alpha1222 := (math.cos(.707 * 2 * pi / 100) + math.sin(.707 * 2 * pi / 100) - 1) / math.cos(.707 * 2 * pi / 100)HP2 := (1 - alpha1222 / 2) * (1 - alpha1222 / 2) * (close - 2 * nz(close[1]) + nz(close[2])) + 2 * (1 - alpha1222) * nz(HP2[1]) - (1 - alpha1222) * (1 - alpha1222) * nz(HP2[2])//SuperSmoother Filtera12 := math.exp(-1.414 * pi / LPPeriod2)b12 := 2 * a12 * math.cos(1.414 * pi / LPPeriod2)c22 := b12c32 := -a12 * a12c12 := 1 - c22 - c32Filt2 := c12 * (HP2 + nz(HP2[1])) / 2 + c22 * nz(Filt2[1]) + c32 * nz(Filt2[2])//Fast Attack - Slow Decay AlgorithmPeak2 := .991 * nz(Peak2[1])if math.abs(Filt2) > Peak2Peak2 := math.abs(Filt2)Peak2//Normalized Roofing Filterif Peak2 != 0X2 := Filt2 / Peak2X2Quotient3 := (X2 + K12) / (K12 * X2 + 1)Quotient4 := (X2 + K22) / (K22 * X2 + 1)// EOT 3//Varsalpha1333 = 0.12HP3 = 0.00a13 = 0.00b13 = 0.00c13 = 0.00c33 = 0.00c333 = 0.00Filt3 = 0.00Peak3 = 0.00X3 = 0.00Quotient5 = 0.00Quotient6 = 0.00alpha1333 := (math.cos(.707 * 2 * pi / 100) + math.sin(.707 * 2 * pi / 100) - 1) / math.cos(.707 * 2 * pi / 100)HP3 := (1 - alpha1333 / 3) * (1 - alpha1333 / 2) * (close - 2 * nz(close[1]) + nz(close[2])) + 2 * (1 - alpha1333) * nz(HP3[1]) - (1 - alpha1333) * (1 - alpha1333) * nz(HP3[2])//SuperSmoother Filtera13 := math.exp(-1.414 * pi / LPPeriod3)b13 := 2 * a13 * math.cos(1.414 * pi / LPPeriod3)c33 := b13c333 := -a13 * a13c13 := 1 - c33 - c333Filt3 := c13 * (HP3 + nz(HP3[1])) / 2 + c33 * nz(Filt3[1]) + c333 * nz(Filt3[2])//Fast Attack - Slow Decay AlgorithmPeak3 := .991 * nz(Peak3[1])if math.abs(Filt3) > Peak3Peak3 := math.abs(Filt3)Peak3//Normalized Roofing Filterif Peak3 != 0X3 := Filt3 / Peak3X3Quotient5 := (X3 + K13) / (K13 * X3 + 1)Quotient6 := (X3 + K33) / (K33 * X3 + 1)line1 = -0.9// LSMAWT// Sources:src0 = opensrc1 = highsrc2 = lowsrc3 = closesrc4 = hl2src5 = hlc3src6 = ohlc4src7 = ta.trvol = volumetci(src) =>ta.ema((src - ta.ema(src, n1)) / (0.025 * ta.ema(math.abs(src - ta.ema(src, n1)), n1)), n2) + 50mf(src) =>100.0 - 100.0 / (1.0 + math.sum(volume * (ta.change(src) <= 0 ? 0 : src), n3) / math.sum(volume * (ta.change(src) >= 0 ? 0 : src), n3))willy(src) =>60 * (src - ta.highest(src, n2)) / (ta.highest(src, n2) - ta.lowest(src, n2)) + 80csi(src) =>math.avg(ta.rsi(src, n3), ta.tsi(src0, n1, n2) * 50 + 50)phoenix(src) =>math.avg(tci(src), csi(src), mf(src), willy(src))tradition(src) =>math.avg(tci(src), mf(src), ta.rsi(src, n3))// Indi FUnctions {wt1 = tradition(src5)wt2 = ta.sma(wt1, 6)//wt5 = sma(j,6)// LSMAwt3 = ta.linreg(wt1, n4, n5)wt4 = ta.ema((wt1 - wt2) * 2 + 50, n3)trig = ta.sma(wt3, smalen)q3 = Quotient3 * esize + eyq4 = Quotient4 * esize + eyPlot33 = plot(q3, color=color.new(color.red, 50), linewidth=1, title='Quotient 1')Plot44 = plot(q4, color=color.new(color.red, 50), linewidth=1, title='Quotient 2')fill(Plot33, Plot44, color=color.new(color.red, 90))//Plot EOTq1 = Quotient1 * esize + eyq2 = Quotient2 * esize + eytrigger = ta.sma(q1, trigno)//Plot3 = plot(q1, color= theme == "Tartan" ? color.white : color.blue, linewidth =2,title = "Quotient 1")//PLOT LSMAWText1 = wt2 < 20 ? trigger + 9 : wt2 > 80 ? trigger - 9 : na//plot(wt3, color = color.gray, linewidth = 1, transp = 50)//plot(ext1, "Pressure", color = wt2<20 ? color.lime : wt2>80 ? color.red : na, style = plot.style_circles, linewidth = 2, transp = 10)//plot(osc == "LSMA Wave Trend" ? sma(wt3,smalen) : na, color= theme == "Tartan" ? color.blue : theme == "Classic" ? #ff6a00 : color.yellow, linewidth = 2)lsma = ta.linreg(wt3, lsmaline, 0)//lsma = linreg(rsi(close,13),lsmaline,0)//plot(lsma, color= color.gray, linewidth = 1,transp = 50)q5 = Quotient5 * esize2 + ey2q6 = Quotient6 * esize2 + ey2Plot54 = plot(showdboom ? q6 : na, color=color.new(color.blue, 0), linewidth=1, title='Quotient 1')Plot55 = plot(q5, color=theme == 'Light' ? color.new(color.orange, 0) : color.new(color.yellow, 0), linewidth=1, title='Quotient 1')//Conditionssma200 = ta.sma(close, 200)entry = ta.crossunder(Quotient2, line1)color2 = Quotient1 <= -1 and Quotient2 <= -1exit = ta.cross(Quotient1, Quotient2) and close > sma200 and Quotient1 > 0.5over = ta.cross(Quotient5, Quotient6) and Quotient5 > 0.5over2 = ta.crossover(Quotient5, Quotient6) and Quotient5 > 0.5over3 = ta.cross(Quotient3, Quotient4) and Quotient3 > 0enter = ta.crossover(q1, trigger) and q1 < lsmaplotshape(showentry ? over : na, title='Exit Warning', location=location.bottom, style=shape.circle, size=size.tiny, color=color.new(color.orange, 0))plotshape(showentry ? over3 : na, title='Exit Warning', location=location.bottom, style=shape.circle, size=size.tiny, color=color.new(color.red, 0), text='Overbought')// Breaks - luxalgotoggleBreaks = input.bool(false, title='Show Break Lines?', group='Support and Resistance Breaks')//track = input(true, title = "Show Price lines?", group = "Support and Resistance Breaks" )leftBars = input.int(1, title='Resistance | Left Bars ', group='Support and Resistance Breaks', inline='2')rightBars = input.int(1, title='Right Bars', group='Support and Resistance Breaks', inline='2')//toggleBreaks2 = input(false, title = "Show Resistance", group = "Support and Resistance Breaks" )leftBars2 = input.int(5, title='Support (Long) | Left Bars ', group='Support and Resistance Breaks', inline='3')rightBars2 = input.int(5, title='Right Bars', group='Support and Resistance Breaks', inline='3')//toggleBreaks3 = input(false, title = "Show Support (long)", group = "Support and Resistance Breaks" )leftBars3 = input.int(1, title='Support (Short) |Left Bars ', group='Support and Resistance Breaks', inline='4')rightBars3 = input.int(1, title='Right Bars', group='Support and Resistance Breaks', inline='4')//toggleBreaks4 = input(false, title = "Show Support (Short)", group = "Support and Resistance Breaks" )highUsePivot = fixnan(ta.pivothigh(q1, leftBars, rightBars)[1])lowUsePivot = fixnan(ta.pivotlow(q1, leftBars2, rightBars2)[1])lowUsePivot2 = fixnan(ta.pivotlow(q1, leftBars3, rightBars3)[1])highUsePivot2 = fixnan(ta.pivothigh(q1, leftBars3, rightBars3)[1])r1 = plot(toggleBreaks ? highUsePivot : na, color=ta.change(highUsePivot) ? na : color.red, linewidth=1, offset=-(rightBars + 1), title='Resistance')s2 = plot(toggleBreaks ? lowUsePivot2 : na, color=ta.change(lowUsePivot2) ? na : color.silver, linewidth=1, offset=-(rightBars3 + 1), title='Support')s1 = plot(toggleBreaks ? lowUsePivot : na, color=ta.change(lowUsePivot) ? na : color.blue, linewidth=1, offset=-(rightBars2 + 1), title='Support')crossover = ta.crossover(q1, trigger)crossunder = ta.crossunder(q1, trigger)//VARvar ubreak = 0var ubreak2 = 0var dbreak = 0var cont = 0var cont2 = 0var pull = 0var dbreak2 = 0var cross = 0if crossundercross := 0crossif crossovercross := 1crossif ta.crossunder(q1, lowUsePivot)dbreak += 1dbreakif entrydbreak := 0dbreak2 := 0ubreak := 0ubreak2 := 0cont := 0cont2 := 0cont2//if dbreak > 2// dbreak := 0volcond = ta.linreg(volume, 20, 0)var drag = 0if Quotient1 <= -1drag += 1dragif ta.crossover(Quotient1, -0.9)drag := 0dragif ta.crossover(q1, highUsePivot) and dbreak >= 1ubreak += 1ubreakdragno = input(3)if ta.crossover(q1, highUsePivot) and dbreak >= 1 and ubreak <= 1cont := 1contif ta.crossover(q1, highUsePivot) and dbreak >= 2 and ubreak >= 2 and cont <= 2cont2 := 1cont2if ta.crossunder(q1, lowUsePivot2)dbreak2 += 1dbreak2if ta.crossunder(q1, highUsePivot2)ubreak2 += 1ubreak2if ta.crossunder(q1, lowUsePivot2) and dbreak2 == 1ubreak2 := 0ubreak2Plot = plot(q1, color=cross == 1 ? #00ffaa : drag >= dragno ? color.purple : Quotient1 <= -0.8 ? color.yellow : Quotient3 <= -0.9 ? color.white : cross == 0 ? color.red : color.gray, linewidth=2, title='Quotient 2', trackprice=true)Plot4 = plot(q1, color=osccol, linewidth=2, title='Quotient 2')Plot3 = plot(trigger, color=trigcol, linewidth=2, title='Quotient 1')plot(ext1, 'Pressure', color=wt2 < 20 ? #00ffaa : wt2 > 80 ? color.red : na, style=plot.style_circles, linewidth=2, transp=10)warn = ta.crossover(Quotient3, -0.9)warn2 = ta.crossover(Quotient1, -0.9)warn3 = ta.crossunder(Quotient1, 0.9)enter2 = Quotient1 <= -0.9 and ta.crossover(q1, trigger) and ta.barssince(warn) <= 7 // and Quotient3 <= -0.6 // and close > sma // QUALITY ENTRIESenter3 = Quotient3 <= -0.9 and ta.crossover(q1, trigger) and ta.barssince(warn2) <= 7 and q1 <= 20 and ta.barssince(ta.crossover(q1, 20)) <= 21 // and Quotient3 <= -0.6 // and close > sma // QUALITY ENTRIESentercond = ta.crossover(q1, trigger) and q1 < 10enter4 = q1 <= 20 and ta.barssince(entercond) <= 5 and ta.crossover(q1, trigger)enter5 = ta.barssince(q1 <= 0 and ta.crossunder(q1, trigger)) <= 5 and ta.crossover(q1, trigger)enter6 = ta.barssince(q1 <= 20 and ta.crossunder(q1, trigger)) <= 11 and ta.crossover(q1, trigger)enter7 = Quotient3 <= -0.9 and ta.crossover(q1, trigger)//shortssenter3 = Quotient3 >= -0.9 and ta.crossunder(q1, trigger) and ta.barssince(warn3) <= 7 and q1 >= 99 and ta.barssince(ta.crossover(q1, 80)) <= 21 // and Quotient3 <= -0.6 // and close > sma // QUALITY ENTRIES//plotshape(enter2, title="Boom!", location=location.top, style=shape.circle, size=size.normal, color=color.yellow, transp=0)plotshape(showlongs and enter6 and q1 <= 60, title='Long gray', text='Long', style=shape.labeldown, location=location.top, color=color.new(color.silver, 20), textcolor=color.new(color.white, 20), size=size.tiny)plotshape(showlongs and enter7, title='Long yellow', text='Long', style=shape.labeldown, location=location.top, color=color.new(color.yellow, 20), textcolor=color.new(color.white, 20), size=size.tiny)plotshape(showlongs and enter5, title='Long blue', text='Long', style=shape.labeldown, location=location.top, color=color.new(color.blue, 20), textcolor=color.new(color.white, 20), size=size.tiny)plotshape(showlongs and enter3, title='Long Lime', text='Long', style=shape.labeldown, location=location.top, color=color.new(color.lime, 20), textcolor=color.new(color.white, 20), size=size.tiny)plotshape(showshorts ? senter3 : na, title='Break', text='Short', style=shape.labeldown, location=location.top, color=color.new(color.red, 20), textcolor=color.new(color.white, 20), size=size.tiny)plotshape(ta.crossover(q1, highUsePivot) and dbreak >= 1 and ubreak <= 1, title='Break', style=shape.triangleup, location=location.bottom, color=color.new(#00ffaa, 0), size=size.tiny, text='Continuation')allbars = input(false, title='Show Bar Colors?')barc = input(false, title='Show Pump Bar Colors?')barcolor(allbars and drag >= dragno ? color.purple : allbars and Quotient3 <= -0.9 ? color.white : allbars and Quotient1 <= -0.9 ? color.yellow : na)barcolor(allbars and barc and q1 > trigger ? #00ffaa : allbars and barc and q1 < trigger ? color.red : allbars and barc ? color.gray : na)plotshape(ta.barssince(ta.crossover(wt2,80)) <= 1 and ta.crossunder(wt2,80) ? wt2 + 9 : na, location = location.absolute, style = shape.triangledown, color = color.yellow, size = size.tiny)//, text = "Bounce", textcolor = color.white)plotshape(ta.barssince(ta.crossunder(wt2,20)) <= 1 and ta.crossover(wt2,20) ? wt2 - 9 : na, location = location.absolute, style = shape.triangleup, color = color.yellow, size = size.tiny)//, text = "Bounce", textcolor = color.white)//ALERTSalertcondition(crossover, title='Crossover')alertcondition(crossunder, title='Crossunder')alertcondition(enter6 or enter7 or enter5 or enter3, title='Long')alertcondition(ta.crossunder(Quotient5, -0.9), title='Entry Zone')//alertcondition(crossunder(q1,lowUsePivot), title='Short')alertcondition(ta.crossover(q1, highUsePivot), title='Break Resistance')alertcondition(ta.crossunder(q1, lowUsePivot), title='Break Support')alertcondition(Quotient1 <= -0.9 and crossover, title='Crossover - Market Low')alertcondition(Quotient1 >= 0.9 and crossunder, title='Crossunder - Market High')alertcondition(wt2 <= 20 and crossover, title='Crossover With Pressure')alertcondition(wt2 >= 80 and crossunder, title='Crossunder With Pressure')alertcondition(ta.crossover(q1, highUsePivot) and dbreak >= 1 and ubreak <= 1, title='Continuation')alertcondition(over, title='Orange - Overbought')alertcondition(over3, title='Red - Overbought')alertcondition(ta.barssince(ta.crossover(wt2,80)) <= 1 and ta.crossunder(wt2,80) , title='Bounce down')alertcondition(ta.barssince(ta.crossunder(wt2,20)) <= 1 and ta.crossover(wt2,20), title='Bounce up')alertcondition(senter3, title='Short')Photo avant/après en image.
12/28/2023 at 1:09 PM #225757Bonjour,
Sauf erreur de ma part, le code proposé par Aretuza ne fonctionne pas tel quel.
Quand je le copie dans PRT, les 9 premières lignes présentes des erreurs et ma faible connaissance du codage ne m’autorise pas de les corriger moi-même.
Pensez-vous pouvoir corriger ces erreurs et me confirmer que cet indicateur fonctionne sur PRT ?
Merci d’avance
Mes meilleurs voeux pour les fêtes et l’année à venir.
Acalgo
12/28/2023 at 1:46 PM #225759Bonjour
c’est normal que le code proposé par Aretuza ne fonctionne pas tel quel puisque c’est un code pour tradingview et non pas prorealcode…
03/13/2024 at 8:51 PM #229721Cola,
Aquí tienes una traducción del código. Faltarían los pivotpoint y las señales pero como veo que no lo necesitas no he continuado.Cola
Ici vous avez une traduction du code. Le point pivot et les panneaux manqueraient mais comme je vois que vous n’en avez pas besoin, je n’ai pas continué.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249squared = 1 //Square lineshowfib = 1 //show fibonaccishowdboom = 1showentry = 1///EOT 1 Main Oscilatorlpperiod = 6 //Quotientk1 = 0 // K1k2 = 0.3esize = 60 // Sizeey = 50 //Y axistrigno = 2 //trigger length///EOT 2lpperiod2 = 27 //k12 = 0.8k22 = 0.3esize2 = 60ey2 = 50///EOT 3lpperiod3 = 11 //k13 = 0.99k33 = k13*(-1)esize3 = 60ey3 = 50///LSMAWTn1 = 9 //WT Mastern2 = 6 //time 1n3 = 3 //time 2n4 = 21 //LSMA 1n5 = 0 //LSMA 2smalen = 2lsmaline= 200 //LSMA longif squared thenk13 = 0.9999k33 = -0.9999endifif showfib thenDRAWHLINE(84) coloured(33, 150, 243,50)style(dottedline)DRAWHLINE(64) coloured(33, 150, 243,50)style(dottedline)DRAWHLINE(50) coloured(33, 150, 243,50)style(dottedline)DRAWHLINE(36) coloured(33, 150, 243,50)style(dottedline)DRAWHLINE(18) coloured(33, 150, 243,50)style(dottedline)endif///EOT 1//varspi = 2 * asin(1)if barindex < 2 thenalpha1 = 0.00HP = 0.00a1 = 0.00b1 = 0.00c1 = 0.00c2 = 0.00c3 = 0.00Filt = 0.00Peak = 0.00X = 0.00Quotient1 = 0.00Quotient2 = 0.00else//highpass filter cyclic components//whose periods are shorter than 100 barsalpha1 = (cos(0.707*2*pi/100)+sin(0.707*2*pi/100)-1)/cos(0.707*2*pi/100)hp = (1-alpha1/2)*(1-alpha1/2)*(close-2*close[1]+close[2])+2*(1-alpha1)*hp[1]-(1-alpha1)*(1-alpha1)*hp[2]//supersmoother filtera1 = exp(-1.414*3.1416/lpperiod)b1 = 2*a1*cos(1.414*pi/lpperiod)c2 = b1c3 = -a1*a1c1 = 1-c2-c3filt = c1*(hp+hp[1])/2+c2*filt[1]+c3*filt[2]//fast attack-slow decay algotithmpeak = 0.991*peak[1]if abs(filt)>peak thenpeak=abs(filt)elsepeak=peakendif//normalizad roffing filterif peak<>0 thenx=filt/peakelsex=xendifQuotient1 = (x+k1)/(k1*x+1)Quotient2 = (x+k2)/(k2*x+1)endif////EOT 2if barindex < 2 thenalpha1222 = 0.00HP2 = 0.00a12 = 0.00b12 = 0.00c12 = 0.00c22 = 0.00c32 = 0.00Filt2 = 0.00Peak2 = 0.00X2 = 0.00elsealpha1222 = (cos(.707 * 2 * pi / 100) + sin(.707 * 2 * pi / 100) - 1) / cos(.707 * 2 * pi / 100)HP2 = (1 - alpha1222 / 2) * (1 - alpha1222 / 2) * (close - 2 * close[1] + close[2]) + 2 * (1 - alpha1222) * HP2[1] - (1 - alpha1222) * (1 - alpha1222) * HP2[2]//SuperSmoother Filtera12 = EXP(-1.414 * 3.1416 / LPPeriod2)b12 = 2 * a12 * cos(1.414 * pi / LPPeriod2)c22 = b12c32 = -a12 * a12c12 = 1 - c22 - c32Filt2 = c12 * (HP2 + HP2[1]) / 2 + c22 * Filt2[1] + c32 * Filt2[2]//Fast Attack - Slow Decay AlgorithmPeak2 = .991 * Peak2[1]if abs(Filt2) > Peak2 thenPeak2 = abs(Filt2)elsePeak2 = peak2endif//Normalized Roofing Filterif Peak2 <> 0 thenX2 = Filt2 / Peak2elseX2 = X2endifQuotient3 = (X2 + K12) / (K12 * X2 + 1)Quotient4 = (X2 + K22) / (K22 * X2 + 1)endif////EOT 3if barindex < 3 thenalpha1333 = 0.12HP3 = 0.00a13 = 0.00b13 = 0.00c13 = 0.00c33 = 0.00c333 = 0.00Filt3 = 0.00Peak3 = 0.00X3 = 0.00Quotient5 = 0.00Quotient6 = 0.00elsealpha1333 = (cos(.707 * 2 * pi / 100) + sin(.707 * 2 * pi / 100) - 1) / cos(.707 * 2 * pi / 100)HP3 = (1 - alpha1333 / 3) * (1 - alpha1333 / 2) * (close - 2 * close[1] + close[2]) + 2 * (1 - alpha1333) * HP3[1] - (1 - alpha1333) * (1 - alpha1333) * HP3[2]//SuperSmoother Filtera13 = exp(-1.414 * 3.1416 / LPPeriod3)b13 = 2 * a13 * cos(1.414 * pi / LPPeriod3)c33 = b13c333 = -a13 * a13c13 = 1 - c33 - c333Filt3 = c13 * (HP3 + HP3[1]) / 2 + c33 * Filt3[1] + c333 * Filt3[2]//Fast Attack - Slow Decay AlgorithmPeak3 = .991 * Peak3[1]if abs(Filt3) > Peak3 thenPeak3 = abs(Filt3)elsePeak3 = peak3endif//Normalized Roofing Filterif Peak3 <> 0 thenX3 = Filt3 / Peak3elseX3 = peak3endifQuotient5 = (X3 + K13) / (K13 * X3 + 1)Quotient6 = (X3 + K33) / (K33 * X3 + 1)line1 = -0.9endif// LSMAWT// Sources:src0 = opensrc1 = highsrc2 = lowsrc3 = closesrc4 = (high+low)/2 //hl2src5 = (high+low+close)/3 //hlc3src6 = (high+low+close+open)/4 //ohlc4src7 = trvol = volume////Indi Functions////wt1 = tradition(src5)//tradition(src) => avg(tci(src), mf(src), rsi(src, n3))//tci(src)tci1 = average[n2,1]((src5-average[n1,1](src5))/(0.025*average[n1,1](abs(src5-average[n1,1](src5))))) + 50//mf(src)//Auxmf1 = (change(src) <= 0 ? 0 : src)if src5-src5[1]<=0 thenauxmf1 = 0elseauxmf1 = src5endif//Auxmf2 = (change(src) >= 0 ? 0 : src)if src5-src5[1]>=0 thenauxmf2 = 0elseauxmf2 = src5endifmf1 = 100.0 - 100.0 / (1.0 + summation[n3](volume * auxmf1) / summation[n3](volume * auxmf2))//rsi(src, n3)rsi1 = rsi[n3](src5)wt1 = (tci1+mf1+rsi1)/3wt2 = average[6](wt1)/////LSMAwt3 = LinearRegression[n4](wt1)wt4 = average[n3,1]((wt1-wt2)*2+50)trig = average[smalen](wt3)q3 = Quotient3 * esize + eyq4 = Quotient4 * esize + eycolorbetween(q3,q4,"red",90)//plot EOTq1 = Quotient1 * esize + eyq2 = Quotient2 * esize + eytrigger = average[trigno](q1)//PLOT LSMAWTif wt2 < 20 thenext1 = trigger + 9elsif wt2 > 80 thenext1 = trigger - 9elseext1 = undefinedendiflsma = LinearRegression[lsmaline ](wt3)q5 = Quotient5 * esize2 + ey2q6 = Quotient6 * esize2 + ey2return q1 as "oscillator"coloured("blue")style(line,2), trigger as "Trigger"coloured("white")style(line,2),q3 as "Quotient1"coloured("red",50), q4 as "Quotient2"coloured("red",50) -
AuthorPosts
Find exclusive trading pro-tools on