MaryParticipant
Average
How do you write a screener where you want Demarker Indicator period 3 to cross over Exponential Moving Average period 3 ?
Thank you in advance.
JSParticipant
Veteran
Hi @Mary
DeMarker is an indicator with a ratio between 0 and 100 (equal to the RSI).
EMA is an indicator with a value based on price.
So, you can’t compare the two… (DeMarker can’t cross over an EMA)
Or do I misunderstand your question?
MaryParticipant
Average
So I have this Demarker Indicator on my chart (please see code below) and I added an Exponential Moving Average period (3) to it so it crosses over( see pic below). I just don’t know how to write a screener for it.
//DeMarker Indicator
period=3
up=max(0,high-high[1])
down=max(0,low[1]-low)
ratio=100*average[period](up)/(average[period](up)+average[period](down))
return ratio as “DeMarker”,20,80
JSParticipant
Veteran
Hi @Mary
Okay, I understand now…
The screener can look like this…
//DeMarker + EMA Screener
period=3
up=max(0,high-high[1])
down=max(0,low[1]-low)
ratio=100*average[period](up)/(average[period](up)+average[period](down))
xEMA = ExponentialAverage[period](Ratio)
If ratio Crosses Over xEMA then
Signal = 1
Else
Signal = 2
EndIf
SCREENER[Signal](Signal AS "1=long, 2=short")