Hi all from the 3rd floor of the Red Lion in Seatle, ChartCon has been wonderful and educational. I hope all who are in attendance are enjoying it as much as I am, many many thanks to Chip and the whole team for putting on this exceptional event. I'm sure the next one will be even better, but I'm not sure how you're going to do that Chip.
This mornings sessions covered the scanning engine and there were many questions on how to set up scans and whether there were any libraries of standard scan coding. There are many predefined scans on the website which you can look at and learn from, I recommend you study them closely.
However in order to help get you started here are a few Advanced scan coding sections, these are provided just to get you thinking of different things you can do and how the general format of the coding is set up.
These sections of coding can be modified and grouped into an advanced scan as you see fit, these are only examples they are not necessarily scans which would be applicable to your investment / trading style. Just cut and paste into the scan engine and start creating your own library. (all info provided is subject to change without notice, use at your own risk)
Happy scanning
Gord Greer
Advanced Scan Code Sections,
Just a Few Examples
( // indicates comment lines)
// Sample scan layout, generic
[type = stock]
and [1st criteria]
and [2nd criteria]
and [ [3rd criteria] or [4th criteria] ]
[country = us]
[country = canada]
[country = uk]
// Type
[type = stock]
[type = index]
[type = fund]
// Exchange
and [exchange = NASDAQ]
and [exchange = NYSE]
and [exchange = AMEX]
and [exchange = PINK]
and [exchange = TSE]
and [exchange = CDNX]
and [exchange = LSE]
and [group is SP500]
// or for S&P 1500, large, mid and small cap
and [ [group is SP500] or [group is SP400] or [group is SP600] ]
// Fav lists, numbers will be different for each user, note extra brackets grouping the "OR" clauses together
//
[[favorites list = 13]
or [favorites list = 24]
or [favorites list = 63]
or [favorites list = 64]
or [favorites list = 67]
or [favorites list = 68]
or [favorites list = 70]
or [favorites list = 71]]
// Liquidity SMA of average dollars traded per day > $500,000
[type = stock]
and [SMA(50,close) * SMA(50,volume) > 500000]
// Price bracket, used to restrict the output when developing scans, also min close used to eliminate stocks which are not marginable and not likely to have options, or stocks which have a price which would require a board lot trade to be above your position size. (ie if your max position size is say $10K then 100 shares of a $100 stock would be at your limit of $10K, 100 shares of Google would be $60K, this is important if you broker requires you to trade in board lots when inputting conditional orders)
//
and [Close >=10] and [Close <=20]
// Uptrend: for 75 days the min RSI(14) value >= 40
and [Min(75,RSI(14)) >= 40.0]
// Downtrend: for 75 days max RSI(14) value <= 60
and [Max(75,RSI(14)) <= 60.0]
// Uptrend: MACD positive for 130 days (~ 6 months)
and [Min (130, MACD Line (12,26,9)) > 0.0]
// MA Price convergence long term,
// SMA-20, 100 & 200 all within +/-1% of the SMA-50
and [daily sma(20,daily close) >= daily sma(50,daily close) * 0.99]
and [daily sma(20,daily close) <= daily sma(50,daily close) * 1.01]
and [daily sma(100,daily close) >= daily sma(50,daily close) * 0.99]
and [daily sma(100,daily close) <= daily sma(50,daily close) * 1.01]
and [daily sma(200,daily close) >= daily sma(50,daily close) * 0.99]
and [daily sma(200,daily close) <= daily sma(50,daily close) * 1.01]
// MA Price convergence short term,
// SMA-3, 10 & 40 all within +/-1% of the SMA-20
and [daily sma(3,daily close) >= daily sma(20,daily close) * 0.99]
and [daily sma(3,daily close) <= daily sma(20,daily close) * 1.01]
and [daily sma(10,daily close) >= daily sma(20,daily close) * 0.99]
and [daily sma(10,daily close) <= daily sma(20,daily close) * 1.01]
and [daily sma(40,daily close) >= daily sma(20,daily close) * 0.99]
and [daily sma(40,daily close) <= daily sma(20,daily close) * 1.01]
// Price convergence consolidation mid term,
// Max / Min daily close for last 20 days,
// contained within +/-2% of the current SMA-20
and [max (20, daily close) <= daily sma(20,daily close) * 1.02]
and [min (20, daily close) >= daily sma(20,daily close) * 0.98]
// Price convergence consolidation short term,
// Max high / Min low, for last 10 days,
// contained within +/-2% of the current SMA-10
and [max (10, daily high) <= daily sma(10,daily close) * 1.02]
and [min (10, daily low) >= daily sma(10,daily close) * 0.98]
// Price channel convergence,
// Max / Min daily close for last 20 days,
// contained within +/-3% of the current close
and [min(20, daily close) > close * 0.97]
and [max(20, daily close) < close * 1.03]
// Consolidation then breakout,
// 30 days prior to yesterday Max/Min close within +/-3% of yesterdays SMA-20,
// then breakout, close today 5% above yesterdays SMA-20
and [1 day ago max (30, close ) <= 1 day ago sma(20, close) * 1.03]
and [1 day ago min (30, close ) >= 1 day ago sma(20, close) * .97]
and [close > 1 day ago sma(20, close) *1.05]
//Note last line could be modified to look for a break in either direction,
and [[close > 1 day ago sma(20, close) *1.05] or [close < 1 day ago sma(20, close) *0.95]]
// Fav lists scan for unusual activity, select Fav lists grouped with "OR" clause; watch, hold and sector lists.
//Then define several criteria for today, yesterday, day before etc, based on close, high, low, volume etc etc,
// and then group them with "OR" so any individual criteria will select a stock.
//
[ [favorites list = 1]
or [favorites list = 3]
or [favorites list = 5]
or [favorites list = 6]
or [favorites list = 10]
or [favorites list = 13]
or [favorites list = 61]
or [favorites list = 70] ]
and [[0 days ago volume > 1 day ago sma (60, volume)*1.25]
or [1 days ago volume > 2 days ago sma(60, volume)*1.25]
or [2 days ago volume > 3 days ago sma(60, volume)*1.25]
or [0 days ago close > 1 day ago close * 1.05]
or [1 days ago close > 2 day ago close * 1.05]
or [0 days ago high > 1 days ago close * 1.05]
or [1 days ago high > 2 days ago close * 1.05]]
end
Gord Greer