MTF screener for Price action – issue
Forums › ProRealTime English forum › ProScreener support › MTF screener for Price action – issue
- This topic has 4 replies, 2 voices, and was last updated 4 years ago by
Abz.
Viewing 5 posts - 1 through 5 (of 5 total)
-
-
08/07/2020 at 9:36 AM #141040
Hello
made a MTF screener based on the price action indicator found here https://www.prorealcode.com/prorealtime-indicators/weighted-price-action/ however it dosent seems to give the correct screener results.
result can be 1 = uptrend on 1h timeframe however if i go to chart i can see it is acutally 2 = downtrend
thanks to @robertogozzi for making this template
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375// 1 = ↑// 2 = ↓// 9 = no signal on that TF//// 4 = 4-hour TF// H = 1-hour TF// 1 = 15-minute TF// 5 = 5-minute TF//TIMEFRAME(daily)p=20closeopen = 1highhigh = 1lowlow = 1closeinrange = 1Averages = 1lines = 1a = (close > open)b = (high > high[1])c = (low > low[1])d = ((close-low)/(high-low) > 0.5)e = (close < open)f = (high < high[1])g = (low < low[1])i = ((close-low)/(high-low) < 0.5)up = 0down = 0for j = 0 to p-1if closeopen thenif a[j] thenup = up + (p-j)endifif e[j] thendown = down + (p-j)endifendifif highhigh thenif b[j] thenup = up + (p-j)endifif f[j] thendown = down + (p-j)endifendifif lowlow thenif c[j] thenup = up + (p-j)endifif g[j] thendown = down + (p-j)endifendifif closeinrange thenif d[j] thenup = up + (p-j)endifif i[j] thendown = down + (p-j)endifendifnextupres = (up - min(up,down))downres = (down - min(up,down))upave = weightedaverage[p/2](upres)downave = weightedaverage[p/2](downres)if averages thenupave = upavedownave = downaveelseupave = undefineddownave = undefinedendifif lines thenupres2 = upresdownres2 = downreselseupres2 = undefineddownres2 = undefinedendif//return upres2 coloured(0,128,0) as "long", downres2 coloured(128,0,0) as "short", upave coloured(0,128,0) as "long average", downave coloured(128,0,0) as "short average"XSignal= 9000IF upres2 > downres2 and upave > downave THENXSignal = 1000ELSIF upres2 < downres2 and upave < downave THENXSignal = 2000ENDIFTIMEFRAME(4 hour)yp=20ycloseopen = 1yhighhigh = 1ylowlow = 1ycloseinrange = 1yAverages = 1ylines = 1ya = (close > open)yb = (high > high[1])yc = (low > low[1])yd = ((close-low)/(high-low) > 0.5)ye = (close < open)yf = (high < high[1])yg = (low < low[1])yi = ((close-low)/(high-low) < 0.5)yup = 0ydown = 0for yj = 0 to yp-1if ycloseopen thenif ya[yj] thenyup = yup + (yp-yj)endifif ye[yj] thenydown = ydown + (yp-j)endifendifif yhighhigh thenif yb[yj] thenyup = yup + (yp-yj)endifif yf[yj] thenydown = ydown + (yp-yj)endifendifif ylowlow thenif yc[yj] thenyup = yup + (yp-yj)endifif yg[yj] thenydown = ydown + (yp-yj)endifendifif ycloseinrange thenif yd[yj] thenyup = yup + (yp-yj)endifif yi[yj] thenydown = ydown + (yp-yj)endifendifnextyupres = (yup - min(yup,ydown))ydownres = (ydown - min(yup,ydown))yupave = weightedaverage[yp/2](yupres)ydownave = weightedaverage[yp/2](ydownres)if yaverages thenyupave = yupaveydownave = ydownaveelseyupave = undefinedydownave = undefinedendifif ylines thenyupres2 = yupresydownres2 = ydownreselseyupres2 = undefinedydownres2 = undefinedendifYSignal= 900IF yupres2 > ydownres2 and yupave > ydownave THENYSignal = 100ELSIF yupres2 < ydownres2 and yupave < ydownave THENYSignal = 200ENDIF//TIMEFRAME(1 hour)zp=20zcloseopen = 1zhighhigh = 1zlowlow = 1zcloseinrange = 1zAverages = 1zlines = 1za = (close > open)zb = (high > high[1])zc = (low > low[1])zd = ((close-low)/(high-low) > 0.5)ze = (close < open)zf = (high < high[1])zg = (low < low[1])zi = ((close-low)/(high-low) < 0.5)zup = 0zdown = 0for zj = 0 to zp-1if zcloseopen thenif za[zj] thenzup = zup + (zp-zj)endifif ze[zj] thenzdown = zdown + (zp-j)endifendifif zhighhigh thenif zb[zj] thenzup = zup + (zp-zj)endifif zf[zj] thenzdown = zdown + (zp-zj)endifendifif zlowlow thenif zc[zj] thenzup = zup + (zp-zj)endifif zg[zj] thenzdown = zdown + (zp-zj)endifendifif zcloseinrange thenif zd[zj] thenzup = zup + (zp-zj)endifif zi[zj] thenzdown = zdown + (zp-zj)endifendifnextzupres = (zup - min(zup,zdown))zdownres = (zdown - min(zup,zdown))zupave = weightedaverage[zp/2](zupres)zdownave = weightedaverage[zp/2](zdownres)if zaverages thenzupave = zupavezdownave = zdownaveelsezupave = undefinedzdownave = undefinedendifif zlines thenzupres2 = zupreszdownres2 = zdownreselsezupres2 = undefinedzdownres2 = undefinedendifZSignal= 90IF zupres2 > zdownres2 and zupave > zdownave THENZSignal = 10ELSIF zupres2 < zdownres2 and zupave < zdownave THENZSignal = 20ENDIF//TIMEFRAME(15 minute)wp=20wcloseopen = 1whighhigh = 1wlowlow = 1wcloseinrange = 1wAverages = 1wlines = 1wa = (close > open)wb = (high > high[1])wc = (low > low[1])wd = ((close-low)/(high-low) > 0.5)we = (close < open)wf = (high < high[1])wg = (low < low[1])wi = ((close-low)/(high-low) < 0.5)wup = 0wdown = 0for wj = 0 to wp-1if wcloseopen thenif wa[wj] thenwup = wup + (wp-wj)endifif we[wj] thenwdown = wdown + (wp-j)endifendifif whighhigh thenif wb[wj] thenwup = wup + (wp-wj)endifif wf[wj] thenwdown = wdown + (wp-wj)endifendifif wlowlow thenif wc[wj] thenwup = wup + (wp-wj)endifif wg[wj] thenwdown = wdown + (wp-wj)endifendifif wcloseinrange thenif wd[wj] thenwup = wup + (wp-wj)endifif wi[wj] thenwdown = wdown + (wp-wj)endifendifnextwupres = (wup - min(wup,wdown))wdownres = (wdown - min(wup,wdown))wupave = weightedaverage[wp/2](wupres)wdownave = weightedaverage[wp/2](wdownres)if waverages thenwupave = wupavewdownave = wdownaveelsewupave = undefinedwdownave = undefinedendifif wlines thenwupres2 = wupreswdownres2 = wdownreselsewupres2 = undefinedwdownres2 = undefinedendifwSignal= 9IF wupres2 > wdownres2 and wupave > wdownave THENwSignal = 1ELSIF wupres2 < wdownres2 and wupave < wdownave THENwSignal = 2ENDIF//TIMEFRAME(default)Signal = XSignal + YSignal + ZSignal + WSignalIF Signal = 9999 THENSignal = 0ENDIFSCREENER[Signal](Signal AS "1=↑,2=↓/D4H5")08/07/2020 at 10:14 AM #141048Line 129 should read:
1ydown = ydown + (yp-yj)The same for lines 219 and 309 with a different letter prior to j.
1 user thanked author for this post.
08/07/2020 at 10:22 AM #14105008/07/2020 at 10:58 AM #14105608/07/2020 at 11:01 AM #141057 -
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)