Home                           

 Try Investor/RT             

 Investor/RT Tour           

 Getting Started              

 What's New                  

 Testimonials                 

  Q&A - Broken down by Topic . . .      Complete List of Questions - All Topics
     Charts and Technical Indicators      TPO Charts
     RTL: Scans, Signals, and Custom Indicators      Importing and Exporting
     Trading Systems and Backtesting      Schedules
     Quotepages, Portfolios and Custom Columns      Alarms / Alerts
     Data: Historical Data, the Database, and Data Services      User Variables (T# and V#)
     Custom Instruments: Spreads and Pairs      General / Miscellaneous
     Controls, Windows, and the Button Indicator      Autotrading
     Slide Shows      Product Line

 
Q&A Home

Investor/RT Answer
Answers to Common Questions

   

Question

How would I create a scan or signal which accessed data from multiple periodicities simultaneously (1-min, 5-min, 30-min, 90-min, and Daily)?
   

Answer

Let's assume in our specific example that we want to scan for all the symbols for which the Linear Regression Slope (100-period) is simultaneously positive for all the following periodicities: 1-minute, 5-minute, 30-minute, 90-minute, and Daily.

In order to get the slope of the Linear Regression line, the Linear Regression Slope (LRS) would be used.  The setting we'll use for LRS to get the slope of the 100-period Linear Regression line can be seen below:

LRS will create a 100 period regression line using the last 100 closing prices, and return the slope of that regression line (in price/bar).  Knowledge of this indicator is not really necessary to understand the concept of mixing periodicities.  Almost any indicator can be used in the same fashion.

Now, let's construct our scan.  In order to mix periodicities, we're going to run the scan on 1-minute data, and access the data of the other higher periodicities via the Mixed Periodicity Data (MPD) indicator.  The syntax for the scan will look something like this:

LRS > 0 AND MPD#5 > 0 AND MPD#30 > 0 AND MPD#90 > 0 AND MPD#DAILY > 0

LRS is the token for Linear Regression Slope.  The LRS preferences will be setup exactly as seen in the screenshot above.  All four MPD tokens (MPD#5, MPD#30, MPD#90, and MPD#DAILY) will be setup almost identically, with the only difference being the periodicity specified in the "Mix Periodicity" setting.  The settings for MPD#5 are seen below.

Click on the "Indicator Preferences" button to make sure the LRS setting are setup exactly as seen above.  The easiest way to simulate a set of preferences for an indicator in this way is to open up the preference settings that you'd like to duplicate and choose "Preset: Make Default".  Then, any time you use/add that indicator in the future, it will be initiated with exactly those settings (until you once again reset the default preferences).

The MPD#5, MPD#30, MPD#90, and MPD#DAILY tokens should be setup similarly, with the proper periodicities of 5, 30, 90, and Daily (LRS will operate on the underlying 1-minute data without "mixing" any periodicity.).  The resulting scan window should look something like this:
 

 
It is important that you have sufficient daily and intraday (1-minute) data on the symbols in the target quotepage in order to run the scan.  In our example above, the scan would need the last 100 daily bars and the last 9,000 1-minute bars (90-minute x 100) in order to function properly and give valid results.

There are some efficiency measures that could be taken to make this scan run much faster.  We could run a daily scan once a day to provide us with a list of the candidates that match our daily criteria of LRS > 0 and save those candidates in a quotepage (the one that results from the scan).  Then, every 90-minutes, we could run a scan (on the quotepage which contains our daily candidates) to find candidates which also pass the 90-minute criteria of LRS > 0.  This could even be taken two steps further for 30-minute (ever 30 minutes) and 5-minute (every 5 minutes) data.  Each periodicity would build upon the results of the larger periodicity, and would save their own unique quotepage with the results.  These scans could be scheduled to run however often they were required, with the schedule action of "Run Scan" allowing you to specify the name of the quotepage that results.

One other option that can allow you to use the more efficient method above, while not having to maintain all those quotepages along the way, is via User (V#) Variables.

Once a day, you would run a scan on daily data:

SET(V#1, LRS)

So V#1 would hold the daily linear regression slope.  Then, every 90-minutes, you'd run the following scan on 90-minute data:

SET(V#2, LRS)

So V#2 would hold the 90-minute linear regression slope.  You'd do the same for 30-minute (V#3) and 5-minute (V#4) LRS values.  Then, the scan you'd run every 1-minute would look like this:

LRS > 0 AND V#1 > 0 AND V#2 > 0 AND V#3 > 0 AND V#4 > 0

And be much more efficient, and you won't have to worry about those 4 or 5 extra quotepages.

There is one more thing to consider here. The timing of when you run the scans is obviously importing. Let's consider the timing of the Daily and 90-minute scans independently.

If you run the following daily scan 30 minutes BEFORE the open of the session:

SET(V#1, LRS)

Then the result will be that V#1 will be set to the LRS value on the last completed daily bar which is yesterday's bar. However, if you run this same scan 30 minutes AFTER the open of the session, then you'll be setting V#1 to the LRS value of the current (today's) daily bar, considering the first 30 minutes of trading as today's bar. Now, if you wanted to run the scan 30 minutes after the session opened, but still set V#1 to the LRS value of yesterday's bar (and therefore use only "completed" bar data in your evaluation), you would simply change your syntax of your daily scan to the following:

SET(V#1, LRS.1)

Where the appended qualifier ".1" extracts the value of LRS "1 bar back".

The same concept would apply to the 90-minute data. You might want to schedule the scan to run 1-minute after the completion period of each 90-minute bar, and to use the syntax:

SET(V#2, LRS.1)

So that V#2 will always represent the LRS value of the last "completed" 90-minute bar.

To find out more about schedules and scheduling scans, visit:

http://www.linnsoft.com/tour/schedules.htm

To find out more about User Variables (V# Variables) and their various uses in Investor/RT, visit:

http://www.linnsoft.com/tour/userVariables.htm

Dealing with Symbol Limitations
Now, for someone that is struggling with symbol limit issues, the process of running multiple scans for each periodicity, and then maintaining separate quotepages to store the results of each periodicities scan, would probably work best.  This is also probably the MOST efficient method because it narrows down the list upon which each subsequent scan works.  Let's take the example above, but assume that we have a symbol limit of 200 symbols.  We have a list of 500 symbols that we'd like to monitor.  We'll therefore need the daily scan to narrow down our intraday watch list to somewhere under our limit.

About 30 minutes prior to the session open, we'll get busy.  First, we'll go ahead and delete all our intraday data and unmark all our symbols for intraday.  Delete intraday data by choosing "Control: Database Utilities: Initialize Intraday Database".  Unmark all symbols for Intraday monitoring by opening up the System QuotePage ".Intraday" and clicking on the "Mark/Unmark for Intraday" button (bottom left) on the quotepage toolbar, then clicking "Unmark" in the dialog that comes up.  You don't need the data feed active for the steps above but you will for the steps below.

Next, we'll run a daily download on our 500 symbols to make sure we have sufficient and complete daily data for our scan to work on (you don't need the 500 symbol quotepage open to do the download.  Actually, you should NOT have it open because it will cause your symbol limit to be exceeded.)  Once the download is complete, we'll then run our daily scan of:

LRS > 0

Which should hopefully result in a quotepage of less than 200 candidates for us to monitor intraday.   Actually, you can force your results to stay below 200 by adding the following condition to your scan syntax:

LRS > 0 AND HITS < 200

Save the resulting quotepage.  This is the group which you'll monitor intraday.  Mark all the symbols in the quotepage for Intraday monitoring by clicking on the "Mark/Unmark for Intraday" button (bottom left) on the quotepage toolbar, then clicking "Mark" in the dialog that comes up.  These symbols will now be monitored on an intraday basis throughout the day whether they are open in a quotepage or chart or not.  This quotepage is now ready to be further scanned using 90-minute data, 30-minute data, 5-minute data, and 1-minute data throughout the day using the process described above.  The next day, simply repeat these steps to get a fresh group of candidates.

For more information on symbol limits, visit Tip: Living with Symbol Limits

And essentially all of the tasks mentioned above can be scheduled to run automatically with Actions like "Run Scan", "Download Data", and "Database Function: Initialize Intraday Database".  The "Run Scan" can be setup to automatically save the resulting quotepage with a specific name (and even suppress the opening of the quotepage if you wish).  In order to automate the marking and unmarking of symbols for Intraday monitoring, the following scans can be created and then scheduled:

SET(MON, MON_INTRA)

to mark the symbols for intraday, and then:

SET(MON, -MON_INTRA)

to unmark the symbols for intraday.

 

   

Hit Counter