orionanomaly
New member
Hello all! I know this is basic but I seem to be doing something wrong. I want to scan to find stocks with one average that is BELOW another average but close (so looking for BEFORE it might 'cross over'). Exclude those ABOVE.
I am spec. looking for when WMA10 <= 0.5% EMA 40 //So when the WMA is Less Than AND within 0.5% of the EMA. I can then find stocks that have one average below another but within 1% of each other.
I have this but can't figure out why it's not working (I am getting for example results that show a < b even though I have a > b! Any help would be SO appreciated!!
I am spec. looking for when WMA10 <= 0.5% EMA 40 //So when the WMA is Less Than AND within 0.5% of the EMA. I can then find stocks that have one average below another but within 1% of each other.
I have this but can't figure out why it's not working (I am getting for example results that show a < b even though I have a > b! Any help would be SO appreciated!!
Code:
#start code
def a = ExpAverage(close, 40);
def b = WMA(close, 10);
def percentValue = .005;
plot scan = a > b and absValue(a-b) is less than or equal to (a*percentValue);
#end code
Last edited: