How To Have Multi Timeframes In 1 Scan?
Forums › ProRealTime English forum › ProScreener support › How To Have Multi Timeframes In 1 Scan?
- This topic has 16 replies, 4 voices, and was last updated 6 years ago by robertogozzi.
-
-
12/23/2017 at 7:18 PM #5645212/23/2017 at 7:59 PM #56456
This is the code I’m trying to use to display a daily,4hr, 60m and 15m all in one scan but I get errors
indicator1 = Average[1](Stochastic[3,1](close))
c1 = (indicator1 < 28)indicator2 = MACDline[12,26,8](close)
c2 = (indicator2 > 0)
TIMEFRAME(daily)
TIMEFRAME(480 minutes)
TIMEFRAME(60 minutes)
TIMEFRAME(15 minutes)SCREENER[c1 AND c2] (Variation AS “%Chg prev bar”)
12/23/2017 at 10:18 PM #56461To write code, please use the <> “insert PRT code” button. Thank you.
1234567891011indicator1 = Average[1](Stochastic[3,1](close))c1 = (indicator1 < 28)indicator2 = MACDline[12,26,8](close)c2 = (indicator2 > 0)TIMEFRAME(daily)TIMEFRAME(480 minutes)TIMEFRAME(60 minutes)TIMEFRAME(15 minutes)SCREENER[c1 AND c2] (Variation AS “%Chg prev bar”)The output will be more readable.
Roberto
12/23/2017 at 10:35 PM #56463If you want to display a scan ONLY when all conditions are met in all timeframes you will have to write
123456789101112131415161718192021222324252627TIMEFRAME(daily)indicator1 = Average[1](Stochastic[3,1](close))c1 = (indicator1 < 28)indicator2 = MACDline[12,26,8](close)c2 = (indicator2 > 0)TIMEFRAME(4 hours)indicator3 = Average[1](Stochastic[3,1](close))c3 = (indicator3 < 28)indicator4 = MACDline[12,26,8](close)c4 = (indicator4 > 0)TIMEFRAME(1 hour)indicator5 = Average[1](Stochastic[3,1](close))c5 = (indicator5 < 28)indicator6 = MACDline[12,26,8](close)c6 = (indicator6 > 0)TIMEFRAME(15 minutes)indicator7 = Average[1](Stochastic[3,1](close))c7 = (indicator7 < 28)indicator8 = MACDline[12,26,8](close)c8 = (indicator8 > 0)TIMEFRAME(default)SCREENER[c1 AND c2 and c3 and c4 and c5 and c6 and c7 and c8] (Variation AS "%Chg prev bar")1 user thanked author for this post.
12/23/2017 at 10:39 PM #5646412/24/2017 at 9:33 PM #56513Hi, thanks very much for this info. I added the formulas.
Is there a way to display what separate time frame has setup up and met my criteria?
At the moment there seems no way of telling if for example the criteria has happened on say a 15m timeframe or any other?
For example, is there a column on the proscreener that can be added to show what individual timeframe
Thanks again.
12/26/2017 at 1:53 PM #56556If you don’t want to compile conditions on all timeframes at the same time, why do you want to make a multitimeframe screener?
If you only need to get signals for each of the timeframe, just make 4 different screeners and let them run together at the same time, you’ll get 4 different signals this way.
12/26/2017 at 10:56 PM #56591Hi, so to explain a bit further. I don’t want for a scan to activate only if all of the time frames agree, as I don’t think I would ever get a signal.
Is it only possible to have 1 proscreener displaying at the same time? I don’t know how I would be able to have different screeners on display at the one time on my screen?
What I thought may be possible would be to have all my timeframes that set up for a buy on the screeners, that could display the timeframe such as 15min, 60min, 480m, Daily?
Or should I only just manually run each time frame screener? For example on 15m I would need to run the screener each 15m to see if there is indeed a setup?
Thanks again
12/27/2017 at 12:57 AM #56596This version will return:
- 24 when conditions are met on the Daily chart
- 4 when conditions are met on the 4-hour chart
- 1 when conditions are met on the 1-hour chart
- 15 when conditions are met on the 15-minute chart
In case conditions are met in more then one TF, it will return the sum of any of the above (19 will tell you the scan was successful in TFs 15 + 4).
12345678910111213141516171819202122232425262728293031323334TIMEFRAME(daily)indicator1 = Average[1](Stochastic[3,1](close))c1 = (indicator1 < 28)indicator2 = MACDline[12,26,8](close)c2 = (indicator2 > 0)TIMEFRAME(4 hours)indicator3 = Average[1](Stochastic[3,1](close))c3 = (indicator3 < 28)indicator4 = MACDline[12,26,8](close)c4 = (indicator4 > 0)TIMEFRAME(1 hour)indicator5 = Average[1](Stochastic[3,1](close))c5 = (indicator5 < 28)indicator6 = MACDline[12,26,8](close)c6 = (indicator6 > 0)TIMEFRAME(15 minutes)indicator7 = Average[1](Stochastic[3,1](close))c7 = (indicator7 < 28)indicator8 = MACDline[12,26,8](close)c8 = (indicator8 > 0)TIMEFRAME(default)x1 = ((c1 AND c2) * 24)x2 = ((c3 and c4) * 4)x3 = ((c5 and c6) * 1) //This multiplication is useless, it could have been x3 = (c5 and c6), since the result is either 0 or 1, I wrote it just for clarityx4 = ((c7 and c8) * 15)x = x1 + x2 + x3 + x4SCREENER[x] (x AS "TF")1 user thanked author for this post.
12/27/2017 at 1:13 AM #56597Another improvement could be to multiply all hour based TFs by 100
1234x1 = ((c1 AND c2) * 2400)x2 = ((c3 and c4) * 400)x3 = ((c5 and c6) * 100)x4 = ((c7 and c8) * 15)In this case a successful scan on the Daily chart would return 2400 (2500 if also on the 1-hour chart) and 2515 for Daily+1-hour+15 minutes.
01/16/2018 at 3:11 AM #59609Hi the scan criteria works great now thanks for all your help.
I still can’t get the “all in one” screener to work and display properly on the multiple timeframes though.
To explain further… I hope it make sense 🙂
To scan each separate time frame for my criteria.. Weekly, Daily, 4 Hr, 60 Min, 15 Min and 5 Min.
I need to scan my criteria the following timescales and the codes (so I can recognize from the screener window what timeframe has setup)… Weekly code (7) or (W), Daily (1) or (D), 4 Hourly (480), 60 Mins ( 60) 15Mins ( 15) and 5 min (5)
Also can the display code also be added for buy and sell setups. For example -7 for sell +7 for buy code?
Many thanks in advance
01/16/2018 at 10:53 AM #59629As from my post on 12/27/2017 at 12:57 AM, the addition gives you detailed info about the TFs, despite not telling from Bullish and Bearish data.
To accomplist that we would need a STRING (alphanumeric variable), but we can work it around using a number. Say you need to scan 7 TFs, we can arrange a number starting with 9 (to avoid losing leading 0’s) 90000000 followed by seven 0’s. We can replace them with 1’s if bullish and 2 if bearish.
Say we want Weekly Daily 4h 1h 15m 5m
we can set 9 0 0 0 0 0 0 initially
then it may become 9 1 1 1 2 2 1 where 1=bullish 2=bearish
You’ll see on the screener box 9111221, that’s the best I can think of. If you agree, I’ll write that.
01/16/2018 at 9:19 PM #59679Hi Roberto, I really appreciate your help on this.
I think to make it more simple better to just go for 4 timeframes….The Weekly, Daily, 4 Hourly and 1 Hour.
I know another company uses codes (7) for 7 days. (1) ( for daily) ( 240) for 4 hours and (60) for 1 hour and they just add a (-) minus to identify any sell signals.
If you can copy that formula it would be great, however, if you prefer another way just do that and I will use your codes.
Regarding the previous codes, I tried to add this into the screener but I got syntax errors.
If you can let me know to copy and paste the exact and full codes please once you have the timeframe formula?
Many thanks again.
01/17/2018 at 10:40 AM #59697nealhart, I understand perfectly what you mean, BUT Screener can only return ONE number, so if multiple conditions are met in different TFs, each number will override the previous one. If you need just one value at each scan just tell me your priority (1 = most important), in the example below the Weekly TF will override all the others if conditions are met:
- weekly (will return 7 or -7)
- daily (will return 1 or -1)
- 4 hours (will return 240 or -240)
- 1 hour (will return 60 or -60)
Also, to be able to set negative values you should tell me what is the SELL condition.
01/18/2018 at 7:25 PM #59834 -
AuthorPosts
Find exclusive trading pro-tools on