Lighthouse Trader - Home

       
 

Technical Analysis Software for the Stock Market

     

Home

Free trial

Download

Purchase

Data

Documentation

Resources

Contact us

 
 

Quick Start

Choosing a Date

Choosing the Symbols to Examine

Adding “Filters” to Your Scan Definition

Filter Settings

Specifying a Trigger Price

Filter Descriptions

Available Filters:
Data Items
Indicators
Arithmetic Operators
Comparison Operators
Boolean Operators
Time Operators

Running Your Scan

Saving Your Scan

Viewing the Results Table

Viewing Charts

Saving the Result as a Watchlist

Scanning Examples

Our Challenge to You

 

STOCK SCANNING AND RANKING

Quick Start

To define and run a stock scan, click the “Scan / Rank” button on the left edge of Lighthouse Trader. Drag one or more items from the “Available Items” list, dropping them into the “Selected Items” list. Then click the “Run” button. Lighthouse Trader will generate a table showing the symbols and indicator values for all stocks that passed your scan requirements.  You can sort this table by clicking on one or more column headers. To view a chart for a symbol in the table, double-click on that symbol.

You can define and run any number of scans simultaneously. Each time you click the
“Scan / Rank” button on the left edge of Lighthouse Trader, a new stock scanning window will be created. To switch between your stock scanning windows, just click on the desired “Scan / Rank” tab near the top edge of Lighthouse Trader.

Here is what the “Scan / Rank” window looks like. Click on the following thumbnail to see
an enlarged example.
Stock Scanning / Ranking feature of stock charting software

Choosing a Date

By default, the “Date to Scan” field is set to the last day for which data has been loaded into the database. However, you can change this to any date in the past if you wish to analyze older data and then see how those stocks performed.

Choosing the Symbols to Examine

By default, Lighthouse Trader will analyze all symbols loaded into the database. 

If you choose “analyze symbols from selected watchlist”, then only those symbols which are members of that watchlist will be analyzed.

Adding “Filters” to Your Scan Definition

Lighthouse Trader provides a number of data items, indicators, and operators which you can combine to define your scan. Collectively, these are all called “filters”. The available filters are listed in a box near the lower left corner of the scanning task window (take another look at the screenshot above). For convenience, these filters are grouped and displayed in the following logical categories:

  • Saved Scan Definitions – a list of scan definitions you have previously created and saved
  • Data – eg. open, high, low, closing price, volume, rank
  • Backtest Data Items – special constants that are useful only with scan definitions used with backtesting
  • Indicators – eg. moving averages, ADX, MACD, RSI, etc.
  • Arithmetic Operators – eg. "add, subtract, multiply, divide, percent, etc."
  • Comparison Operators – eg. the "above/below operator"
  • Boolean Operators – eg. AND, OR, etc.
  • Time Operators – eg. "time frame", "time shift"

Double-clicking on one of these category names in the list will alternately show or hide all filters belonging to that category.

To include a filter in your scan definition, simply drag-and-drop that filter to the desired location in the “selected item” list. To drag-and-drop a filter, highlight that filter item in the “Available Item” list by clicking on it once. Then, while the cursor is positioned over the highlighted item, click and hold the left mouse button down while you drag that item over to the “Selected Item” list. Continue to hold the mouse button down until the cursor is positioned over the point where you wish to “drop” the new filter. Don’t worry–it’s easy!

Several buttons are provided along the left side of the “Selected Item” list. These buttons perform the several useful operations.

buttons image

The “trash can” button will remove the highlighted filter from the “Selected Item” list.

The “up arrow” button will move the highlighted filter up in the list of filters (within a group of peer filters all nested beneath the same “parent” filter).

The “down arrow” button does the same, but moves the filter down in the peer list.

The “check box” button lets you set parameters and required values or rankings for the highlighted filter.

Filter Settings

When you add a new filter to your scan definition, a window automatically pops up allowing you to specify several important settings for that filter.

For each filter, you can make one of three choices regarding how that filter is applied.

  1. Accept all values for this filter. In other words, you do not want to screen out stocks based on this filter. This setting is useful if you want to display the value for this filter
    in the result table but do not want to use it to eliminate stocks. Additionally, there are times when you use a filter merely to supply a required value to another filter (it’s called “daisy chaining”) and you only want to eliminate stocks based on this other filter. For example, if you want to see stocks whose 50-day moving average of their volume is above some threshold, you would specify “accept all values” for the volume data item that feeds into a moving average filter item, because you only care about the moving average value, not the daily volume number by itself. We’ll show you many examples later on to make it clear.
  2. Require that values for this filter be above, equal to, or below, some threshold value you specify. For example, if you wanted to see stocks whose 50-day moving average of volume is greater than 200,000 shares, you would use this setting.
  3. Require stocks to be ranked in the top or bottom N percent of the range of values for all stocks. For example, you would use this setting if you wanted to see stocks whose 50-day moving average of volume was in the top 10% for all stocks.

When you add a new filter to your scan definition, you can choose whether to display that filter in the result table. By default, all filters will be displayed. However, by unchecking the “show this statistic in result table” checkbox, the filter will not appear in the result table.

There is also a checkbox labeled "use as trigger price for backtesting", which allows you to specify whether to use the value of this filter as a "trigger price" later on during backtesting. Checking or unchecking this box has no effect on the behaviour of the scan definition. It only applies to backtesting. If checked, then, when this scan definition is used by the Backtesting tool, this scan definition will provide the entry or exit price for a simulated trade. Only one filter item in a scan definition may be chosen to provide a trigger price. For more information about specifying trigger prices in your scan definition, look at the Specifying a Trigger Price section.

As mentioned above, you are automatically prompted for the above choices when you add a new filter to your scan definition. But if you wish to change a setting later on, it’s easy to do this. Simply right-click on the filter (in the “Selected Item” list) and choose “Set Parameters”. Or you can highlight the filter and click on the “Set Parameters” button to the left of the list. 
It looks like this:

Set Parameters button

Some indicators calculate multiple statistics. For example, the stochastic oscillator calculates a %K and a %D value. In this case you will be presented with a dialog box area for each of the statistics offered by that indicator/filter. You can set required value thresholds and ranking requirements for each statistic.

Also, there will be a drop down list box letting you specify the “default” statistic for this filter.  This is only important when you are “daisy-chaining” filters (ie. where one filter supplies a required value for another filter). In this case, if the supplying filter is capable of providing more than one statistic (for example, the stochastic oscillator can provide a %K and a %D statistic), you must specify which one should be provided to the “parent” filter. Don’t worry, we will provide examples to make this clear. It is actually quite rare that you will need to deal with this setting. In reality you may never need to use this feature. But it’s there just in case.  It’s the price of power.

Specifying a Trigger Price

When you drop a new filter item into the “Selected Items” box, a pop-up window appears prompting you for several choices relating to the new filter item. One of these choices is whether to use the value of that filter item as a “trigger price”. A “trigger price” is simply the value computed by one of the filter items in your scan definition. For example, if you specified that the “close” filter item should provide a trigger price, the value of the trigger price would simply be the closing price for the stock on that day. Another typical trigger price is to create a scan definition that “triggers” if the price of a stock rises above yesterday’s high. To do this, you would combine an “Above/Below” operator with a “Time Shift” operator to compare today’s high with yesterday’s high, specifying that yesterday’s high is the “trigger price”.

Trigger prices are not used by the “Scan / Rank” tool. They do not affect which stocks pass or fail the requirements of your scan definition. Trigger prices are only used by the “Backtest” tool of Lighthouse Trader. They allow you to specify the exact entry price or exit price of a simulated trade during backtesting.

It is important not to use the high, low, or opening prices of the scan date (ie. the target date for which your scan is being run) as the basis for your trigger price. To do so would be to unfairly use knowledge of future events before that information would be available in real-world trading. For example, if you were to specify the opening price of the scan date as your trigger price, this would usually be unfair because the scan definition usually needs a complete day’s worth of price/volume data to properly determine if a stock has “triggered” (ie. passed the requirements of the scan definition). In other words, you might not know if a stock has met your scan definition requirements until the end of the day, and by then it is too late to enter at the opening price. However, it is perfectly legitimate to use the high, low, or opening prices of the day preceeding the scan date as trigger prices. And it is legitimate to use the closing price of the scan date as a trigger price.

Filter Descriptions

In the descriptions which follow, the term “nested filter item” refers to any data item, indicator, or operator which you drop “beneath” some target filter item in the “selected item” list. It will appear beneath and slightly indented relative to the target filter item.

For example, in the following list, “volume” is “nested” beneath the “50 sma” item. This indicates that the value of the “volume” item will be “fed into” the “50 sma” item. Thus it will calculate the 50-day moving average of volume.

Nested filter item image

Here is a complete list of all available filter items.

Data Items

open

The opening price for a stock. Depending on the time frame you choose, this could be the opening price for the day, week, or month.

This filter allows you to identify stocks whose opening price is above or below some threshold you specify, or stocks whose opening price is in the top or bottom N percent of the opening prices for all stocks.

high

The high price for the day, week, or month, depending on the time frame you choose.

low

The low price for the day, week, or month, depending on the time frame you choose.

close

The closing price for the day, week, or month, depending on the time frame you choose.

volume

The volume for the day, week, or month, depending on the time frame you choose.

rank

Lighthouse Trader uses standard calculations to estimate the rank or “relative strength” of a stock. You can choose either of two values:
The “short term” rank – based on how far the current price of a stock is above or below its 130 day (approximately 6 months) moving average.
The “long term” rank – based on the percent rise or fall of the price of a stock over the past year.

If you choose a weekly or monthly time frame, the rank will be a simple average of the rank values for the individual days that make up that week or month.

constant

This filter item lets you enter a constant value. This value may then be supplied as input to other “arithmetic” type filter items.


Indicators

ADX

This indicator offers three distinct values which you can filter on: adx, +dmi, and –dmi. You can set thresholds or rank requirements for any or all of these statistics.

Bollinger Bands

This indicator offers two distinct values which you can filter on – the upper and lower band value.

CCI
(commodity channel index)

You can filter stocks based on the value or rank of this indicator. You can change the number of smoothing periods from the default of 18.

Historical Volatility

You can filter stocks based on the value or rank of this indicator. You can change the number of smoothing periods from the default of 100.

Historical Volatility Ratio

This filter lets you select stocks based on the ratio of two historical volatility values. Each value is based on a different smoothing period. The default periods are 6 and 100.

MACD

This filter offers two different statistics you can filter on – the primary MACD line (the difference between two ema calculations) and the signal line. The default periods of the two ema calculations is 12 periods and 26 periods.

Simple Moving Average

You can filter on this value being above or below some threshold, or ranked in the top or bottom N% of all values.

Exponential Moving Average

You can filter on this value being above or below some threshold, or ranked in the top or bottom N% of all values.

Simple Moving Median

This indicator computes the median value for the specified number of days, weeks, or months. It is similar to the simple moving average except that it computes the median value instead of the average value. The “median” value is defined as the middle value of a collection of values. For example, if the closing price for the five most recent days is 20, 22, 23, 31, and 32, the median value is 23 (and the average value is 25.6).

RSI

Relative strength index. This indicator offers one value on which you can filter stocks based on some threshold value or a ranking. It also has a parameter allowing you to set the number of smoothing periods.

Stochastic Oscillator

This indicator offers two values on which you can filter stocks, the “%K” and “%D” values. You can set a required threshold value or ranking requirement for either or both of these statistics.

True Range

“True Range” is the largest of the following ranges:

1. today's high and today's low, or,

2. today's high and yesterday's close, or,

3. today's low and yesterday's close

Basically it adds a potential gap to the reported range.

You can filter on this value being above or below some threshold or rank.

Average True Range

By default this is a 14 period smoothing (using Welles Wilder’s algorithm rather than a simple moving average) of the “True Range” indicator (see above).
You can filter stocks based on some threshold value or a rank requirement for this statistic.


Arithmetic Operators

Add

This operator adds the values of two nested filter items together, returning a simple sum.

Subtract

This operator subtracts the value of the second nested filter from the value of the first nested filter.

Multiply (mul)

This operator multiplies the values of two nested filter items together.

Divide

This operator divides the value of the first nested filter item by the value of the second nested filter item.

Absolute Value (abs)

This operator computes the “absolute value” of the nested filter item.  “Absolute value” means a positive number. For example, if the nested filter item gives us a value of -40, the absolute value of -40 will be +40.  If the nested filter item gives us a value of +40, the  absolute value will be +40 (ie. the same).

Average (avg)

This operator computes the simple average of two nested filter items.

Percent (%)

This filter item accepts two nested filter items, each providing us with a value. It computes the value of the first nested filter item as a percentage of the value of the second filter item.
For example: if the first nested filter item gives us a value of 25, and the second nested filter item gives us a value of 50, the percent returned by this operator will be (25 * 100 / 50) or 50%.

Slope

This filter item computes the slope of the nested filter item over the specified interval of days (or weeks or months). It does this by computing the value of the nested filter item for today and then computing the value of the same nested filter item N days ago (or weeks or months), subtracting the first from the second, and dividing by the number of periods you specified.
For example: if you specified a 10 day interval, and the value of the nested filter item was 5 ten days ago, and 25 today, the slope will be (25-5)/10 or 2

Min

This filter item returns the minimum value encountered over a specified range of days (or weeks or months). You must specify the number of periods to examine, and you must provide a nested filter item which supplies the values to be examined. To provide the required nested filter item, drag and drop any filter item from the list of available items.

Max

This filter item returns the maximum value encountered over a specified range of days (or weeks or months). You must specify the number of periods to examine, and you must provide a nested filter item which supplies the values to be examined. To provide the required nested filter item, drag and drop any filter item from the list of available items.


Comparison Operators

Above/Below

This operator compares the values of two nested filter items and returns a true or false result depending on whether the value of the first nested filter item is greater than or less than the value of the second nested filter item.

Crossover

This operator compares the values of two nested filter items over a period of 1 or more days (or weeks, months, etc.). It will return true if you choose the “crossing above” option, and the value of the first filter item moves from below to above the value of the second filter item. Or you may choose “crossing below” to identify when the value moves in the opposite direction. You may specify any number of days/periods in the “search window”, during which the required crossover event must occur. If the filter values wobble above and below each other repeatedly during this “search window”, we will report true only if the final value of the first filter is above the final value of the second filter (assuming you have selected the “crossing above” option).


Boolean operators produce a true or false value, depending on the combination of filter items nested beneath the boolean operator. They also allow you to combine multiple
filter items.

Boolean Operators

AND

All of the filter items nested beneath the AND operator must be true for the stock to pass the test.

This filter has a parameter setting labeled “active or inactive”.  When set to “active”, this AND filter is included in your scan definition and all items nested beneath it must be “true”. When set to “inactive”, this AND filter is ignored, effectively returning a “true” or “pass” to its parent. This is a convenient way for you to test the effect of small groupings of filter items, alternately enabling them and disabling them without having to repeatedly enter and delete them from your scan definition.

This filter also has a second parameter labeled “description”. You may enter a brief description of the scan logic associated with this AND element. It will appear alongside the “AND” in the “Selected Item” list. This description is optional. It is merely a convenience to help make your scan definition more readable.

OR

If any one of the filter items nested beneath the OR operator is true, then the stock passes this test.

NOT

None of the filter items nested beneath the NOT operator may be true for the stock to pass this test. In other words, if all of the filter items nested beneath the NOT operator are false then the stock passes the test.

SET

This operator is similar to the OR operator, except it allows you to specify a minimum passing threshold. With the OR operator, it takes only one of the nested filter items to be true in order to return a true (or “passing”) result for the stock. With the SET operator, you can specify that N out of M nested filter items must be true in order to return a true result for the stock.

Time Range

This operator evaluates one or more nested filter items for a range of days (or weeks or months). The nested filter item(s)
must all be true on N out of M days in order to return a true (or “passing”) result for the stock. You can also “reverse” this filter to require that the nested filter item(s) be false for N out of M days.

If there are more than one nested filter items directly beneath the “Time Range” filter item, they are combined as if they were all nested beneath a hidden “AND” filter item which itself is nested directly beneath the “Time Range” filter item. In other words, there is an implied “AND” filter item beneath the “Time Range” filter item.

N-Bar High/Low

This filter identifies stocks which have made N-day highs or lows (ie. the highest or lowest price in the past N days). You can specify the number of days (or weeks or months) to examine, and whether you are looking for a high or low. The “pullback required” parameter of this filter also lets you specify whether the price must pull back between the starting and ending bars of the pattern.

Industry Group

This operator lets you filter stocks based on the industry group they belong to. You can choose any number of industry groups, or just one industry group.


Time Operators

Time Frame

This filter item lets you specify whether to use daily, weekly, or monthly data. All filter items which you drop onto (or nest beneath) this operator will use the time frame defined by this operator. Your scan definition can include several “Time Frame” operators, allowing you to simultaneously screen for conditions based on multiple time frames.

Note: when changing time frames, any time-shift is reset to 0 for filters nested beneath the Time Frame filter. However, if you use a Time Frame filter but specify the same time frame as was already in effect, the time-shift will remain in effect.

Time Shift

This filter item lets you “back up” a number of days (or weeks or months, depending on the time frame). Any filter items which you drop onto (or nest beneath) this operator will be applied to a date which is N days (or weeks or months) earlier than the primary date you specified for the scan. Each of the items nested directly beneath the "Time Shift" item must be true for the stock to pass
the test.

Running Your Scan

Once you have defined your scanning criteria, click the Run button at the bottom right corner of the window. As stocks are found which meet your criteria, their symbols will be displayed.

Saving Your Scan Definition

You can save your scan definition at any time by clicking on the “Save” button located between the available and selected lists. Enter a title for your scan and an optional description. You can repeatedly save updates to your scan definition as you add more filters by clicking on the “Save” button again and highlighting the title of the scan definition that you want to update/replace.

Saving stock scanning definitions - feature in stock charting software

You can also change the description of a previously saved scan definition. To do this, highlight the scan definition under the “Saved Scan Definitions” heading (in the “Available Item” list) and click the “Edit” button.

To delete a saved scan definition, highlight that scan definition in the available list (under the “Saved Scan Definitions” heading) and click the delete button.

Viewing the Result Table

When all stocks have been analyzed, a result table is displayed showing all stocks which met your criteria. Here is what it looks like. Click on the following thumbnail to see an enlarged example.

Stock Scanning / Ranking results table of stock charting software

In addition to the symbols, the result table will include columns for each indicator for which you checked the “show this statistic in result table” checkbox. This checkbox is a part of the dialog box that appears when you click on the “Set Parameters” button for one of the filter items in your scan definition.

You can sort this table by clicking on any column header. Click once for ascending order. Click a second time for descending order. Click a third time to return to the “unsorted” state.

You can also sort on multiple columns. To do this, click on the column header of the primary column you wish to sort on. Then, while holding the control-key down, click on the column header of the secondary column you wish to sort on. The table will now be sorted, first by your primary column, and within the primary column by your secondary column.

Viewing Charts

To instantly view a chart for one of the symbols in the result table, simply double-click on the row for that symbol. Here is an example of what you will see. Click on the following thumbnail to see an enlarged example.
Symbol in Scanning / Ranking results table of stock charting software

Notice that a new “tab” has been created along the right edge of the scan/rank window. You can click on these tabs to switch between the charts, result table, and scan definition windows.

Saving the Results as a Watchlist

Once you have run your scan, you can save the list of symbols as a new watchlist. To do this, click on the “R” tab (aka “results” tab) along the right side of the main window. You will see the result table for your scan. At the top right corner, click on the “Save as Watchlist” button.  Enter a valid filename and click OK.

Scanning Examples

  1. Find stocks that are priced above $10 per share.
  2. Find stocks priced above $10 per share, and whose 50 day average volume is greater than 200,000 shares.
  3. Find stocks whose stochastic oscillator %K line has been below 20 for at least 5 out of the last 10 days, and the %K line has just crossed above the %D line.
  4. Find all stocks in the “gold’ industry group.
  5. Find stocks which have moved up by at least 10% in the past 5 days.
  6. Find stocks whose 50 day average of their daily price range is in the upper 10% of
    all stocks.
  7. Find stocks in an uptrend, as defined by the 9 day ema being above the 20 day ema which in turn is above the 50 day simple moving average.
  8. Find stocks which have made higher daily highs for 5 out of the 7 most recent days.
  9. Find stocks which have made higher weekly highs for the 2 most recent weeks AND have made lower daily lows for the past 3 days.
  10. Find stocks that have moved up on at least twice their average volume.
  11. Same as previous scan definition, but the high volume price rise may have occurred on any day in the past 5 days.
  12. Find stocks which closed in the upper 10% of their daily range for the day.

Our Challenge to You

If you come up with a scan that cannot be expressed with the filter items currently available in Lighthouse Trader, let us know at and we will see if we can come up with additional filter items to make your scan possible.

Back to top

 
 

home | free trial | download | purchase | data | user guide | resources | contact us
terms & conditions | privacy policy | add a link to Lighthouse Trader from your web site

Website designed by: Clayjar Creative LLC
Copyright © 2005-2008 Lighthouse Trader LLC. All rights reserved.
[1] Lighthouse Trader LLC is not affiliated with TD Ameritrade and neither endorses nor is endorsed by TD Ameritrade. 
TD Ameritrade is solely responsible for the timeliness, accuracy, and availability of their data.