New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.
How to find stocks just before they Crossover (Moving Avg. or MACD)
I would like to build a scan that detects possible crossovers just before they occur or are getting close to crossing over.
Thanks!
0
Comments
and [sma(10,close) < sma(50, close)]
and [sma(10, close > sma(50, close) *.98]
You would have to mess around with the .98 to see what works - maybe it should be .99, maybe .95, or something else.
If you mean a price crossover, just substitute "close" for sma(10, close).
There is a sweet spot I like to monitor when the 4hr 12 EMA crosses over the 26 EMA. Finding it difficult to peg this crossover since its not a daily chart. Not sure if this is the right direction but I was trying to figure a way to find the 'Near cross on the daily that would suffice.
Attached above is the view of the 4hr period, where the 12 crosses over 26. Also attached is the daily period chart showing the area of interest. Trying to catch the 4hr 12EMA Crossover with the 26 EMA
Thanks!
BB311
and [sma(10,close) < sma(50, close)]
and [sma(10, close > sma(50, close) *.98]
Looks promising. Thank you!
You can check your results pretty easily by setting up custom GalleryView charts. Set your GalleryIntraday to 4 hour and 12/26 EMA's. Set your GalleryDaily to 1 day and 5/12. Might be easier to see if you use the MACD Histogram with the parameters of 12,26 and 5,12 on the respective charts.
For the "near cross" I suggest just shortening the shorter parameter. If the 4,12 has crossed the 5,12 should be close if not there yet, or not too far behind.
As you know, no scanning on intraday periods is supported at the moment.
When you run a scan, the results show with Icons that link to various chartstyles. The GalleryView is 4th from the left.
[ [exchange is NYSE] or [exchange is NASD] ]
and [RSI(14) > 50.0]
and [Volume > 999,999]
and [ema(12,close) < ema(26, close)]
and [ema(12, close) > ema(26, close) * .98]
and [ROC(6) > 0.0]
and [ROC(12) > 0.0]
and [MACD Hist(12,26,9) > 0.0]
rank by ROC(10)
I ran the scan using your suggestions 4/12 buy replacing
and [ema(12,close) < ema(26, close)]
and [ema(12, close) > ema(26, close) * .98]
with
and [ema(4,close) < ema(12, close)]
and [ema(4, close) > ema(12, close) * .98]
It thinned the scan results down from 26 to 4
I am new to this so forgive me for my ignorance. But what is the purpose of the "* .98" for the logic?
"[ema(12, close) > ema(26, close) * .98]"
"and [close x sma(20, close)]"
For a simple "greater than" - meaning price is above the sma today, whether for the first time or for any number bars, use ">"
and [close > sma(20, close)]
Your original question was how to find stocks where price (or sma) was "close" to a longer sma.
The scan engine doesn't understand "close" (meaning "near"). You have to be specific what you mean by "close" in terms the scan engine can understand.
So you could specify some absolute distance, like say 2 points:
and [close < sma(20, close)]
and [close > sma(20, close) -2]
For a 60 dollar stock or a 200 dollar stock that might really be close. But for a 5 or 10 dollar stock it could be pretty far away.
A way around using an absolute distance would be to use a "relative" distance - like a percentage. Percentages can be expressed as decimals - so 50% is .50, 73% is .73, 1.0 is 100%, 1.2 is 120%, etc. So, if price is 50% of the sma (say price is 30 and the sma is 60), you can express
that as "close = sma(20, close) * .5".
But you want price and sma close together - in other words, almost equal. In decimals, equal would be 1.0 or 100%. A little less than equal could be .99, .98, .97, etc.
Another question if I may.
What if I wanted to do the the exact opposite. of this...
//and [ema(12,close) < ema(26, close)]
//and [ema(12, close) > ema(26, close) * .98]
Where I wanted to see the 12ema about to cross below the 26 ema. I tried flipping the operators around but no luck... I'm missing something...
and [ema(12,close) > ema(26, close)]
and [ema(12, close) < ema(26, close) * .98]
Shout out to markd & lmkwin for the info!
and [ema(12, close) > ema(26, close) * .99]
I think this might work...