Market sweeps are not mere random fluctuations, they are strategic moves designed to capture liquidity or to set the stage for more significant price movements. Therefore, understanding these sweeps can be key to anticipating big rallies or crashes, allowing traders to optimally position their trades.
The Sweep Institucional Indicator not only helps to identify these critical points with astonishing accuracy but also provides deep insights into the psychology behind market actions.
The Sweep strategy involves identifying potential trades based on the creation of a sweep (liquidity grab) at the Swing High or Swing Low.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
//PRC_Sweep Institucional //version = 0 //28.02.24 //Iván González @ www.prorealcode.com //Sharing ProRealTime knowledge /////////////////////////////////////////////// /////////////inputs//////////////////////////// cooldownPeriod =10 //"Cooldown Period" prd = 20 src1 = low src2 = high ////////Calculations////////////////////////// /////pivots low if src1 > src1[prd] and lowest[prd](src1) > src1[prd] and src1[prd] < lowest[prd](src1)[prd+1] then $prevpivotlowy[lastset($prevpivotlowy)+1] = $pivotlowy[max(lastset($pivotlowy),1)] $prevpivotlowx[lastset($prevpivotlowx)+1] = $pivotlowx[max(lastset($pivotlowx),1)] $pivotlowy[lastset($pivotlowy)+1] = src1[prd] $pivotlowx[lastset($pivotlowx)+1] = barindex[prd] z = z + 1 drawpoint(barindex[prd],src1[prd],1)coloured("White") drawtext("L",barindex[prd],src1[prd]-0.5*tr)coloured("green") endif /////pivots high if src2 < src2[prd] and highest[prd](src2)<src2[prd] and src2[prd]>highest[prd](src2)[prd+1] then $prevpivothighy[lastset($prevpivothighy)+1] = $pivothighy[max(lastset($pivothighy),1)] $prevpivothighx[lastset($prevpivothighx)+1] = $pivothighx[max(lastset($pivothighx),1)] $pivothighy[lastset($pivothighy)+1]=src2[prd] $pivothighx[lastset($pivothighx)+1]=barindex[prd] t=t+1 drawpoint(barindex[prd],src2[prd],1)coloured("White") drawtext("H",barindex[prd],src2[prd]+0.5*tr)coloured("red") endif //////////////////////////////////////////////////////// pLow = $pivotlowy[max(1,lastset($pivotlowy))] pHigh = $pivothighy[max(1,lastset($pivothighy))] pLowindex = $pivotlowx[max(1,lastset($pivotlowx))] pHighindex = $pivothighx[max(1,lastset($pivothighx))] lp = lowest[prd](low) hp = highest[prd](high) lowestclose = lowest[prd](close) highestclose = highest[prd](close) ////////////////////////Sweep conditions/////////////////////////////////////////// bullishSFP = low < pLow and close > pLow and open > pLow and low = lp and lowestClose >= pLow bearishSFP = high > pHigh and close < pHigh and open < pHigh and high = hp and highestClose <= pHigh bullCond = bullishSFP[3] and (close > pLow) and (close[1] > pLow[1]) and (close[2] > pLow[2]) and barindex >= bullSignalIndex + cooldownPeriod bearCond = bearishSFP[3] and (close < pHigh) and (close[1] < pHigh[1]) and (close[2] < pHigh[2]) and barindex >= bearSignalIndex + cooldownPeriod //Draw sweep lines if bullcond then bullsignalindex = barindex drawsegment(pLowindex,pLow,barindex[3],pLow)style(dottedline,2)coloured(120,255,120) drawtext("Sweep",barindex+1,plow-0.25*tr)coloured(120,255,120) elsif bearcond then bearSignalIndex = barindex drawsegment(pHighindex,pHigh,barindex[3],pHigh)style(dottedline,2)coloured(255,120,120) drawtext("Sweep",barindex+1,pHigh+0.25*tr)coloured(255,50,50) endif //Draw last Pivot High/Low line if islastbarupdate then if low > pHigh then x = barssince(low crosses over pHigh) drawsegment(pHighindex,pHigh,barindex-x,pHigh)style(line,2)coloured("red") elsif high < pLow then y = barssince(high crosses under pLow) drawsegment(pHighindex,pHigh,barindex-y,pLow)style(line,2)coloured("green") ELSE drawsegment(pHighindex,pHigh,barindex+10,pHigh)style(line,2)coloured("red") drawsegment(pLowindex,pLow,barindex+10,pLow)style(line,2)coloured("green") endif endif return |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Hello Ivan, thanks for this very nice and powerfull indicator. Could you have time to create a screener to catch as close as possible the “right” times to buy and to sell based on your indicator? (if it’s a good idea to do that)
Thanks in advance
Have a good day
Hi
We could find stocks with sweep on:
//PRC_Sweep Institucional
//version = 0
//28.02.24
//Iván González @ http://www.prorealcode.com
//Sharing ProRealTime knowledge
///////////////////////////////////////////////
/////////////inputs////////////////////////////
cooldownPeriod =10 //”Cooldown Period”
prd = 20
src1 = low
src2 = high
////////Calculations//////////////////////////
/////pivots low
if src1 > src1[prd] and lowest[prd](src1) > src1[prd] and src1[prd] < lowest[prd](src1)[prd+1] then
$prevpivotlowy[lastset($prevpivotlowy)+1] = $pivotlowy[max(lastset($pivotlowy),1)]
$prevpivotlowx[lastset($prevpivotlowx)+1] = $pivotlowx[max(lastset($pivotlowx),1)]
$pivotlowy[lastset($pivotlowy)+1] = src1[prd]
$pivotlowx[lastset($pivotlowx)+1] = barindex[prd]
z = z + 1
endif
/////pivots high
if src2 < src2[prd] and highest[prd](src2)<src2[prd] and src2[prd]>highest[prd](src2)[prd+1] then
$prevpivothighy[lastset($prevpivothighy)+1] = $pivothighy[max(lastset($pivothighy),1)]
$prevpivothighx[lastset($prevpivothighx)+1] = $pivothighx[max(lastset($pivothighx),1)]
$pivothighy[lastset($pivothighy)+1]=src2[prd]
$pivothighx[lastset($pivothighx)+1]=barindex[prd]
t=t+1
endif
////////////////////////////////////////////////////////
pLow = $pivotlowy[max(1,lastset($pivotlowy))]
pHigh = $pivothighy[max(1,lastset($pivothighy))]
lp = lowest[prd](low)
hp = highest[prd](high)
lowestclose = lowest[prd](close)
highestclose = highest[prd](close)
////////////////////////Sweep conditions///////////////////////////////////////////
bullishSFP = low < pLow and close > pLow and open > pLow and low = lp and lowestClose >= pLow
bearishSFP = high > pHigh and close < pHigh and open < pHigh and high = hp and highestClose <= pHigh
bullCond = bullishSFP[3] and (close > pLow) and (close[1] > pLow[1]) and (close[2] > pLow[2]) and barindex >= bullSignalIndex + cooldownPeriod
bearCond = bearishSFP[3] and (close < pHigh) and (close[1] < pHigh[1]) and (close[2] < pHigh[2]) and barindex >= bearSignalIndex + cooldownPeriod
//Draw sweep lines
if bullcond then
bullsignalindex = barindex
elsif bearcond then
bearSignalIndex = barindex
endif
screener[bullcond or bearcond]
Like the way you think Ivan … 🙂
Bonjour Ivan et merci pour ton partage, Est-il possible d’avoir ce code en ITF