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 write a syntax for this?
Hi I am new to this forum. I was using "open is more than 3% below high 1 day ago" on stockfetcher to scan certain stocks. Can anyone please help me convert this to a Syntax for Stockcharts? I tried a few times but did not get any good results. Thanks.
0
Comments
and [open < 1 day ago high * .97]
I'm guessing you just needed to think of "3% below yesterday's high" in a different way - as 97 per cent of yesterday's high, which is exactly the same thing.
But if you were having trouble with the scan language, here's a link to some good "example" scans that you can cut and paste from and/or edit:
stockcharts.com/school/doku.php?id=chart_school:scan_library
Also look at the resources for scanning under "Chart School". It's a bit of a slog to get through, but worth it if you plan to write more than a few scans.
May I ask one more question? How to write something for "average day range(2) 1 day ago is more than 20%".
I looked into the link you gave but couldn't find anything.
The way you wrote it is perfectly fine (well done!). Another variation (not better or worse) would be:
and [ range < 1 day ago sma(2,range)* .8 ]
The function sma( ) calculates a simple moving average (every item has equal weight in the average). It take two parameters, a number and an element to be averaged. So you can average the high, the low, the close, the open, the range, or even an indicator.
You might like to add this line to the very end of your scan (it must be the last line, or you get an error):
rank by SCTR
Save the results list in that order and then see where your best chances are. You can research this by running the scan for a past date - say a month ago, and see what happened.
It looks like you may be picking up on an idea that has been around for a while - narrowing range precedes a price reversal. Here is a link to a Chart School page on Tony Crabel's NR7 (narrowest range in seven days) technique, including scan code you can copy and paste:
stockcharts.com/school/doku.php?id=chart_school:trading_strategies:narrow_range_day_nr7