Forums › ProRealTime foro Español › Soporte ProScreener › Divergencias › Reply To: Divergencias
09/13/2025 at 12:21 PM
#250788
Hello,
The code you are using is designed for an indicator…
To convert it into a screener, you must remove all graphic elements and alert functions, and replace the RETURN
with SCREENER[…]
…
Try this…
RSI Divergences Screener
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 |
//-----------------------------------------------// //RSI Divergence Screener //Iván González @ www.prorealcode.com //Sharing ProRealTime knowledge //-----------------------------------------------// // inputs //-----------------------------------------------// src=(open+high+low+close)/4 x=5 z=25 revpct=0.01 //ialert=25 rsiprd=14 ob=70 os=30 //-----------------------------------------------// // RSI calculation //-----------------------------------------------// rv=rsi[rsiprd](src) //-----------------------------------------------// // Bullish Divergence //-----------------------------------------------// //--- Define lower low in price llvx=lowest[x](src) llvz=lowest[z](src) srcLL=src>llvx*(1+revpct) and llvx<llvz[x] //--- Define higher low in RSI llvrsix=lowest[x](rv) llvrsiz=lowest[z](rv) rsiHL=rv>llvrsix and llvrsix>llvrsiz[x] and llvrsix<os bullishDiv=srcLL and rsiHL if bullishDiv then count=1 else count=1+count endif //-----------------------------------------------// // Bearish Divergence //-----------------------------------------------// //--- define higher high in price hhvx=highest[x](src) hhvz=highest[z](src) srcHH=src<hhvx*(1-revpct) and hhvx>hhvz[x] //--- define lower high in rsi hhvrsix=highest[x](rv) hhvrsiz=highest[z](rv) rsiLH=rv<hhvrsix and hhvrsix<hhvrsiz[x] and hhvrsix>ob bearishDiv=srcHH and rsiLH if bearishDiv then countbear=1 else countbear=1+countbear endif Screener[(bullishdiv or bearishdiv) and Volume>1000000] |