Super Template as a Shortcut to Building Your Trading System

This is a quick-start guide to building your own trading system based on the Super Template. The Super Template comes pre-installed with CQG Integrated Client. As a basic example, we will create a trading system using classical MACD as the main entry and exit signal.

First, locate the Super Template under Trade Systems in the formula toolbox and copy the whole trading system to your new MACD System. Use the copy button next to the trading system.

This gives you a complete copy of everything that is used in the Super Template system.

The next step is to prepare the new system to be used as a MACD entry and exit instead of the AMA system it is set up with initially. MACD has three parameters and these should be reflected in the new system.

Click the Parm button next to the trading system and change the first three parameters to the new names you need for the MACD System. You can delete the MAPeriod if you want, but you can also leave it for later use. Do NOT touch the other parameters.

Next, remove everything from the Signal tab on the entries and the real exits and substitute your own entry. In this case, for the long entry and short exit we have:

MACD(@,12.000,26.000)[-1] XABOVE MACDA(@,12.000,26.000,9.000)[-1]

You can highlight the code, click Setup, and substitute the default values with the parameters we prepared in step one. Right-click the Periods and the parameters will appear!

After changing the code to use the parameters, it is easy to copy and paste the code into the other entries and exits. Just make sure you get the XABOVE and the XBELOW right.

The long entry and short exit should read:

MACD(@,MA1,MA2)[-1] XABOVE MACDA(@,MA1,MA2,Signal)[-1]

The short entry and long exit should read:

MACD(@,MA1,MA2)[-1]  XBELOW MACDA(@,MA1,MA2,Signal)[-1]

Create a toolbar button and apply the trading system to your chart and uncheck all the additional exits.

Manually verify that the system trades correctly at the MACD crossovers.

In this example, we are not making any money with the default settings, so we need to investigate where this is coming from.

The average winning trade is about $4,244, but we have losing trades with almost $26,000 in losses!

Let’s apply some money management by right-clicking the P&L and selecting modify MyMACDsys:

Just applying a simple stop-loss seems to be a good step into the right direction.

Here is a list of all the predefined exits you can use:

  • EOD - End-of-Day will exit any position at the last bar of the day when checked.
  • MMstop - Money Management is a simple stop-loss. You just need to specify the amount.
  • MM - Money Management Stop is on if checked.
  • BEFloor - Break Even Exit will close the position when it returns to its entry price. It needs to reach a certain amount of profit (Floor) before it is activated.
  • BE - Break Even Exit is on if checked.
  • DRTstop - Dollar Risk Trailing is a classic trailing stop that is based on maximum profit during the trade (calculated by each close).
  • DRT - Dollar Risk Trailing is on if checked.
  • PRTstop - Percent Risk Trailing puts a stop below the maximum profit close to risk x% of the money already gained in the trade. The value is in percent.
  • PRTfloor - Percent Risk Trailing needs to reach a certain amount of profit (Floor) before it is activated.
  • PRT - Percent Risk Trailing is on if checked.
  • PTtarget - Profit Target exits a position if a certain amount of money is gained.
  • PT - Profit Target is on if checked.
  • ATRperiod - Average True Range trailing stop uses the value of the Average True Range study when a trade is initiated. ATR Period is the length of the ATR measurement.
  • ATRfactor - ATR Factor is the parameter that determines how many ATRs the stop is placed away from the market.
  • ATR - Average True Range trailing stop is on when checked.
  • ES - Entry Stop places an initial stop on the low (for long trades) or on the high (for short trades) of the entry bar. Entry Stop is on if checked.
  • Quantity - Quantity is the trading size, in contracts, for a stock or future trade.
  • FX - If FX markets are traded, the quantity gets multiplied by 100,000. If you want a clip size of 1,000,000 per trade, that is a quantity of ten with the FX multiplier checked.

You can also refer to the first article about the Super Template.

You may have noticed that with our quick approach, the naming under setup study parameters is not 100% correct.

This can be changed under the Parms button in the formula toolbox.


Download the PAC file ‌‍‍‍‍

Learn more from CQG HTML Help