Block Order Multi Time Frame
Forums › ProRealTime forum Italiano › Supporto ProBuilder › Block Order Multi Time Frame
- This topic has 5 replies, 3 voices, and was last updated 1 week ago by
Iván.
-
-
04/12/2025 at 5:28 PM #245852
Buona sera ,
ho visto questo indicatore su Tradingview e sono curioso di provarlo, quindi chiedo gentilmente la traduzione.
Grazie
/@version=6indicator(title=’Order Blocks-[B.Balaei]’, shorttitle=’Order Blocks-[B.Balaei]’, overlay=true, max_boxes_count=20)mtf = input.timeframe(“5″, title=”Multi-Timeframe”, group=”Multi-Timeframe Settings”)mtf_open = request.security(syminfo.tickerid, mtf, open)mtf_close = request.security(syminfo.tickerid, mtf, close)mtf_high = request.security(syminfo.tickerid, mtf, high)mtf_low = request.security(syminfo.tickerid, mtf, low)_v = input.string(“1.0.2″, title=”Version”, options=[“1.0.2″], group=”Version”)sens = input.int(28, minval=1, title=’Sensitivity’, group=’Order Block’, tooltip=’Lower the sensitivity to show more order blocks. A higher sensitivity will show less order blocks.’)sens /= 100OBMitigationType = input.string(“Close”, title=”OB Mitigation Type”, options=[“Close”, “Wick”], group=”Order Block”, tooltip=”Choose how Order Blocks are mitigated”)OBBullMitigation = OBMitigationType==”Close” ? mtf_close[1] : mtf_lowOBBearMitigation = OBMitigationType==”Close” ? mtf_close[1] : mtf_highcol_bullish = input.color(#5db49e, title=”Bullish OB Border”, inline=”a”, group=”Order Block”)col_bullish_ob = input.color(color.new(#64C4AC, 85), title=”Background”, inline=”a”, group=”Order Block”)col_bearish = input.color(#4760bb, title=”Bearish OB Border”, inline=”b”, group=”Order Block”)col_bearish_ob = input.color(color.new(#506CD3, 85), title=”Background”, inline=”b”, group=”Order Block”)buy_alert = input.bool(title=’Buy Signal’, defval=true, group=’Alerts’, tooltip=’An alert will be sent when price goes below the top of a bullish order block.’)sell_alert = input.bool(title=’Sell Signal’, defval=true, group=’Alerts’, tooltip=’An alert will be sent when price goes above the bottom of a bearish order block.’)bool ob_created = falsebool ob_created_bull = falsevar int cross_index = navar box drawlongBox = navar longBoxes = array.new_box()var box drawShortBox = navar shortBoxes = array.new_box()pc_mtf = (mtf_open – mtf_open[4]) / mtf_open[4] * 100if ta.crossunder(pc_mtf, -sens)ob_created := truecross_index := bar_indexcross_indexif ta.crossover(pc_mtf, sens)ob_created_bull := truecross_index := bar_indexcross_indexif ob_created and cross_index – cross_index[1] > 5float last_green = 0float highest = 0for i = 4 to 15 by 1if mtf_close[i] > mtf_open[i]last_green := ibreakdrawShortBox := box.new(left=bar_index[last_green], top=mtf_high[last_green], bottom=mtf_low[last_green], right=bar_index[last_green], bgcolor=col_bearish_ob, border_color=col_bearish, extend=extend.right)array.push(shortBoxes, drawShortBox)if ob_created_bull and cross_index – cross_index[1] > 5float last_red = 0float highest = 0for i = 4 to 15 by 1if mtf_close[i] < mtf_open[i]last_red := ibreakdrawlongBox := box.new(left=bar_index[last_red], top=mtf_high[last_red], bottom=mtf_low[last_red], right=bar_index[last_red], bgcolor=col_bullish_ob, border_color=col_bullish, extend=extend.right)array.push(longBoxes, drawlongBox)if array.size(shortBoxes) > 0for i = array.size(shortBoxes) – 1 to 0 by 1sbox = array.get(shortBoxes, i)top = box.get_top(sbox)bot = box.get_bottom(sbox)if OBBearMitigation > toparray.remove(shortBoxes, i)box.delete(sbox)if mtf_high > bot and sell_alertalert(‘Price inside Bearish OB (MTF)’, alert.freq_once_per_bar)if array.size(longBoxes) > 0for i = array.size(longBoxes) – 1 to 0 by 1sbox = array.get(longBoxes, i)bot = box.get_bottom(sbox)top = box.get_top(sbox)if OBBullMitigation < botarray.remove(longBoxes, i)box.delete(sbox)if mtf_low < top and buy_alertalert(‘Price inside Bullish OB (MTF)’, alert.freq_once_per_bar)04/17/2025 at 9:26 AM #246007123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115//--------------------------------------------////PRC_Order Blocks//version = 0//17.04.25//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge//--------------------------------------------//// Inputs//--------------------------------------------//defparam drawonlastbaronly=truesens=28sens=sens/100OBMigrationtype=1//--------------------------------------------//// Order Block Mitigation Type//--------------------------------------------//if OBMigrationtype=1 thenOBBullmitigation=close[1]OBBearmitigation=close[1]elseOBBullmitigation=lowOBBearmitigation=highendif//--------------------------------------------//// Check for Order Block//--------------------------------------------//pc=(open-open[4])/open[4]*100if pc crosses under -sens thenobcreated=1crossindex=barindexelseobcreated=0endifif pc crosses over sens thenobcreatedbull=1crossindex=barindexelseobcreatedbull=0endif//--------------------------------------------//// Order Block Bear//--------------------------------------------//if obcreated and crossindex-crossindex[1]>5 thenlastgreen=0for i=4 to 15 doif close[i]>open[i] thenlastgreen=ibreakendifnext$boxleft[n+1]=barindex[lastgreen]$boxtop[n+1]=high[lastgreen]$boxbot[n+1]=low[lastgreen]$obcreated[n+1]=1n=n+1endif//--------------------------------------------//// Order Block Bull//--------------------------------------------//if obcreatedbull and crossindex-crossindex[1]>5 thenlastred=0for i=4 to 15 doif close[i]<open[i] thenlastred=ibreakendifnext$boxleftbull[m+1]=barindex[lastred]$boxtopbull[m+1]=high[lastred]$boxbotbull[m+1]=low[lastred]$obcreatedbull[m+1]=1m=m+1endif//--------------------------------------------//// Plot//--------------------------------------------//if islastbarupdate thenfor i=n downto 0 dobar=barindex-$boxleft[i]for j=bar-1 downto 0 doif high[j] > $boxtop[i] then$obcreated[i]=0breakendifnextif $obcreated[i]=1 thendrawrectangle($boxleft[i], $boxtop[i],barindex,$boxbot[i])coloured("blue",100)fillcolor("blue",30)endifnext//--------------------------------------------//for i=m downto 0 dobarbull=barindex-$boxleftbull[i]for j=barbull-1 downto 0 doif low[j] < $boxbotbull[i] then$obcreatedbull[i]=0breakendifnextif $obcreatedbull[i]=1 thendrawrectangle($boxleftbull[i], $boxtopbull[i],barindex,$boxbotbull[i])coloured("green",100)fillcolor("green",30)endifnextendif//--------------------------------------------//return04/17/2025 at 1:54 PM #246015Bonjour Ivan
problème avec ligne 11 et 12 ça ne peut pas fonctionner !
sens=28
sens=sens/10004/17/2025 at 3:36 PM #24602004/17/2025 at 3:39 PM #246022non ce que je constate c’est que tu utilise sens=28 et sens =sens/100 je pense que tu dois changer sens=sens/100 par sensa=sens/100 puis dans la suite du code remplacer sens par sensa ?
04/18/2025 at 6:25 AM #246053Il codice che ti ho passato è completamente funzionante…
Prova a fare quello che ti ho detto.
Se continui ad avere problemi, potrebbe essere che la tua versione non supporti qualche funzione integrata. Probabilmentefillcolor()
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on