Hello Pro-coders
Really hope someone can help me with this simple request.
I require proscreener to provide MACD divergence results over the last 10 days.
Is there a way to do this?
Kind Regards
Alps
Here you have an indicator I did long time ago to find MACD divergences. The variables:
- N: Number of bars the indicator lookback to find the divergences
- a: Periods for the first average to calculate MACD line
- b: Periods for the second average to calculate MACD line
You can create a Proscreener with it but I cannot help you there because I don´t do Proscreeners.
Good luck mate
Thank you Tempus,
That file.. which application am I using to open it. It does not open in word or notepad.
thanks
Alps
ITF file can only be imported and opened within the platform. Read this simple how-to tutorial to do it: How to import and export codes from ProRealTime platform?
Thanks for the effort Tempus. Really appreciate you trying to help me.
I am a zero case when it comes to programming or computing so I just don’t know how to make use of the great information you provided.
So if Nicolas or anyone else can provide a solution to the following I will be forever grateful. I work 14 hr. days so I can only look at charts and study fundamentals over the weekend.
So help required is for the following:
- MACD (12,26,9) divergence – bullish and bearish and hidden
- within the last 20 days
To share my strategy it is as follows: Divergence moves happen to be big. So if it is a bullish divergence and the fundamentals are good ie profits are up or less debt etc. etc.. then I will buy that stock.
The purpose of the screener is to identify stocks that have MACD divergence and then study the fundamentals over the weekend and place the trade
SIMPLE STRATEGY and I like that.
If you have successfully imported the MACD divergence indicator that TempusFugit has nicely shared with us, copy/paste the below screener code into a new ProScreener and you’ll get the last 20 days divergences:
ignored, divergence = CALL "0Divergencias MACD"[20, 12, 26]
screener[divergence<>0](divergence)
Some progress in the sense that:
- I have been able to upload the code kindly provided by Tempus on proscreener
- I have been able to add the 2 lines Nicolas has kindly provided.
However when I run the code I get an error which I have attached.
It says:
Syntax error: line45, character 1
Characters Missing. Suggestions:
-“eof”
The code is as follows:
/// Detector de divergencias
///Por jose7674
///La variable N es el numero de barras hacia atras que utilizamos para encontrar una divergencia
///MACD 5-131
miMACD = exponentialAverage[a](close) – exponentialAverage[b](close)
cero = 0
////Comenzamos el detector
IF (BarIndex > 10+1+N) THEN
IF (miMACD[1]>miMACD AND miMACD[1]>miMACD[2]) THEN
extremum2=miMACD[1]
extremum1=highest[N](miMACD)
preciomax2=close[1]
preciomax=Highest[N](close)
ENDIF
IF (miMACD[1]<miMACD AND miMACD[1]<miMACD[2]) THEN
extremum22=miMACD[1]
extremum11=lowest[N](miMACD)
preciomin2=close[1]
preciomin=lowest[N](close)
ENDIF
REM aseguramos que el maximo actual es inferior al maximo de las N barras previas
IF(extremum2<extremum1 AND preciomax2>preciomax[1]) THEN
signal = -1
ELSE
signal = 0
ENDIF
IF(extremum22>extremum11 AND preciomin2<preciomin[1]) THEN
signal = 1
ENDIF
ENDIF
Return cero as “0”, signal as “Divergencia”
ignored, divergence = CALL “0Divergencias MACD”[20, 12, 26]
screener[divergence<>0](divergence)
With deep gratitude looking forward to further assistance from you kind sirs.
> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<
🙂
Comment out line 44, RETURN must always be the last line. Moreover screeners don’t support it.
I think you should delete all but the last two lines, since when CALLing an indicator you don’t need to embed its code.
Nicolas’code is a working screener by itself, not lines to be appended to the indicator.