Divergences MACD Screener
Forums › ProRealTime foro Español › Soporte ProScreener › Divergences MACD Screener
- This topic has 8 replies, 6 voices, and was last updated 1 year ago by lee.
-
-
11/02/2020 at 9:54 AM #149256
Buenos dias, me gustaria saber como transformar este indicador en un proscreener.
saludos.
https://www.prorealcode.com/prorealtime-indicators/macd- divergences-on-price-and- indicator/ 12/22/2020 at 4:16 AM #154818Ahí tienes:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253///////////////////////////////////////////////////////////// MACD divergences on price//by Jose Callao// twitter @jose7674// attach this indicator to the chartN=40///N is the number of bars to look back for a divergence. Normal values are 20-40. Must be the same in both indicators//using any other indicator is as easy as changing the valuesmiMACD = exponentialAverage[12](close) - exponentialAverage[26](close)Signal = 0IF (BarIndex > 10+1+N) THEN//we look for bearish divergencesIF (miMACD[1]>miMACD AND miMACD[1]>miMACD[2]) THENextremum2=miMACD[1]extremum1=highest[N](miMACD)preciomax2=close[1]preciomax=Highest[N](close)IF(extremum2<extremum1 AND preciomax2>preciomax[1]) THENfor i=1 to Nif close[i]=preciomax[1] then//zz=iSignal = 2//drawsegment (barindex[1], close[1], barindex[zz], close[zz]) coloured(200,0,0)endifnextendifendif//we look for bullish divergencesIF (miMACD[1]<miMACD AND miMACD[1]<miMACD[2]) THENextremum22=miMACD[1]extremum11=lowest[N](miMACD)preciomin2=close[1]preciomin=lowest[N](close)IF(extremum22>extremum11 AND preciomin2<preciomin[1]) THENfor i2=1 to Nif close[i2]=preciomin[1] then//zz2=i2Signal = 1//drawsegment(barindex[1], close[1], barindex[zz2], close[zz2]) coloured(0,200,0)endifnextendifendifendifSCREENER[Signal](Signal AS "1=↑, 2=↓")12/22/2020 at 10:02 AM #154859Buenos dias, el código al parecer no esta completo.
En la linea 33 falta un operador igual mayor o menor : IF (miMACD[1] extremum22=miMACD[1]….
En la linea 38 también falta algún operador para la variable preciomin2: IF(extremum22>extremum11 AND preciomin2 for i2=1 to N
En la linea 45 la función next muestra error derivados de los errores anteriores.
saludos,
12/22/2020 at 10:13 AM #154862El problema es causado por la palabra REM, que significa comentar, reemplazarlo con RME o lo que sea, incluso si no está al principio.
12/22/2020 at 11:25 AM #15487810/25/2021 at 9:34 AM #18029710/25/2021 at 10:17 AM #180301Sí, puede dejar el nombre de la variable como está, solo cambie el indicador:
1miMACD = RSI[14](close)Puedes crear otro con el Momentum, o con Willims R%, etc.
05/22/2023 at 2:30 PM #215017Según lo solicitado, aquí está el código que combina este filtro: https://www.prorealcode.com/prorealtime-market-screeners/evening-morning-stars-screener/ con el código de divergencias publicado anteriormente:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101//Author: Boursomaniac//Date: 19-02-2017// Data Set-upBaseCandle = 0Open0 = Open[BaseCandle]Close0 = Close[BaseCandle]Open1 = Open[BaseCandle + 1]Close1 = Close[BaseCandle + 1]Open2 = Open[BaseCandle + 2]Close2 = Close[BaseCandle + 2]Open3 = Open[BaseCandle + 3]Close3 = Close[BaseCandle + 3]// Control heightDojiBody = ABS(Close1-Open1)HeightLong = 7*DojiBody// ++++++++++EVENING STAR++++++++++++// Calcul height candelstick 2 and 2CandleElong0 = ABS(Close0-Open0)CandleElong2 = ABS(Close0-Open0)// Validate Candlestick color + positionCandleE0 = Open0 > Close0 And Open0 < Close1 AND (CandleElong0>=HeightLong)CandleE1 = Open1>Open0 AND Close1>Close0 AND Close1>Close2 AND Open1>Open2CandleE2 = Open2 < Close2 And Close2 > Close3 And Open3 < Close3 AND (CandleElong2>=HeightLong)EvStar = CandleE0 AND CandleE1 AND CandleE2// ++++++++++MORNING STAR++++++++++++// Calcul height candelstick 2 and 2CandleMlong0 = ABS(Close0-Open0)CandleMlong2 = ABS(Close0-Open0)// Validate Candlestick color + positionCandleM0 = Open0 < Close0 And Open0 > Close1 AND (CandleMlong0>=HeightLong)CandleM1 = Open1<Open0 AND Close1<Close0 AND Open1<Open2 AND Close1<Close2CandleM2 = Open2 > Close2 And Close2 < Close3 And Open3 > Close3 AND (CandleMlong2>=HeightLong)//Morning StarMornStar = CandleM0 AND CandleM1 AND CandleM2Condition = (EvStar Or MornStar)///////////////////////////////////////////////////////////// MACD divergences on price//by Jose Callao// twitter @jose7674// attach this indicator to the chartN=40///N is the number of bars to look back for a divergence. Normal values are 20-40. Must be the same in both indicators//using any other indicator is as easy as changing the valuesmiMACD = exponentialAverage[12](close) - exponentialAverage[26](close)Signal = 0IF (BarIndex > 10+1+N) THEN//we look for bearish divergencesIF (miMACD[1]>miMACD AND miMACD[1]>miMACD[2]) THENextremum2=miMACD[1]extremum1=highest[N](miMACD)preciomax2=close[1]preciomax=Highest[N](close)IF(extremum2<extremum1 AND preciomax2>preciomax[1]) THENfor i=1 to Nif close[i]=preciomax[1] then//zz=iSignal = 2//drawsegment (barindex[1], close[1], barindex[zz], close[zz]) coloured(200,0,0)endifnextendifendif//we look for bullish divergencesIF (miMACD[1]<miMACD AND miMACD[1]<miMACD[2]) THENextremum22=miMACD[1]extremum11=lowest[N](miMACD)preciomin2=close[1]preciomin=lowest[N](close)IF(extremum22>extremum11 AND preciomin2<preciomin[1]) THENfor i2=1 to Nif close[i2]=preciomin[1] then//zz2=i2Signal = 1//drawsegment(barindex[1], close[1], barindex[zz2], close[zz2]) coloured(0,200,0)endifnextendifendifendifSCREENER[Condition and signal] (Signal AS "1=↑, 2=↓")1 user thanked author for this post.
05/22/2023 at 3:04 PM #215021 -
AuthorPosts
Find exclusive trading pro-tools on