Indicators DZ and RDZ: Essence, Methods of Calculation, Signals and Rules of Trading

Speculators exert more and more influence on prices on world exchange markets. Often the result of this is a formation of so-called “bubbles” with subsequent shocks to national and global economy. The purpose of speculators is earnings in a relatively short period of time using the differences in prices for exchange assets. Most of the speculators as a reference point for decision-making use technical analysis methods (prediction of future prices based on previous prices). Using more sophisticated methods gives advantage and opportunity to earn on a relatively short-term fluctuations in the exchange markets. General rules of technical analysis applied to all types of exchange markets – foreign exchange and stock markets, commodity markets and markets for derivative financial instruments. Thus, developing of a new technical indicator or trading strategy for FOREX (foreign exchange market) can be applied to analyze prices of gold or oil, stock indices and stock prices.


Introduction
Technical indicators of oscillatory class determine overbought/oversold zones and try to signal whether price is too high or too low. Most of them in calculating algorithm use price characteristics (high, low, open, close for a certain trading period). But, taking into account the main goal of oscillatory indicatorsdetermine overbought/oversold zones, trading range (difference between maximum and minimum price during certain trading period) is a better base for calculations. As a methodological base for calculation algorithm for oscillators can be used normal distribution and its rules.
So, this paper is devoted to developing of the alternative oscillatory indicator based on mentioned higher assumptions.

Incorporation of the current situation in the market in trading strategy
A serious weakness of many trading strategies is that they were formed in certain market conditions. Accordingly, strategy parameters and sometimes it's logic are determined by market conditions in which they were formed. The key parameters of any strategy are the entry point (price of exchange asset on which position is opened), profit per transaction (usually called "take profit") and maximum amount of losses per transaction (usually called "stop loss"). And if the entry point is determined by the strategy algorithm, take profit and stop loss are usually optimized in the process of strategy testing. However, the volatility dynamics of the market instruments, especially in the second half of Serhiy Kozmenko, Oleksiy Plastun, 2011.
2008 (see Figure 1) shows that the fixation of these parameters in a long period of time, almost for sure, makes any working strategy unprofitable. Changes in market conditions, submitted for example by the size of daily trading range, will lead to changes in the trading strategy parameters such as take profit and stop loss, because they depend on the level of volatility. As we can see from Figure 1, the average size of daily fluctuations is constantly changing. In the beginning of 2000's range of these fluctuations was not so big, but in 2008 it increased almost in two times (2008 is compared with 2007). That means, market conditions have changed and changed very much. So, trading strategy must be modified according to these new conditions.
Solution of this situation, we see in the definition of key parameters of a trading strategy depending on current market conditions. As an indicator of current market conditions may act the market volatility in the form of average daily range. To do this, statistical instruments can be applied.
In our opinion, only few indicators nowadays use statistical methods in their algorithmic, instead they use rather dubious assumptions and connections. In addition, a rare indicator gives clear and absolute parameters for trading (entry point, value of take profit and stop loss), because they work with the relative values. But these parameters are very essential for any trading strategy. According to this we have another very important point, which also does not take into account by current indicators and strategies, built on them, the market volatility. Under some conditions, a certain set of parameters of the trading strategy works well and can be chosen as a working one. However, once the conditions have changed, these parameters may quickly become unusable, and therefore strategy, based on them, become ineffective too.
It means, the indicator should (in ideal) generate the trading parameters according to the current market realities.

The idea of oscillator indicator based on statistical analysis
Most of these problems can be solved by applying statistical instruments as a base for construction the indicator (device or element, displaying the progress of the process or state of the object of observation, its qualitative or quantitative characteristics in a form suitable for human perception [7]), which would generate necessary parameters for the current state of the market and would react and modified accordingly to the current market conditions.
Classes of indicators that can satisfy these requirements are oscillators. Indicators of this class are actually responsible for the entry point [17]. Despite the fairly extensive study of this issue, we would like to propose an alternative (or more correctly -another) approach to the construction of oscillator indicator.
Today there is no common position on technical analysis and its methods. In our opinion, certain method is working only if it gives statistically significant results, for example the percentage of successful signals generated by a particular indicator, should exceed a certain value. However, each class of indicators works only in a particular type of market: oscillators are inefficient in case of trend, and trend indicators give a lot of false signals in case of flat. Usually critics of technical analysis, tend to ignore these provisions, analyzing the effectiveness of technical analysis methods. So analyzing the effectiveness of a certain indicator, we will take to consideration it's class and conditions in which it works.
The idea of proposed alternative oscillator indicator is in including market volatility in its algorithm. As a simple variant of volatility measuring we propose to use daily ranges of a certain market instrument (difference between maximum and minimum price during daily trading session) with further calculating of it's average range. Since the previous day's range is more important than the range month ago, we will use in calculations the weighted average formula. So the maximum weight will be assigned to the last value of the range, and minimum to the starting period (this may be a week or a month, depending on the indicator period).
As a minimum period of indicator, we propose to take a week (for the analysis -it is five days, since the data for Saturday and Sunday, is absent because of weekend).
Thus, formula for calculating of the average range will be as follows:

Normal distribution as a basis for the indicator's construction
The basis of proposed indicator is normal distribution, according to which the zone formed by the average value (standard deviation) covers 68% of the random variable values. For average value 3 it will be 99,7%. So, normal distribution gives us opportunity, based on a statistical analysis of daily range data (in our case volatility), to determine the likely range for today (with a certain probability of course). That gives great opportunities for intraday trading.
Before embarking on the practical application of the properties of normal distribution in trading, a few words about it and why it was chosen.
Normal distribution, also called the Gaussian distribution, is a probability distribution, where the resulting value can be affected by a large number of random factors [8].
Central limit theorem (CLT) states conditions under which the mean of a sufficiently large number of independent random variables, each with finite mean and variance, will be approximately normally distributed [5].
Random variable is a variable which value is determined by chance with certain probability [1].
A few words about the use of the notion "random variable" for market prices. Market prices are influenced by a large number of different factors: economical, political, natural, etc. Since the number of factors affecting the movement of prices is so big, their influence is so different that eventually movement acquires the character of random fluctuations (in a limited time frame). In addition, each market day provides an occasion to assert that reaction, at least within one day, of certain news can be quite unpredictable and does not conform to the classical understanding of the reaction to this type of news. For example, the publication of good economical data for the U.S. does not mean that the dollar will strengthen it can both rise or fall, or remain the same even without any serious changes.
The overall conclusion is that price fluctuations can be considered as random variables. Thus, the daily range is quite fit the description of random variable. Nevertheless, in order to confirm our logical calculations, we have analyzed the normality of daily ranges with the help of specially developed criteria.
Since the normal distribution is often encountered in practice, there are some special statistical tests on the normality: 1. Pearson's chi-square test; 2. Kolmogorov-Smirnov test; 3. Anderson-Darling test; 4. Jarque-Bera test; 5. Shapiro-Wilk test; 6. "graphical methods" not so much a criterion as a graphic illustration: points of a specially constructed graph should lie almost on one line [6].
To test daily ranges for normality we used the Pearson's chi-square test. To do this, we randomly selected 100 daily ranges of price changes for the period of 2006-2008 (Table 1). Thus, ranges obey to the normal distribution, so calculating zone "average range sigma (standard deviation)", we can actually evaluate even before the start of the day determine the upper and lower limit of price changes for today with a probability of 68% (according to the law of normal distribution). That is a good precondition for a future indicator. We named it "Diapasonium" or abbreviated as "DZ".

Algorithm of construction
There are two approaches to the construction of this indicator. The first one is in relative values (to name it we will use the abbreviation RDZ) and the second one is in absolute values (abbreviation DZ).
The data used to construct the indicator: Determination of the candle type (black or white) -Japanese candlestick is a price plotting technique that offers a quick and easy method of identifying the price movement of a currency pair [18]. Black candle describes downward motion, white -upward.
Thus, the view of the indicator is as follows (Figure 2) Graphically, it looks as follows ( Figure 3). As for the real embodiment of the indicator DZ, then it looks as follows ( Figure 4) (this figure is a screenshot from the trading platform MetaTrader, where the indicator DZ acts as a custom setting implemented by the author using the internal programming language MQ Language). As we can see from Figure 4, the indicator consists of three upper lines (sale zone (overbought): defining respectively (aver_dz -sigma_dz), (aver_dz) and (aver_dz + sigma_dz)); three lower lines (buy zone (oversold)): defining respectively (-aver_dz + sigma_dz), (-aver_dz), (-aver_dz -sigma_dz); middle line (determines the current range -TD).
Interpretation of indicator DZ is even easier -overbought zone begins from (aver_dz-sigma_dz), oversold zone -from (-aver_dz + sigma_dz). The main difference from RDZ signals is exit point, i.e. such parameters as stop loss (the maximum amount of losses for current transaction) and take profit (value of expected profit for current transaction). Stop loss is defined as exceeding the boundaries "aver_dz + 3×sigma_dz" (this value characterizes range as a highly anomalous, in terms of statistics, in this case a strong movement out of the general track is in market, so remaining in the position may significantly increase losses, therefore it must be closed). Take profit is defined as "1.5×aver_dz" (the magnitude of the average range, which roughly describes the size of the fluctuations required for entry into the opposite overbought/oversold zone).
Thus, we considered the basic approaches to the construction of indicators DZ and RDZ, reviewed the basics of working with them and suggested models of their view. However, the analysis would be incomplete without consideration of their effectiveness in comparison with the existing indicators of the oscillator class.

Testing
To assess the quality of proposed oscillator indicators, we compare the result of their work with the best known and most frequently used indicator of oscillator type -RSI (relative strengthen index) [12].
As a market instrument (asset) for the analysis, we chose currency pair EUR/USD. Trading platform MetaTrader was used as a testing tool. Algorithm of the indicators was implemented using the integrated programming language MetaLanguage (MQ language). Testing was carried out by imitation modeling in the MetaTrader. As the testing period, we chose 2010 as well as two months of 2011 in order to increase the representativeness of the sample. Testing period was divided into months (to analyze the behavior of the indicators on different types of market -uptrend, downtrend and flat). Parameters for the indicators: RSI period 14, DZ/RDZ period 9. The overbought/oversold zones: RSI 70/30, DZ -(aver_dz sigma_dz)/(-aver_dz + sigma_dz), RDZ +80/-80. Position is closed after reaching the opposite overbought/oversold zone for RSI and RDZ, for DZ -stop loss = 3×sigma_dz, take profit = 1.5×aver_dz.
Test results for RSI are presented in Table 2.
Results of the RSI indicator clearly point to its oscillatory nature it shows excellent results in flat market (up to 80% of successful transactions) and extremely unstable and poor results in a trend market (efficiency drops below 50%, sometimes reaching 0% of successful transactions number).
The overall financial result was -1,254 c.u. (continuous testing without division on months) and -1,770 c.u. (in case of monthly division -the sum of financial results for each month). The average loss per month was 126 with average probability of profitable position 46%. Conditional unit (c.u.) is U.S. dollars for the position volume of 10 000 USD. Note: * 2011 is presented by first two months.
The next stage of testing was to evaluate the performance of the indicator DZ. Results are presented in Table 3. Note: * 2011 is presented by first two months.
Behavior of the indicator DZ also clearly indicates it's oscillatory nature. Positive moment, in our opinion, are differences in results, which suggest that we have developed fundamentally different indicator. It differs not only in essence and method of calculation, but by the results of testing. Overall financial results are significantly better then RSI's results. Considering worst percentage of successful transactions (32% for DZ versus 46% for RSI) we can make conclusions about its significant potential in case of increasing percentage of successful transactions, that is quite possible by prohibiting indicator's signals in a trend market.
Despite the fact that principles of the indicators DZ and RDZ are identical (both are based on normal distribution), nevertheless, conditions of entry and exit the position are different, especially in case of maintenance of existing positions. Therefore, we made analysis of the indicator RDZ, which results are shown in Table 4. Note: * 2011 was presented by first two months.
Results of the indicator RDZ are quite different to results of DZ. It is largely associated with the moment of position closing, which fundamentally differs from DZ conditions. RDZ acts as a classical oscillator and closes the opened position at the op-posite overbought/oversold zone, without using the mechanism of stop loss and take profit, which were involved in the indicator DZ. In case of continuous testing (no monthly division), indicator showed the best results. At the same time using a monthly division the overall financial result was, on the contrary, the worst. This indicates on a high sensitivity of the algorithm to interfere in his work. At the same time the percentage of successful transactions averaged 58%, which is the best among the analyzed results.
The main conclusions after testing of indicators RDZ and DZ are in fact that each of them has its advantages, so combining them can be achieved synergy and test results will improve. We have proposed the following version of the hybrid indicator DZ/RDZ -position opening at the level of RDZ = 80, stop-loss = 3 * sigma_dz, take-profit = 1,5 * aver_dz. Tests showed the following results (Table 5). Note: * 2011 was presented by first two months.
As we can see, hybrid indicator shows better results: the percentage of successful transactions, the average result for the month, the financial result in case of a monthly breakdown and also when the continuous testing was used.
The comparison of the classical oscillator indicator RSI and proposed indicator (in this case it's hybrid DZ/RDZ) is presented in Table 6. Note: * 2011 was presented by first two months.
As we can see, the effectiveness of the hybrid version DZ/RDZ indicator is significantly higher than the results of the indicator RSI (financial result in case of a monthly division for DZ/RDZ indicator is -569 against -1770 for RSI). Average result per month for DZ/RDZ exceeds the average result of RSI in three times despite the fact that the percentage of successful transactions for RSI is higher. This statistic shows that DZ/RDZ better "understands" the market and is able to adapt to changes on the market.
At the same time, it is quite obvious that the use of this indicator in its pure form (as a final strategy) will not give proper effect. It is necessary to use trend indicators to enable/disable signals from the DZ/RDZ indicator.
The main advantage of this indicator is not increased probability of successful transactions, but the presence of clear guidelines for the construction of a trading strategy. The important thing is that these guidelines can be not only in relative values, but in absolute figures too, that gives clear instructions about stop-loss and take profit, which are very important for every trading strategy. For example, stop loss can be equated to three sigmas, so it covers 99.7% of the potential price values in the current daily range (which corresponds to essentially of stop loss it should be executed only in an emergency, abnormal situations), and take profit defined as the sigma multiplied by a certain factor, which can be determined by testing or as the value of the average range, adjusted for a certain ratio.

Summary and conclusion
Using the statistics as a base for indicator construction allows to reach some important things: consider the market changes, get clear values of main parameters of the trading strategy (stop loss, take profit), reach results which are better then existing analogues. As a base for indicator's algorithm may act normal distribution and its rules. Operating the values of average trading ranges (in our case daily ranges) and their standard deviations (sigmas) it is possible to predict (with certain probability) range of price fluctuation for current trading period. That gives good opportunities to build indicator of oscillator class with it's overbought/oversold zones, entry and exit points. We called this indicator DZ. Also we developed it's relative analogue -RDZ.
Acting as a typical oscillator, these indicators show better results then one of the best indicators of oscillator class -RSI (relative strength index). Testing shows that DZ, RDZ indicators better feel the market and faster adopt to it's changes and have even more oscillatory nature then RSI. The best way of using indicators DZ, RDZ is their hybrid version which shows the best results.
Finally, proposed indicator(s) can be used as a basis for the trading strategy, but with necessarily trend checking before generating the signal.