Multi TF screener query
Forums › ProRealTime English forum › ProScreener support › Multi TF screener query
- This topic has 6 replies, 2 voices, and was last updated 4 years ago by robdav.
Tagged: mtf, multi time frame, multiple time frame
-
-
03/04/2020 at 4:24 PM #121153
Hi
I’m tackling my first attempt at a multi timeframe screener but I’m trying to get my head around the logic.
If I want to test a condition on an hour chart and also on a 30 min chart as an example. Then I presumably I write the code for each timeframe but it’s where I test the conditions on that I’m not sure about?
Using the example below, let’s say I only want to know if it’s happened on both timeframes but appreciate it might happen a few candles earlier or later on one timeframe than the other. Where do I test this condition and on what screener period?
Thanks, as always, Rob
multi tf screener123456789101112131415161718192021222324252627//ONEHOURCROSS = 0Signal = 0EMA21 = ExponentialAverage[21](close)EMA34 = ExponentialAverage[34](close)IF EMA21 CROSSES OVER EMA34 THENSignal = 60ENDIFTIMEFRAME(30 minutes)Signal = 0//THIRTYMINCROSS = 0EMA13 = ExponentialAverage[13](close)EMA21 = ExponentialAverage[21](close)IF EMA13 CROSSES OVER EMA21 THENSignal = 30ENDIFTIMEFRAME(Default)SCREENER [(Signal)] (signal)03/04/2020 at 4:32 PM #121157The TIMEFRAME(1 hour) keyword is missing.
I think it should be placed at line 2.
You should then move line 3, lines 8-10 and lines 21-23 to line 26.
Remove line 14.
03/04/2020 at 4:41 PM #121158The TIMEFRAME(1 hour) keyword is missing.
I think it should be placed at line 2.
You should then move line 3, lines 8-10 and lines 21-23 to line 26.
Remove line 14.
1234567891011121314151617181920212223TIMEFRAME(1 hour)EMA211hour = ExponentialAverage[21](close)EMA3411hour = ExponentialAverage[34](close)TIMEFRAME(30 minutes)EMA1330mins = ExponentialAverage[13](close)EMA2130mins = ExponentialAverage[21](close)TIMEFRAME(Default)Signal = 0IF EMA211hour CROSSES OVER EMA3411hour THENSignal = 60ENDIFIF EMA1330mins CROSSES OVER EMA2130mins THENSignal = 30ENDIFSCREENER [(Signal)] (signal)Thanks Roberto, so more like this?
But how would I catch the condition happening on one timeframe AND the other but perhaps within five bars of each other?
03/04/2020 at 4:51 PM #121160Try this:
1234567891011121314151617181920212223TIMEFRAME(1 hour)EMA211hour = ExponentialAverage[21](close)EMA3411hour = ExponentialAverage[34](close)TIMEFRAME(30 minutes)EMA1330mins = ExponentialAverage[13](close)EMA2130mins = ExponentialAverage[21](close)TIMEFRAME(Default)Signal = 0IF EMA211hour CROSSES OVER EMA3411hour THENSignal = 60ENDIFIF EMA1330mins CROSSES OVER EMA2130mins THENSignal = Signal + 30ENDIFSCREENER [Signal] (signal)this will return 30, 60 or 90 when both signals are returned.
What do you mean by 5 bars apart from each other? Which one should occur first?
1 user thanked author for this post.
03/04/2020 at 5:53 PM #121174Thanks again Roberto
As it stands at the moment, to get 90 i.e. when both signals are returned, does this mean they have to cross on the same candle? So, if the 30 min and 60 min candles both close at 3pm and the EMAs happened to cross in both the 30 min and 60 min candle then both signals would be returned?
If not, and say the EMAs crossed on the 30 min candle at 1.30pm then this would be outside of the 2pm-3pm 60 min candle. Very hypothetical example, I’m just trying to get my head round it.
Thanks.
03/04/2020 at 6:07 PM #121176Screeners work LIVE, they don’t care much when a candle closes.
So to return 90 both TF’s must have a crossover at the same time. To make sure the same signal is returned at closing time, then you should at[1] at line 15:
1IF EMA211hour[1] CROSSES OVER EMA3411hour[1] THENthe same for line 19.
With this change you will only consider the last candle closed, prior to the current one.
It’s slightly different than ProOrder, where strategies are always run at closing time, so the current candle is the last one closed. ProScreener scans markets LIVE, so the current candle is the one being formed [0] and the last one closed is [1].
1 user thanked author for this post.
03/04/2020 at 6:09 PM #121177 -
AuthorPosts
Find exclusive trading pro-tools on