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

I have a scan that I would like to run every 5 minutes throughout the day, but I would like a quotepage to accumulate all hits throughout the day and record the time of entry into the quotepage.  How can I do this?
   

Answer

First, I would create a quotepage...and make sure it's empty at the begin of each session. Let's say the quotepage name is "myQP". You can empty it by just opening and clicking the green trash can on quotepage toolbar (You could also probably do this with a scheduled scan in order to automate just before each session).

Now, let's assume the syntax for your scan is:

MA > MA_A AND MA.1 <= MA_A.1

You'll just need to change the syntax to:

QP = "myQP" OR (MA > MA_A AND MA.1 <= MA_A.1)

You'll schedule this scan to occur every 5 minutes throughout the session (or however often you would like)...and you would setup the schedule to automatically save the resulting quotepage with a name of "myQP" (essentially overwriting itself).

Now, going back to schedule a scan that initialize the quotepage to empty...you could do this by creating the following scan:

CL < -100

(just a scan that results in no result). And then setup a schedule to run maybe at session open or 1 minute prior to session open....that runs this scan and auto-saves it's results to "myQP". That should leave you with an empty "myQP" quotepage at startup.

Now, let's say you would like to have a record of the time at which each symbol entered your quotepage. First, expand the initialization scan to:

CL < -100 AND SET(V#1, 0)

This will initialize V#1 to 0 (we'll use V#1 later to record the time of entry).

Now, change your other scan to the following (a multi-line scan...scans can have mulitiple lines, separated by a semi-colon).

IF(QP != "myQP" AND (MA > MA_A AND MA.1 <= MA_A.1)) THEN (SET(V#1, TIME)); QP = "myQP" OR (MA > MA_A AND MA.1 <= MA_A.1);

This should set V#1 to the TIME of the initial entry to the quotepage of each symbol. The results of any scan are always the results of the last "line" of the scan.

More Info Above Syntax

MA > MA_A AND MA.1 <= MA_A.1

This uses two different moving averages, "MA" and "MA_A". To learn more about using the same technical indicator multiple times in your syntax, read this:

http://www.linnsoft.com/qa/a/88.htm

Anyway, the expression reads "short term MA is currently above long term MA, and the short term was below or equal to long term on previous bar". ".1" just means "1 bar back". ".2" means 2 bars back, etc.

QP = "myQP" OR (MA > MA_A AND MA.1 <= MA_A.1)

This reads "the symbol is currently in the saved instanced of the quotepage "myQP" OR the symbol meets our MA crossover conditions we just explained above".

CL < -100

This just says "closing price is less than -100"...which should always return FALSE for all symbols and therefore result in an empty quotepage...and thus initialize our quotepage to blank. which is what we were after.

IF(QP != "myQP" AND (MA > MA_A AND MA.1 <= MA_A.1)) THEN (SET(V#1, TIME)); QP = "myQP" OR (MA > MA_A AND MA.1 <= MA_A.1);

First line sets V#1 to the current time if our symbol has not yet been placed in the quotepage (QP != "myQP") AND if the crossover conditions are now true.

The second line just produces our scan results just as we described above....but now, our V#1 has been set to the time of entry.