Home

Data Factory

XData in CQG

Click to EnlargeXData, or external data, allows you to import text files using a PRN or tab-delimited format and create a synthetic instrument in CQG. The imported data can be plotted as a chart and CQG analytics can be applied to the chart. For example, any proprietary business data may be imported into CQG.

To plot the data as its own chart, the file is created using the QFormulas module within the CQG Formula Builder. Imported XData can also be the basis for a study.

The external data must be formatted properly. For the XData study, the target chart must use date/time formatting consistent with the data used in the XData study. You can't import Excel files directly, but you can use Save As to create a PRN or tab-delimited file to import into CQG.

 

Creating an ASCII file in Excel:

  1. Open a chart.
  2. Right-click the Print button and then choose Tabular Display.
  3. Highlight all the data in the table and copy it to the clip-board.
  4. Paste the data into Excel.
  5. Format the date column and delete the blank column B.
  6. Set the date format to MM/DD/YY. Order of the data doesn't matter – ascending or descending. You don’t have to label the columns with OHLC in cell A1. CQG will automatically assign OHLC to four columns of data, HLC for three columns, HL for two columns, and Close for one column of data.
  7. Save the spreadsheet to an ASCII file. The two popular extensions you can use are Tab Delimited (.txt) or Space Delimited (.prn).
  8. While saving the file, you will be prompted with three questions. It is important to answer them YES, OK, or NO when closing the spreadsheet. The spreadsheet has to be closed to view it in CQG.

You have two input options in which to call the XData curve into the chart. You can type the Qnumber or the description you used to name the Qformula.

Tip: If you have a lot of Qformulas, it is better to create a naming convention for their descriptions. Keep the names short and use Q.XXXX versus Qnumbers to pull the data into a chart.

Displaying External Data in CQG:

  1. Create an ASCII file, using the directions above, that can be brought into CQG by the XData function.
  2. To access the XData chart feature in CQG, open the Define User Formulas window by left-clicking the Formula button at the top of the screen.
  3. Go to the Qformulas tab and left-click the New button. Give the external data curve a descriptive name without using spaces or special characters.
  4. Left-click the OK button. You will now have a new Qformula shown in the list along with the next Qnumber in the series assigned to it. You can use the drop-down to change the Qnumber if needed.
  5. Once you have created a new Qformula, click the XData button on the lower right-hand side of the Define User Formula window.
  6. Type a CQG symbol in the Issue field. The symbol you choose will reflect the same holiday schedule, session information, and price format as your external data, (e.g. if XData is 103.3125 use TY).
  7. Left-click the Browse button for the Data Source field, and go to your external data file.
  8. Choose the date format you specified in the ASCII file from the Date Format list.
  9. Now that your Qformula is done, close the Define User Formulas window. 
  10. Open a chart and specify the time to match your ASCII time frame.

Once the XData curve is loaded in the chart, you can apply any study or indicator as you would with a CQG data chart.

Tip: If you have a lot of Qformulas, it is better to create a naming convention for their descriptions. Keep the names short and use Q.XXXX versus Qnumbers to pull the data into a chart.

Related
Alerts
Links to Excel (DDS)
Studies