Stocks close below 9 EMA past X days


Category:
0
0

I’d appreciate your help so much with this, if possible.

I’m trying to build a scan that populates stocks that have been closing below the 9 EMA for the past X number of days (bars) AND now have closed on/above the 9 EMA. If a stock has been closing below the 9-ema for a period of time and then closes above it, I’m interested.

Link to video that explains the concept. https://www.youtube.com/watch?v=N1fds583zPU

I’ve looked through most posts over the past year and can’t find anything, so I apologize in advance if you’ve already answered this and I missed it.

Thank you so much!

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on February 11, 2021 11:31 pm
114 views
0
Private answer

I believe this one should do the trick:

https://www.hahn-tech.com/ans/price-below-ema-for-specified-period-then-crossing-above/

The solution in that post includes user inputs so you can adjust the behavior to meet your stated goals:

input barsBelow = 10;
input barAbove = 1;
input maLengthOne = 9;

Marked as spam
Posted by (Questions: 37, Answers: 4084)
Answered on February 12, 2021 8:33 am
0
First off, thank you so much for a quick reply. You're the best. I had grabbed that one, thinking it was about right, so I'm glad I was on the right track. Unfortunately, it's grabbing the stocks at the top or near the top of the 9 EMA, instead of before, at the bottom.
( at February 12, 2021 9:15 am)
0
I do not understand "near the top of the 9 EMA". That is a single data point on the chart for each candle. There is no "top" or "bottom" when the value is singular for each bar on the chart. So you must be speaking of the candle, which has four data points Open, High, Low, Close. Seems you have not fully explained what you are trying to achieve.
( at February 12, 2021 12:24 pm)