RTD: A Study Applied to a Study

This article shows RTD formulas for pulling values into Microsoft Excel® that are a study applied to a study.

A common use of Excel with CQG is to pull in study data, such as the average true range study:

= RTD("cqg.rtd",,"StudyData","EP", "ATR","MAType=Sim,Period=20", "ATR","15",,"ALL",,,"False","T")

Another popular one is the moving average study:

=RTD("cqg.rtd",,"StudyData", "EP", "MA", "InputChoice=Close,MAType=Sim,Period=10", "MA","D",,"all",,,,"T")

To pull a study applied to a study into Excel, you use a variation of the RTD study formula as the symbol. Here is the RTD formula for the 10-bar moving average of the 20-bar average true range for a 15-minute chart:

=RTD("cqg.rtd",,"StudyData","ATR(EP,MAType:=Sim,Period:=20)", "MA", "InputChoice=Close,MAType=Sim,Period=10", "MA","15","0","all",,,,"T")

ATR is the study, the symbol is EP, the moving average type is simple and the look-back period is 20 bars. Notice, a colon is required ahead of the equal sign for the two parameters of the ATR using this format. For a different time frame, you can replace the "15." For historical data, you can replace the “0” with a negative number.

Here is an example of a 5-bar moving average of the 14-bar Relative Strength Index for a daily chart:

=RTD("cqg.rtd",,"StudyData","RSI(EP,InputChoice:=Close,Period:=14)", "MA", "InputChoice=Close,MAType=Sim,Period=5", "MA","D",,"all",,,,"T")

Here is a link to RTD chart types and studies samples.

The downloadable CQG-powered Excel RTD spreadsheet pulls in open, high, low, and close values, as well as the average true range and the moving average of the average true range.

Download the Excel File ‌‍‍‍‍

Requires CQG Integrated Client or CQG QTrader, data enablements for all symbols displayed in this spreadsheet, and Excel 2013 or more recent.

Microsoft Excel is a registered trademark of Microsoft Corporation in the United States and/or other countries.