Custom Sessions and RTD

CQG Integrated Client customers can set up custom sessions for their charts. For example, NYSE’s trading hours are from 8:30 to 15:00. The primary session for the E-mini S&P opens at 8:30, but closes 15-minutes later, at 15:15. If you want to see E-mini S&P market data and studies based on a close of 15:00, you can create a custom session to open at 8:30 and close at 15:00 and apply that to the E-mini S&P chart. The maximum number of minutes you can use is the range of the custom session. In this case, that would be 390 minutes. You cannot apply a custom session to a daily bar chart. You can use a smaller time frame, such as 5 minutes. You can learn more about setting up custom sessions here.

For this post, I created a custom session called EPDay.

You can use this custom session in the RTD contract label formulas (market data you see in a quote display) by including the number of minutes and the name of the custom session surrounded by curly brackets in the symbol, i.e., EP,390{EPDay}.

=RTD("CQG.RTD", ,"ContractData", "EP,390{EPDay}", "Open",, "T")

=RTD("CQG.RTD", ,"ContractData", "EP,390{EPDay}", "HIgh",, "T")

=RTD("CQG.RTD", ,"ContractData", "EP,390{EPDay}", "Low",, "T")

=RTD("CQG.RTD", ,"ContractData", "EP,390{EPDay}", "LastQuoteToday",, "T")

To get the net change using custom sessions, we will use the study data RTD formulas.

Study Data

RTD study data is market and study data from a chart. The standard RTD formula for the open for a daily bar is:

= RTD("cqg.rtd",,"StudyData", "EP", "Bar", "", "Open", "D", "0", "All","", "","True")

The "D" is for the daily bar, the "0" is today, and the "All" is for all sessions. As a side note, you enter "PrimaryOnly" for the primary session. Next to "All" there is a blank parameter. This is the location for declaring a custom session:

= RTD("cqg.rtd",,"StudyData", "EP", "Bar", "", "Open", "390", "0","", "EPDay", "","True")

Notice that I removed "All", added "EPDay", and set the time frame to "390". The high, low, and close RTD formulas are as follows:

= RTD("cqg.rtd",,"StudyData", "EP", "Bar", "", "High", "390", "0","", "EPDay", "","True")

= RTD("cqg.rtd",,"StudyData", "EP", "Bar", "", "Low", "390", "0","", "EPDay", "","True")

= RTD("cqg.rtd",,"StudyData", "EP", "Bar", "", "Close", "390", "0","", "EPDay", "","True")

To calculate the net change, simply use today’s close minus yesterday’s close by using "-1":


For a study such as RSI, the same parameters are used:

= RTD("cqg.rtd",,"StudyData","EP", "RSI", "InputChoice=Close,Period=14", "RSI","390","0","","EPDay","","True")

Make sure to lower your Excel RealTimeData (RTD) throttle to 50 milliseconds or lower. Learn how to do that here.

Requires CQG Integrated Client.


Trading and investment carry a high level of risk, and CQG, Inc. does not make any recommendations for buying or selling any financial instruments. We offer educational information on ways to use our sophisticated CQG trading tools, but it is up to our customers and other readers to make their own trading and investment decisions or to consult with a registered investment advisor. The opinions expressed here are solely those of the author and do not reflect the opinions of CQG, Inc. or its affiliates.