Hello,
I would like to create a screener that shows me all the assets that have crossed over in the last x days the highest price occurred in the last y days and another one that shows me the opposite (assets that have crossed under in the last x days the minimum price occurred in the last y days).
Any suggestions? Thanks.
There you go:
screener #1
// prices having crossed over the Y-period HIGHEST price in the last X bars
Y = 100
X = 5
HH = highest[Y](high)
c1 = summation[X](close CROSSES OVER HH[1])
SCREENER[c1]
screener #2
// prices having crossed under the Y-period LOWEST price in the last X bars
Y = 100
X = 5
LL = lowest[Y](low)
c1 = summation[X](close CROSSES UNDER LL[1])
SCREENER[c1]
Thanks Roberto you are SUPER as always; the screener works exactly as i was expecting, but i would like to add a pinch of salt.
It is possible to create a screener that shows me all the assets that have crossed over in the last x days for the first time the highest price occurred in the last y days.
I’ll explain better: in photo 1 we can see an asset that crossed over the highest multiple times during the showed period of time.
In photo 2 we can see an asset that crossed over the highest for the first time during the showed period of time.
It is possible to filter just cases like photo 2?
Thanks.
Yes, bear in mind that ProScreener still has a 254-bar limit with IG (PRT extended it to 1024 a few months ago, instead).
There you go (not tested):
Screener #1
// prices having crossed over the Y-period HIGHEST price in the last X bars
// for the first time since Y periods ago
//
Y = 100
X = 5
HH = highest[Y](high)
c1 = summation[X](close CROSSES OVER HH[1])
c2 = (summation[Y - X](close CROSSES OVER HH[X + 1]) = 0)
SCREENER[c1 AND c2]
Screener # 2
// prices having crossed under the Y-period LOWEST price in the last X bars
// for the first time since Y periods ago
Y = 100
X = 5
LL = lowest[Y](low)
c1 = summation[X](close CROSSES UNDER LL[1])
c2 = (summation[Y - X](close CROSSES UNDER LL[X + 1]) = 0)
SCREENER[c1 AND c2]
Looks like it’s not working properly… i don’t even know if my idea is possible to realize 😀
It should scan 100 periods and check that a crossover occurred in the last 5 periods, but NOT in the previous 95 periods.
It should scan 100 periods and check that a crossover occurred in the last 5 periods, but NOT in the previous 95 periods.
That’s exactly what i would like to see.
But look at this example, seems there’s something not working.
Your example was returned or not?
It seems to be working fine for me.