Conversion code ICT BPR pour ProRealTime
Forums › ProRealTime forum Français › Support ProBuilder › Conversion code ICT BPR pour ProRealTime
- This topic has 2 replies, 2 voices, and was last updated 1 month ago by
Alai-n.
Viewing 3 posts - 1 through 3 (of 3 total)
-
-
06/23/2025 at 3:58 PM #248507
Bonjour,
Serait-il possible de convertir le code joint en langage ProBuilder pour ProRealTime.
Je joins de plus le lien original afin d’avoir une vue d’ensemble sur ce que devrait faire le code!
Merci
https://fr.tradingview.com/script/zPbYfcE8-ICT-Balance-Price-Range-UAlgo/
ICT Balanced Price Range1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465// This Pine Script™ code is subject to the terms of the Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/// © UAlgo//@version=5indicator("ICT Balance Price Range [UAlgo]", "ICT Balance Price Range [UAlgo]", overlay=true)// Input parameterslookback_bars = input(12, "Bars to Consider", tooltip="Number of bars to consider for BPR conditions",group = "ICT Balance Price Range [UAlgo] Settings")threshold = input.float(0, step=0.25, title="Threshold for BPR", tooltip="Minimum range required for a valid BPR",group = "ICT Balance Price Range [UAlgo] Settings")remove_old_bpr = input(false, "Remove Old BPR", tooltip="Remove invalidated BPRs automatically",group = "ICT Balance Price Range [UAlgo] Settings")bear_color = input(color.new(color.rgb(255, 0, 0), 70), title="Bearish/Bullish Box Color", inline="color",group = "ICT Balance Price Range [UAlgo] Settings")bull_color = input(color.new(color.rgb(0, 128, 0), 70), title=" ", inline="color",group = "ICT Balance Price Range [UAlgo] Settings")// Variablesvar box bearish_box = navar box bullish_box = na// Functions to check FVG conditionsbear_fvg = high < low[2] and close[1] < low[2]bull_fvg = low > high[2] and close[1] > high[2]// Bullish BPR logicbull_since = ta.barssince(bear_fvg)bull_cond_1 = bull_fvg and bull_since <= lookback_barscombined_low_bull = bull_cond_1 ? math.max(high[bull_since], high[2]) : nacombined_high_bull = bull_cond_1 ? math.min(low[bull_since + 2], low) : nabull_result = bull_cond_1 and (combined_high_bull - combined_low_bull >= threshold)// Create or update bullish boxif bull_resultif remove_old_bpr and not na(bullish_box)box.delete(bullish_box)bullish_box := box.new(bar_index - bull_since - 1, combined_high_bull, bar_index + 1, combined_low_bull, border_color=bull_color, border_width=1, bgcolor=bull_color)// Alert for bullish BPRalertcondition(bull_result, "Bullish Alert", "New Bullish BPR")// Update bullish box position if necessaryif not na(bullish_box)if low > box.get_bottom(bullish_box)box.set_right(bullish_box, bar_index + 1)elsebullish_box := na// Bearish BPR logicbear_since = ta.barssince(bull_fvg)bear_cond_1 = bear_fvg and bear_since <= lookback_barscombined_low_bear = bear_cond_1 ? math.max(high[bear_since + 2], high) : nacombined_high_bear = bear_cond_1 ? math.min(low[bear_since], low[2]) : nabear_result = bear_cond_1 and (combined_high_bear - combined_low_bear >= threshold)// Create or update bearish boxif bear_resultif remove_old_bpr and not na(bearish_box)box.delete(bearish_box)bearish_box := box.new(bar_index - bear_since - 1, combined_high_bear, bar_index + 1, combined_low_bear, border_color=bear_color, border_width=1, bgcolor=bear_color)// Alert for bearish BPRalertcondition(bear_result, "Bearish Alert", "New Bearish BPR")// Update bearish box position if necessaryif not na(bearish_box)if high < box.get_top(bearish_box)box.set_right(bearish_box, bar_index + 1)elsebearish_box := na07/02/2025 at 9:32 AM #248635Bonjour. Vous avez ici :
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879// -------------------------------------------------------------------------// PRC_ICT Balance Price Range [UAlgo]//version = 0//02.07.2025//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge// -------------------------------------------------------------------------DEFPARAM DRAWONLASTBARONLY = truelookbackBars = 12threshold = 0.0bearFVG = (high < low[2] AND close[1] < low[2])bullFVG = (low > high[2] AND close[1] > high[2])bullSince = BarsSince(bearFVG)bearSince = BarsSince(bullFVG)bullCond1 = (bullFVG AND bullSince <= lookbackBars)IF bullCond1 THENcombinedLowBull = MAX(high[max(0,bullSince)], high[2])combinedHighBull = MIN(low[max(0,bullSince) + 2], low)IF (combinedHighBull - combinedLowBull >= threshold) THEN$bullBoxLeft[bullBoxCount+1] = barindex - bullSince - 1$bullBoxTop[bullBoxCount+1] = combinedHighBull$bullBoxRight[bullBoxCount+1] = barindex + 1$bullBoxBottom[bullBoxCount+1] = combinedLowBull$bullBoxState[bullBoxCount+1] = 1bullBoxCount = bullBoxCount + 1ENDIFENDIFif barindex > $bullBoxLeft[bullBoxCount] and $bullBoxState[bullBoxCount] = 1 thenif low > $bullBoxBottom[bullBoxCount] then$bullBoxRight[bullBoxCount]=barindex + 1else$bullBoxState[bullBoxCount] = -1endifendifbearCond1 = (bearFVG AND bearSince <= lookbackBars)IF bearCond1 THENcombinedLowBear = MAX(high[max(0,bearSince) + 2], high)combinedHighBear = MIN(low[max(0,bearSince)], low[2])IF (combinedHighBear - combinedLowBear >= threshold) THEN$bearBoxLeft[bearBoxCount+1] = barindex - bearSince - 1$bearBoxTop[bearBoxCount+1] = combinedHighBear$bearBoxRight[bearBoxCount+1] = barindex + 1$bearBoxBottom[bearBoxCount+1] = combinedLowBear$bearBoxState[bearBoxCount+1] = 1bearBoxCount = bearBoxCount + 1ENDIFENDIFif barindex > $bearBoxLeft[bearBoxCount] and $bearBoxState[bearBoxCount] = 1 thenif high < $bearBoxTop[bearBoxCount] then$bearBoxRight[bearBoxCount]=barindex + 1else$bearBoxState[bearBoxCount] = -1endifendifIF ISLASTBARUPDATE THENFOR i = 1 TO bearBoxCount DODRAWRECTANGLE($bearBoxLeft[i], $bearBoxTop[i], $bearBoxRight[i], $bearBoxBottom[i]) BORDERCOLOR(255,0,0) COLOURED(255,0,0,35)NEXTFOR i = 1 TO bullBoxCount DODRAWRECTANGLE($bullBoxLeft[i], $bullBoxTop[i], $bullBoxRight[i], $bullBoxBottom[i]) BORDERCOLOR(0,128,0) COLOURED(0,128,0,35)NEXTENDIFRETURN1 user thanked author for this post.
07/02/2025 at 1:03 PM #248647 -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
Find exclusive trading pro-tools on
Similar topics: