From the May 01, 2008 issue of Futures Magazine • Subscribe!

Idealized models for real profits

Long-time system developer Robert Pardo defines potential profit as what “could be realized by buying every bottom and selling every top. More precisely, it is the sum of every price change where each change is taken as a positive number.” Pardo goes on to suggest that a viable measure of trading performance is the ratio of the actual net trading profit to this maximum potential profit figure.

We can take this concept a step further by looking at the effect of transaction costs on the maximum potential profit and the distribution of the optimal transactions. Then, by examining the inter-relationships of two maximum potential profit systems that use different transaction costs, we can generate real-time trading signals.

Here, we’ll look at this process as applied to the corn market. Keep in mind that while the pre-analysis phase certainly uses the benefit of hindsight, the out-of-sample results will be based on stepping forward through previously unseen data. While this approach shares the same potential downfalls of other trading systems, such as curve-fitting and over-optimization, it is not inherently more at risk of falling victim to the irresponsible application of hindsight.

MAXIMUM PROFIT STRATEGY

Like any other trading strategy, the maximum profit strategy can buy or sell or do nothing with each additional price bar. At any time, the trader may hold a long or a short position or be out of the market. Given industry trading procedures and margin requirements, we can formulate a maximum profit trading strategy for any sequence of prices.

However, if more than two profitable transactions can be found, then a maximum trading strategy is a reversal, always switching from long to short and vice versa between the first and the last transactions. From here, maximum profit strategies differ by how they reinvest profits. However, in this discussion, we are interested in the simplest type that works with a fixed number of units and simple, single-contract positions.

“Always in” is one way to depict prices and strategy actions. It illustrates settlement prices of July 2007 corn futures, traded on the Chicago Board of Trade (CBOT) between May 8, 2006, and June 28, 2007.

The positions of two different optimal trading strategies are shown below the price chart. When the oscillator is at the top of its range, the system initiates a long position. When the oscillator is at the bottom of its range, the system initiates a short position. When the oscillator is in the middle, it is holding the position. The only difference between the two systems is the one depicted in the top oscillator uses a per-transaction cost of $12 and the one depicted in the bottom oscillator uses a per-transaction cost of $500. (Keep in mind that these transaction costs are not intended to reflect realistic commission and slippage values, but are being employed here simply as part of the analytical process.)

As a reminder, there is no magic about these trading strategies. They simply use the benefit of hindsight to determine the most profitable entry and exit prices given the two per-transaction costs. Over the period shown, the maximum profit returned by the $12-cost system is $69,015. The maximum profit returned by the $500-cost system is $22,800.

Clearly, the number of optimal transactions decreases as per-transaction costs increase. For unlimited trading costs the best strategy is do nothing. If the costs equal zero, then each nonzero price change would result in a profit.

NEW MARKET PROPERTY

A maximum profit strategy does not describe the strategy of an individual trader. It’s determined by prices, transaction costs and the market access processes in use by the industry. As such, what it tells us about the market relates to other market properties, such as trend and volatility.

The maximum profit, a strategy returning it and time distribution of successful transactions is another form of studying markets and their repetitive statistical behavior. These studies add to the information conveyed by traditional studies because they combine price information, variable transaction costs and trading rules to express results in the most interesting view: trading profits.

Because maximum profit strategies can be expressed as a general market property, they can be used like any other indicator. Consider moving averages. They are calculated on past prices with the benefit of hindsight. They are then shifted forward, as new trading days dawn, for generating real-time out-of-sample trading strategies. This non-anticipating property of a strategy is essential for real trading. The maximum profit strategy can work the same way. The initial calculations can be performed on historical known data and then that information can be analyzed for establishing future positions.

MOVING FORWARD

When a new price arrives, we rebuild the maximum profit strategy using this larger time interval. As we add a new price, we may see a change in the two most recent transactions. Remember, we are using a simple, always-in system. The last transaction will close a position and extract marked-to-market profit. The ideal location of this artificial transaction depends on future prices, and its location may or may not change when we add a new price.

For example, assume today’s transaction is a buy. The order is to close the existing short position and exit. However, if tomorrow’s price is less than today’s price, then it is more ideal to shift this trade to the new day. If the next day’s price falls again, then the transaction shifts further to the right. This news does not change the location of the previous transaction that entered the market on the short side.

Eventually price increases. If the increase does not compensate for the artificial cost applied to the strategy, then the last transaction remains. If, on the next day, the price decreases substantially, the last transaction shifts again. However, if the price increases too much, then the last closing buy-transaction becomes a reversal transaction without changing its location. A new closing sell-transaction is added for today. When this happens, the last transaction becomes the previous one with a now fixed location.

COMBINING STRATEGIES

We can gain even more insight by comparing the signals from two maximum profit strategies, each using a different cost. Say the market falls. If the drop exceeds both costs, then each strategy fixes previous transactions. The trades are either the first sell transactions or the latest reversal transactions. With each new decreasing price, both strategies generate the closing buy transaction, shifting to the right. Despite the cost differences, as long as the price is dropping, the two strategies agree.

An increase in price, however, may cause the two strategies to work differently. The one with a smaller cost may fix its new previous transaction as buy reversal. However, at the same time, the strategy with larger cost does nothing. This is because the price change does not compensate for the larger cost.

This divergence rule catches a local trend change. As all traders know, identifying the advent of a new trend can be quite profitable indeed. If the price continues along this new trend, the strategy with the larger cost eventually switches its position, as well.

The rules of this simple strategy and the analysis of the system results are performed in custom C++ routines, some of which are provided here as a convenience to those familiar with the language. However, all of this should be reproducible in off-the-shelf trading analysis software And in any case, all concepts are fully explained on the conceptual level.

int action = 0;

if(largeLast == 0 && smallLast == -1)

{int newPosition = 1; action =

newPosition - position; position =

newPosition;}

if(largeLast == 0 && smallLast == 1)

{ int newPosition = -1;

action = newPosition - position;

position = newPosition;}

At the beginning, the position is set to flat. The first three commands in the loop iteration include a new price in the analysis and determine whether the positions of the low- and high-cost strategies agree. A new position is set if the signal from the high-cost strategy is do nothing, and the signal from the low-cost strategy is a transaction. The new position is long, if the low-cost transaction is sell, and short, if the low-cost strategy says to buy.

The rule does not change its position if both strategies generate the same action when another price is added. This allows the system to go with the trend. We’ll use a custom C++ application to evaluate the performance of this strategy. The additional inputs are the symbol (C), the initial margin ($1,400), the maintenance margin ($1,050) and the initial account size ($10,000). The cost, $12 per real transaction, is applied. Varying the two costs, we can expect a loss or a profit. The selection of proper costs is an optimization task. Generally accepted procedures for back-testing, optimization and walk-forward analysis should be followed.

For our purposes, we’ll adjust the two costs from $50 to $400, and from $25 to $200, in steps of $25. “Cost collection” shows how the total final profit varies for different values of the low-cost strategy at different values for the high-cost strategy. Each line represents a different low-cost value, shown in the key. The point along the horizontal axis identifies the value for the high-cost strategy.

The time frame of data is about one year. While the July 2007 corn contract traded for a wider time interval, the initial period of low liquidity (when open interest was below 20,000) is excluded. The data for July 2007, when the contract is close to expiration, are also skipped.

“Performance matrix” shows that, during one year, five perspective strategies trading a single contract create 48% to 72% returns on the $10,000 account. In the worst case, 200/75, before getting the final profit the account drops to $7,667. The strategy 225/175 temporarily doubles the account, $21,150. We see how the two cost parameters affect the number of transactions, wins and losses, the ratio of the average win to loss, and other profit and risk statistics. This information is useful for building money management strategies, where one of the goals is to determine the fraction of capital allocated for a next trade and maximize profit and minimize risk.

Note that these are results of optimized back-testing. A full cycle of building a trading strategy includes other stages and tests needed for building confidence in the strategy. For more information on more rigorous trading system validation, see “Pardo’s Design, Testing, and Optimization of Trading Systems” (John Wiley and Sons Inc., 1992).

However, at this point we can see that this area of study has promise. The maximum profit approach and strategies associated with it can serve for building real-time strategies. These rich concepts represent a new form of studying the markets. Comparing them to approaches based on raw price, this form operates with additional information on transaction costs and trading process, providing a new way to look at the past and, therefore, a new way to predict the future.

Valerii Salov is the author of “Modeling Maximum Trading Profits with C++: New Trading and Money Management Concepts” (John Wiley and Sons Inc., 2007). His book includes several routines for programming and analyzing your own trading systems. E-mail him at v7f5a7@comcast.net.

Comments
comments powered by Disqus