Screener for weekly and daily timeframes
Forums › ProRealTime English forum › ProScreener support › Screener for weekly and daily timeframes
- This topic has 12 replies, 4 voices, and was last updated 5 years ago by CluelessNobel.
Tagged: SUMMATION
-
-
06/01/2019 at 2:32 PM #99790
Hello everyone,
I am very new to coding, so I’m just trying to learn and make myself a somewhat useful screener. As I don’t understand why the results I get don’t meet all my conditions, I would very much appreciate if someone could point out what I’m doing wrong.
The idea was to have 2 conditions for each timeframe, and the results need to meet all 4 conditions.
Condition 1 (weekly): The fast EMA needs to have crossed over the slow EMA (ideally it would have occured recently but I haven’t figured out how to do that)
Condition 2 (weekly): Bars must have been tracing higher lows for the past X weeks
Condition 3 (daily): The close is currently below a X day EMA
Condition 4 (daily): Volume has been rising for the past X days
Weekly and Daily Screener123456789101112131415161718EMA13 = ExponentialAverage[13](Close)EMA26 = ExponentialAverage[26](Close)WeeklyLookback = 4DailyLookback = 5EMA22 = ExponentialAverage[22](Close)TIMEFRAME (Weekly)C1 = EMA13 > EMA26C2 = summation[WeeklyLookback](Low > Low[1])TIMEFRAME (Daily)C3 = Close < EMA22C4 = Summation[DailyLookback](Volume > Volume [1])SCREENER[C1 And C2 And C3 And C4]Any advice would be greatly appreciated, thanks a lot!
06/01/2019 at 4:18 PM #9979206/01/2019 at 4:34 PM #9979306/01/2019 at 5:11 PM #99794Lines 1-5 are evaluated according to your default TF, so lines 9 and 14 will be set weekly and daily but are not evaluating a daily nor weekly EMA.
06/01/2019 at 6:18 PM #99795Lines 1-5 are evaluated according to your default TF, so lines 9 and 14 will be set weekly and daily but are not evaluating a daily nor weekly EMA.
I did spot that one but I was waiting for CluelessNobel to reply that it still didn’t work before passing on the final clue! Saturday is a slow day on the forums and I was trying to get as many posts as possible! I didn’t want to hand the fish straight over before the OP had done a little fishing!
06/02/2019 at 4:29 PM #99823Thank you so much for taking the time to reply. I wish I could have gotten back to this sooner but internet is currently down at my place, which means I’m operating on lousy 3G…
After reading that my summation condition isn’t compared to anything, I think I don’t fully understand how it’s meant to be used. When writing:
1C2 = summation[WeeklyLookback](Low > Low[1])I thought I was already saying: the current low needs to have been above the previous one for the past X number of weeks. Obviously that’s wrong, but when I look at your correction, I don’t understand why I must use my “WeeklyLookback” variable twice. Could you “translate” it for me?
06/02/2019 at 4:34 PM #998241c1 = (summation[WeeklyLookback](EMA13 crosses over EMA26) > 0) and (EMA13 > EMA26)Do I understand this correctly? => Over the past X number of weeks, the fast EMA has crossed the slow EMA more than 0 times, AND the fast EMA is above the slow EMA?
06/02/2019 at 4:42 PM #99826Sorry, I posted something wrong.
06/02/2019 at 4:43 PM #99827Hi Roberto, thank you very much for replying,
I think I see what you’re trying to tell me but I need to ask you follow up questions.
Do you mean that when I’m setting variables, I must set them according to a specific timeframe? If that’s the case it’s confusing to me because I thought I was already giving the appropriate instructions by just specifying the timeframe, and then writing the conditions. Ie: in this timeframe, look for these conditions.
06/02/2019 at 5:02 PM #9982812345678TIMEFRAME (Weekly)EMA13 = ExponentialAverage[13](Close)EMA26 = ExponentialAverage[26](Close)C1 = EMA13 > EMA26TIMEFRAME (Daily)EMA22 = ExponentialAverage[22](Close)C3 = Close < EMA22That is your correct use of your conditions.
If you define an MA in a TF you can access it wherever you want to, but it will refer to the TF where the MA has been defined.
If you need to check the same MA in different TF’s, then you have to define the MA in each TF using different variable names.
1 user thanked author for this post.
06/02/2019 at 5:19 PM #99829SUMMATION will count how many times a condition is met in x candles. So if you check four candles and condition EMA1 < EMA2 = 4 then it is true that EMA1 has been less than EMA2 for at least four candles. If the SUMMATION result is less than the total look back period of x then the condition is false and EMA1 has not been less than EMA2 for the last x candles.
1c1 = (summation[WeeklyLookback](EMA13 crosses over EMA26) > 0) and (EMA13 > EMA26)Do I understand this correctly? => Over the past X number of weeks, the fast EMA has crossed the slow EMA more than 0 times, AND the fast EMA is above the slow EMA?
Yes that is exactly correct. There has been at least one cross over in the last x weeks and the fast EMA is currently still above the slow EMA so it cannot have crossed back under.
1 user thanked author for this post.
06/03/2019 at 8:18 AM #99851With the SUMMATION instruction, you simply make a sum of all boolean conditions that were true (so equal to 1) in the last X periods. So if the summation is superior to 0, one of the X previous condition was true.
1 user thanked author for this post.
06/03/2019 at 10:45 AM #99860OK got it this time.
Thank you all very much, that was really helpful.
-
AuthorPosts
Find exclusive trading pro-tools on