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.
Plus DI and Minus DI crossover scan
Hi, I'm currently helping my grandad but I don't have the necessary coding skills just yet.
All he wants is a scan to alert him on the day when the Minus DI and Plus DI cross over. I tried [Plus DI(14) = Minus DI(14)] first (although [Plus DI(14) >= Minus DI(14)] works) and then a few of the True Range indicators from the stockcharts school but at this point it's all just a little confusing.
Any help or advice would be appreciated!
0
Answers
As a granddad myself, I found using the resources in the Help on StockCharts, in conjunction with the this forum, provided all the help I needed to get comfortable with the scan coding.
Also, a great way to "learn" how StockCharts does it is to go to the Predefined Scan page. Click on ANY of the Predefined Scans and in the upper right corner is a link that says Click here to edit this scan.
This will open that scan, in the workbench, so that you can see the actual code used for that scan. You can then modify that code and save it to your account for use as you see fit.
https://stockcharts.com/def/servlet/SC.scan
Could not parse "PLUSDI" located in the clause "PLUSDI(14) X MINUSDI(14)"
Not sure what this means... any help greatly appreciated.
Error messages are a "best guess", since the language writer cannot anticipate every possible error we users can make. So they throw the error at the point where the interpreter engine can't go on, not necessarily where the error actually is. In other words, given what comes before it, PLUSDI can't come next.
If you can't get it, post the whole line that's giving the error and maybe one of us can spot it.
and [country is US]
and [market cap > 5,000]
and [optionable is true]
and [ADX Line(10) > 20.0]
and [Close > 25]
and [PlusDI(10) X MinusDI(10)]
The error message occurs when I add the last line.
When you select the Plus DI from the TECHNICAL INDICATORS dropdown
it defaults into the workbench like this:
and [Plus DI(14) > Minus DI(14)]
Note the difference with your code for the last line. There is a space missing from yours, so the scan engine doesn't know what PlusDI(10) or MinusDI(10) is.
yeah, i noticed that space missing. In addition to the Dropdown menu, you can put a “ [ “ in the Editor, and it will often type in an example that will Pop-up, and then all you have to do is Edit it to your liking
i believe the Default is 14 and you are using 10 periods, I assume that was Intentional. One other thing that May help you, is to hit the “Check Code” button before running the Scan. It will often tell you which lines may contain errors, and sometimes will give helpful suggestions and even offer to fix it for you if it thinks it knows what you are trying to say. I used this Very often when I was Learning how to write these Codes.
Put them in front of the indicator or constant.
and [weekly close > 10]
and [weekly sma(20, weekly close) > 10]
and [weekly MACD Line(12,26,9) x weekly MACD Signal(12,26,9)]
Yes, if you don’t specify, it assumes daily
Minor note, I don’t believe you can scan ‘hourly’ at this time. Could be wrong I’m on my iPhone right now.