Ema logic screener errors
Forums › ProRealTime English forum › ProScreener support › Ema logic screener errors
- This topic has 5 replies, 3 voices, and was last updated 1 year ago by Malibu1.
-
-
02/14/2023 at 1:15 AM #209642
Hi
I am trying to put together a screener that looks at several variables on a weekly timeframe.
1 I want to screen for when the close of the current bar crosses the ema 5.
2 I want to screen for when the ema 5 is rising. For when it is higher than the previous bars reading.
3 I want to only screen stocks that have greater than 78 bars of data.
My code:
1234567Timeframe(weekly)Condition1=Close CROSSES OVER Ema(5)condition2= ema(5)>[ema(5)1]condition3= Close[78]>0Timeframe(default)SCREENER[condition1 and condition2 and condition3](condition1 as"No")Condition 1 and 2 are showing faults but am not sure of the issues. Can anyone point me in the right direction?
02/14/2023 at 10:54 AM #209655You didn’t defined the EMA 5 periods in your code. To test the history, you should use BARINDEX which is the number of the bar:
12345678Timeframe(weekly)ema = exponentialaverage[5]Condition1=Close CROSSES OVER emacondition2= ema>ema[1]condition3= barindex>78Timeframe(default)SCREENER[condition1 and condition2 and condition3](condition1 as"No")02/15/2023 at 11:29 AM #20973302/22/2023 at 5:14 AM #210109Hi Nicolas,
I have programmed exactly as you wrote the code but it doesnt give me the results I want. I have rewritten the code several times, tried copy and pasting your exact code but the code doesnt give me the results that it should. I have also shut the software down and even rebooted the computer to see if that changed the results.
Most of the results actually show the opposite of what I am after.
To be specific, condition 1 is supposed to show the close of the weekly bar crossing over the ema 5. IS the word “over” not the correct term? Should it be something like “above”? Or does it need an addition to the code to say look at the price is increasing? Condition2 is supposed to show the ema getting larger as the weekly bar progresses but it seems to show the ema getting smaller in value.
I did a scan and it showed Metcash (MTS – Australian stock) stock as meeting the above. The current price is below the ema on the current(weekly) bar and is below the close of the previous bar. The ema is going down from the previous bar.
Can you see a reason why the results are giving a false reading? I am not sure what is going wrong.
02/22/2023 at 7:31 AM #21011102/23/2023 at 7:53 AM #210222Hi Js,
Thanks for the reply. I have set the time to a weekly setting on the chart and in the screener as well.
I have attached a couple of screenshots showing the code and the results that the screener gives. I have included a screen shot of Magellan (MFG). It doesn’t meet the requirements of the scanner but is on the list. Vicinity(VCX) and APA(APA) are some more that appear on the list but don’t meet the requirements.
Am I doing something wrong or have I got a setting that isn’t correct?
-
AuthorPosts
Find exclusive trading pro-tools on