Revisiting the Day Range Strategy. Part 1.

User Rating: / 1
PoorBest 
Written by Forex Automaton   
Wednesday, 16 June 2010 15:52

Note added on July 28, 2010: the quantitative results presented in this report have been found to be affected by a bug in the analysis code and are consequently incorrect. This report is kept here for the sake of historical completeness only.

One of conclusions of the previous strategy research report was that one has to find a way to benefit from the high stability of quality forecasts for daily extremes (high and low) while minimizing the exposure to the forecast of daily close. One way to do that is trading with the profit target on the basis of forecasts for daily extreme levels (high and low) alone. This report begins a series dedicated to just such a strategy. The research will culminate in a launch of a new model trading system (this time with a trade signal and a simulated portfolio of some sort!) which will complement Danica.

A trading strategy relying on Danica's output and attempting to limit risk by placing a profit target on the previous day's extreme has been analyzed already in February 2010 soon after the Danica launch. Here are the key differences between that approach and the up-to-date one:

  • The February approach took it for granted that the maximum predictability (measured by Pearson correlation coefficient between real and predicted logarithmic returns in the time series) is the regime of choice for running the Day Range system. The updated approach simulates growth of the trading capital and finds that the regime of fastest capital growth and that of best predictability are different. (An aside note for those new to this: in this discussion, a "regime" is defined by an adjustable quantity nicknamed Fred which determines how recent past interacts with longer-term accumulated knowledge to determine the projection into the future. Fred is at the heart of algorithmic forecasting.)

  • The February approach did not pay attention to the time stability of the figures of merit used. Much of the present report is about time stability of the optimization curves.

  • Because the data on the qualitative differences in temporal stability between predictability of daily extremes and the daily close were not known in February, it seemed acceptable to supplement a trigger requirement of same predicted move direction for daily high and low with a requirement for daily close to be forecast to move in the same direction. Now that we know that the daily close forecast is not only of worse quality compared to the daily extremes, but also very hard to optimize, it no longer makes sense to impose a condition on the predicted direction of daily close when considering the daily forecast for trade ideas.

Algorithmically speaking, the strategy under study (which may be referred to as Day Range, Close-to-Limit or Open-to-Limit) consists in the following:

  1. Identify high, low and close levels of the previous 24 hours. The close is assumed to be todays' open and is assumed to be the level at which the market is entered, if it is to be entered. The approximation involved (it currently takes the system about 3 minutes to update its market data and make the decision) is believed to be of negligible effect as because, first, 3 minutes are a negligible number on the time scale of 24 hours, and, second and more importantly, what matters is not the negligible magnitude of that price action itself, but the degree of bias of the price action of these 3 minutes against this particular system -- which, unless one is paranoid, should be regarded as a negligible effect on top of an already negligible effect.

  2. Using the forecasting system with suitably chosen parameters (warning: Danica is not currently optimized to do this, as will be seen from the rest of this post), identify currency pairs for which daily high and low are predicted to move in the same direction. If this direction is up, you have a long trade candidate. If down, you have a short trade candidate.

  3. If your trade is long, check that the distance from the current level to yesterday's high is larger than the distance from the current level. The level of the yesterday's high will become the profit target; the level of the yesterday's low -- the stop-loss (naturally, the roles are reversed in case of a short trade).

    More specific requirements can be applied, such as the requirement for the ratio of distance to profit to distance to loss to be larger than 11/9 -- see Fig.1 and the following discussion for the details.

  4. Determine the number of units to trade such that your risk on the trade, given the location of the stop-loss, is a pre-determined fraction of your trading account (discussed later in this article and denoted k). Currently it is assumed that you allocate the same fraction of your account to each currency pair you trade. But there are indications that having k reflect other information in the forecast, such as making it proportional to the magnitude of the predicted move in the direction of you trade (that is, the move in the daily high for a long trade) could improve the performance significantly -- more on this in subsequent posts on the topic.

  5. Place a market order.

You exit the trade in one of the three ways:

  1. You hit the profit target of the trade.

  2. You hit the stop loss.

  3. You are still in the trade by the time the next forecast arrives, and the information in the next forecast, combined with the day's data, are such that you would not place another trade in this pair in this direction. Note that the conditions of the next forecast may also require you to reduce or increase your capital allocation if your trade still passes all of the conditions.

Dependence of net profit/loss on the distances from the entry price to the profit target and to the stop-loss.

Fig.1. Dependence of aggregated profit/loss (arbitrary units) for the duration of the simulated trading on the distances from the entry price to the profit target and to the stop-loss, both as a fraction of the entry price.

Placing a trade with a very tight profit target and a generous stop loss is something that novice traders are tempted to do after they have discovered the disastrous effect of a tight stop-loss. In terms of Fig.1, such trades would land close to zero along the axis labeled "dist. to profit" and farther away from zero along the axis labeled "dist. to stop". As you see, this area hosts a net loss (blue "water" in the landscape), and any hypothetic strategy combining low profit potential and high loss potential is to be avoided.

On the contrary, the area of trades with a ratio of potential profit to potential loss above one is the "mountaineous area" in the landscape, resulting in net profit. The way to go therefore is to accept or reject trade setups on the basis of the balance between distance to profit and distance to loss, favoring situations with high profit potential relative to loss potential. In what follows, the following trigger condition was used to formalize this: the ratio of distance to profit to distance to loss (both positive quantities) was required to be above 11/9 -- a number found empirically after inspecting the histogram in Fig.1. Note that this is similar to the selection condition found and reported in the article Further analysis of the day-range strategy... posted in February.

The algebra of profit and loss in trading on a margin (follow the link for details) has been discussed before. The same notation is used here. If total trading capital is C, its increment per time step of the system (day for Danica system) is dC, then

dC/C = dp/p × k/a (1)

where p is current price quote, dp is its increment during the time step, a is stop-loss placement as a fraction of price quote p, and k is fraction of capital to be lost in the event a stop-loss is triggered. Note that cost of capital is also ignored, and leverage does not appear in Eq.1 unless one becomes concerned with the cost of capital.

Note that stop-loss in this strategy is situational rather than fixed: it depends on the location of the previous day's low and high with respect to close, and takes advantage of the fact that one of the previous day's extremes will not be touched while the other will be. Therefore, the quantity a is not a fixed quantity, it s not exist as a system parameter. Instead,

pa = |p - ps| (2)

where ps denotes the price level of protective stop. Then,

dC/C = dp×k/(p - ps). (3)

Note that when the modulus sign around p - ps is removed, the formula becomes valid for both long and short trades. Eq.1 ignores spread (assumes it is zero) -- this does deserve a special discussion, but not in this post.

With these two ingredients, 1) the selection condition (trigger) and 2) a choice of k, simulating the strategy performance becomes a matter of program execution. In this run, trading was simulated to begin on April 15, 2006 (after the initial learning of the system was over) and lasted till June 05, 2010. I emphasize that a significant fraction of the data is used in the learning and not in trading because the system must be and is limited to "past" data only. Of course, here "past" is past in the context of simulation, too, which is why I put quotes on it.

In the course of the simulation, the time interval of back-test trading is split into five sub-intervals, non-overlapping and of equal length. At the beginning of each such interval, the trading capital is set by hand to be 1. As trading days go by, it is incremented to reflect the on-going gains and losses. At the end, the five intervals can be compared directly since their starting conditions are identical. That way, not only the performance itself but its stability in time becomes clearly visible. In the process, each forex pair is treated as having its own dedicated trading capital, set to unit at the beginning of the period, which evolves independently. Comparing the performances of these 14 independent evolutions is one way of arriving at an estimate of the overall reliability, sustainability of performance and risk level of the strategy. In Fig.2, the performance of the 14 independent forex pairs is aggregated in the usual way by using a profile histogram: the data plotted are the estimated mean and its precision after averaging the data for the forex pairs treated as independent. So you won't see trading system performance for the individual forex pairs.

As for the amount to risk per trade, the k in the equations, it is currently a fixed proportion of the trading capital. Fig.2 presents data for k=1, 2 and 3%.

Simulated growth of unit trading capital in five consequitive 10-month periods; dependence of mean and its precision on the adjustable parameter Fred. 1% of capital is risked per trade via stop-loss. 2.1 Same as above, 2% of capital is risked per trade via stop-loss. 2.2 Same as above, 3% of capital is risked per trade via stop-loss. 2.3

Fig.2. Simulated growth of unit trading capital in five consequitive time intervals continuously covering the total back-tested trading time from April 15, 2006 to June 05, 2010. The intervals have equal length of 258 trading days. The capital is reset to 1 at the beginning of each period. Different sets of symbols denote different intervals, numbered from 1 to 5. The borders of the shaded areas indicate estimated precision of the data, taking to be the RMS among the 14 forex pairs traded divided by the square root of 14 (precision of the Gaussian mean). The width of the shaded band is twice the precision, while the data points are located in the middle of the band. Spreads, commissions and taxes are ignored.

In Fig.2, logarithmic scale on the Fred axis has been applied to enable close inspection of the area of low Fred where the most attractive results are obtained -- and where more data points have been measured. To put Fig.2 in context, the maximum of predictability would lie at or near Fred=33. (Which happens to be the number currently used in Danica, which is why Danica is not the best system for this strategy.) This value of Fred is clearly not the maximum of profitability.

Naturally, higher allocation coefficients (consistent with higher leverage) result in higher profits.

Stability of the results is remarkably good -- indeed, based on the high stability of the forecasting quality for daily extremes, and given the fact that the strategy ignores the not-too-reliable forecast for daily close, this outcome is not surprising.

In the subsequent articles, the system will be elaborated, and the following, currently open, issues will be addressed:

  • What is it about the nature of the process under study, that is responsible for the difference in the location of the maximum of the Pearson correlation and the terminal wealth in simulated trading?

  • Which Fred value and what level of risk to take? The answer will involve the shapes of profit and loss distributions and not just Sharpe-like arguments on the basis of first and second moments: the profit and loss distributions (to be posted) have complex shape. Such distributions can not be adequately described by the first and second moments alone.

  • What about spreads? Since everybody pays different spreads, and spreads among brokers differ radically, arguably the best way to address the problem is to simulate several possibilities.

Bookmark with:

Deli.cio.us    Digg    reddit    Facebook    StumbleUpon    Newsvine
Last Updated ( Tuesday, 17 August 2010 14:36 )