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.
Hello to Everyone,
Is there a StockCharts scan syntax that pinpoints stocks where an indicator line has just crossed over its' signal line such as at the moment when the +DI line crosses over the -DI line or at the moment when an EMA(9) crosses over the EMA(15) line? Of course, I have used the "x" crossover but the crossovers have already occurred two to three days before.
I have searched on StockCharts with no results. Any suggestions are greatly appreciated!
Best,
John Train
0
Comments
Of course, both bars are moving - changing value - so that may create the appearance of more bars having gone by.
If you haven't done so already, try using the inspect bar to line up the indicator values with the price bars. Or, use the start/end end feature for the chart's duration and advance it day by day to see exactly when the crossover occurs.
If none of those solve the problem, make sure you are running the scan as of today, and not a past date. If you run the scan for a past date, you still get the chart as of today, not the past date- e.g. if you ran the scan for the crossover as of two days ago, it will be three days ago on the chart that gets displayed.
None of the above provided any stock chart at the moment where, for example, the ema(9) just crosses the ema(15) or at the moment when the +DI line crosses the -DI line. Am I correct to conclude there is no syntax available to produce exact moment indicator crossover's?
John Train
When I use a stock chart with a daily time period and a 6 month range, the x shows the ema(9) crossover of the ema(15) as just occurring but when I use the 60 minute period with a 1 month range, the ema(9) crossover of the ema(15) displays the crossover happening earlier in the day or days before. Why does the x syntax appear to work with the daily time period and 6 month range and not the shorter 60 minute period and 1 month range? Is there syntax to compensate for this difference in scan result?
John Train
Basically, I said, the scan engine compares closing data. On a chart, that data would be represented by dots coincident with the bar in question. For instance, on the current bar ema 9 might 9.75. On the previous bar let's say it was 9.25.
If instead of using dots on the chart you use lines. the lines would connect the dots. The lines make it look like the ema had a series of continuous values between 9.25 and 9.75. But it didn't. The line just makes it look that way.
Same for the ema 15. In reality, there are only two dots, one for current bar, one for the previous bar. When you draw a line between them it represents "theoretical" values, not real values. So the "moment" of the crossover, represented on the chart by the intersection of two lines, never actually occurred, it is theoretical, too.
Further, I said, if you run the scan over and over again during the day, you might see the lines cross, but the scan engine considers the last intraday (mid-session) update as the closing value, even though its not. The crossover could go away by the end of the day if the values change before the actual close.
You cannot plot the daily ema crossover on an hourly chart reliably. The data sampling for the calculations is different, so the results will be different.
The EMA on a 60 minute chart is based on the 60 minute closes. So 9 60 minute periods would make up the EMA9. You can only scan on Daily, Weekly or Monthly so the 60 minute 9 x 15 EMA isn't available for scanning at the moment. It may at some point in the future, but not now.
So, your original question should have been how to scan for the 9 hour EMA x the 15 hour EMA?
How to "get around it" would be to try and convert your needs to the available options. 9 hours is a little less than 2 trading days. 15 hours is a little more than 2 trading days. EMA2 x EMA3 ? Or EMA1 (which is the current price) x EMA2 or EMA3? There's no such thing as a EMA1.3 or a EMA2.5 at the moment.
Assuming you mean cross above, you would test that the first value (sma or indicator doing the crossing) is less than the second value (the one to be crossed), and then test that that the first value is greater than some per cent of the second value, e.g. first value less than second value, and first value greater than .98 * second value.
Any other thoughts are appreciated!!
Mark, what is your suggested syntax for your first value less than the second and first value greater than a percent of the second value using EMA's ?
Pick a scan, run it, and on the results page click "Edit Scan Criteria" at the top.
Copy the scan to the scan workbench page and change it around as needed.
For instance, here is 50/200 crossover (w/o volume conditions)
AND [Daily SMA(50,Daily Close) > Daily SMA(200,Daily Close)] AND [Yesterday's Daily SMA(50,Daily Close) <= Yesterday's Daily SMA(200,Daily Close)]
You can edit that to your near crossover like so:
AND [Daily SMA(50,Daily Close) <b class="Bold">> Daily SMA(200,Daily Close)]
AND [Yesterday's Daily SMA(50,Daily Close) >= .98 * Yesterday's Daily SMA(200,Daily Close)]
Now if you run that against the sp500 ( [group is sp500] ) you notice that you get some hits where the short MA has just crossed BELOW the long MA, which is not what you want, but fits the scan criteria.
If you want to eliminate those, you need to add that the shorter MA is rising, not falling.
and [sma(50,close) > 10 days ago sma(50,close)
Note the copied code is "verbose", meaning it includes the default terms, like "Daily", whereas my code does not. If no timeframe is specified, the scan engine assumes you mean "Daily", so you don't have to write it yourself.
Based on the suggestion of lmkwin above, what would be the best settings to use with the PPO line, PPO signal line and the ADX indicator with the +DI and -DI lines to simulate an hourly period over a month timeframe?
You need to convert the Hourly time frame of your indicators to Daily periods to attempt to get close to something you like. What is the Hourly Period that you want to use for the indicator? You would attempt to convert that to daily. How many Hours is your hourly ADX? If it's ADX14, 14 hours is a little more than 2 days, so you use ADX 2 or ADX 3
PPO 12,26,9
12 hours is a little less than 2 days. 26 hours is approximately 4 days and 9 hours is a day and a half.
What I would suggest doing is set up the indicators as you like them on your hourly chart. Then open a new daily chart. Look at where your indicators are crossing or doing whatever you are looking for on the hourly chart. Note those areas. Then on the daily chart add the same indicator and play around with the parameters used to see if you can 'replicate' to some extent the crossing or whatever you are looking for to get an idea as to what the daily parameters might be.
That is going to be your best chance of trying to do what the scan engine is designed to do. It scans on Daily, Weekly or Monthly time frames.
You could also try using different time frame indicators to refine the timing of your entries. For instance, if you get an upside MA crossover on the daily, you could refine your entry by choosing the next upside signal on the same or different indicator from an hourly chart.