Generating an Optimal Signal

 

Sometimes it is useful to see what the optimal trading signal against a data series would be. Using this information, you could compare it to your entry/exit systems to search for ways to improve them. You could also model the optimal trading signal using a neural network in order to predict the best action to take.

 

TradingSolutions includes an optimal signal generator that uses its knowledge of the future in a data series to determine whether to be in or out of the market at any given point. Since TradingSolutions doesn’t have access to future from the present day, this signal can’t be used for active trading. However, it is useful for determining the key entry and exit points in historical data.

&  For a step-by-step introduction to this topic, see the tutorial called Model the Optimal Signal.

Generating an Optimal Signal Field

To create an optimal signal field, open the Create a Field Wizard and select to create a new field to Generate an optimal entry/exit signal. This will begin the Generate an Optimal Signal Wizard.

 

The Generate an Optimal Signal Wizard begins with the Signal Parameters page, which provides you with the ability to select the parameters for how this optimal signal should be generated. Different signals are available depending on whether you will be using the signal for modeling or for seeing where the maximum profit could have been made. In addition, profit criteria can be established so that only trades that generate a certain percentage of profit will be signaled.

&  For help setting these parameters, see the help for the Signal Parameters page.

 

The wizard concludes with the Select Name page. TradingSolutions provides several suggestions for names for the new field based on the entry/exit system and inputs selected. Any of these names can be used directly from the combo box, or you can enter your own. The name of a field should be something meaningful so that you know what the values in the field are without having to see how they are calculated.

&  For more help with optimal signal fields, see the help for the Generate an Optimal Signal Wizard.

How the Optimal Signal is Generated

The optimal signal is based primarily on the specified minimum profit. The optimal signal for each day is based on the potential profit of a trade made on that day and held anywhere from one sample to the specified number of samples into the future. Stepping forward one sample at a time, the potential profit is examined. If the profit would be enough to clear the minimum profit after commissions, an entry signal is generated. The direction of the entry signal is based on the direction of the price movement.

Ä    Note: If the Maximum Profit Signal type is selected, entry signals will be delayed until the maximum profit can be obtained. For example, if the price decreases one percent in the next sample, then increases ten percent in the following sample, an enter long signal will not be generated for the current day since more profit can be made by entering the trade on the next sample.

 

If an entry signal is not generated in the specified number of samples, the same range is checked for exit criteria. If the current price is the lowest price over all of the samples, an exit short is generated. If it is the highest, an exit long is generated. The rationale for these exits is that the value of the trade will not improve if the trade is held. Similarly, exits are not generated if the value of an existing trade will improve.

 

If no entry or exit signals can be generated, a hold signal is generated. This indicates that the price will not change enough in the near future to warrant entering the market. However, there is no advantage to be gained by immediately exiting the market.

 

If the Analog Value Signal type is selected, the actual value of the signal is modified to reflect the underlying price changes. For entry signals, stronger signals are generated for larger price changes. For exit and hold signals, stronger signals are also generated for larger price changes. However, these values are kept within the thresholds for the signals they are generating.

 

The Thresholded Analog Signal type does not contain price strength information.

Using an Optimal Signal

Optimal signal fields can be used like entry/exit system signal fields. They can be displayed in charts and analyzed using the signal analysis tools. As stated above, since they are based on future knowledge, they cannot be used directly as an entry/exit system. However, they can be used as a desired output of a neural network prediction so that you can try to model the optimal signal to produce an entry/exit signal.

Why Optimal Signals appear "Less Than Optimal"

When you display an optimal signal in a chart with price information, it may appear to be making less than optimal, or even losing trades. Here are some common reasons for this impression.

·      The trading style specifies to trade on tomorrow’s open.

The most common reason for the optimal signal appearing to make "bad" trades is that the optimal signal is being displayed with the closing price, but the actual trades are analyzed for the price at the next day’s open. This setting is specified in the trading style. In most cases, the closing price and next open are very similar. However, after-hours trading can cause the opening price to be significantly different from the closing price.
To correct this in the chart, display the opening price instead of the closing price. Then, use "Change Display Properties of Field…" to shift the optimal signal forward one day.

·      The default values allow for draw-downs.

You may notice small draw-downs after the optimal signal indicates to enter the market. This is because the optimal signal looks primarily at whether a profit of the specified percent can be made in the next n bars while allowing for a small draw-down.

Ä    Note: Including small draw-downs in the optimal signal typically makes it easier to model with neural networks. This is because it allows the optimal signal to concentrate on larger price trends rather than smaller fluctuations in the price which may mask the beginning of a trend.

Using Alternate Values for the Optimal Signal

For most users, using the default optimal signal and adjusting its parameters will provide the results they are looking for. However, there are some advanced situations where you may want to use an alternate optimal signal.

 

The optimal signal is a mathematical answer to the question "when would have been the best times for me to trade?". It has parameters for you to fine-tune the answer to the data you are working with and the relative frequency you want to trade using that data. If the optimal trading you would like to model is more complex than a specific percentage change, alternate calculations can be used to create an optimal signal.

 

One approach is to change the values used for the values being analyzed. The prices used for trading analysis are defined in the Trading Style. By default, the opening price of the next bar is analyzed. However, any field or combination of fields can be used. For example, an optimal signal could be created which trades against the median price or price normalized by dividing it by an index price.

Ä    Note: The values used should typically be raw, averaged or normalized price values. Change, percent change, and indicator values will typically not work well.

Ä    Note: When using values not in the normal price range, it is important to set all of the "basis" prices to be equal to the Trading Value in the Trading Style. In addition, stops and limits cannot be used since they would require the High and Low to be evaluated.

&  For help with trading styles, see Using Trading Styles.

 

Another approach would be to create your own optimal signal using calculations. To do this, create a new entry/exit system and define rules based on the "Lead" function. For example, you can create a longer term optimal signal that trades based on price changes over the next 30, 60, and 90 bars.

 

&  For more help with signals, see Creating and Analyzing Entry/Exit Signals.