Trend indicators are primarily used to identify the direction of a security by smoothing the volatility of the price action. These indicators are usually referred to as lagging indicators because their calculation is based on past price data. The most known trend indicator is the moving average; there are several types of moving averages such as the simple, exponential, double or weighted moving average. But there are also many other trend indicators used by technical analysts. These technical indicators usually get one or several periods for their internal calculations. Higher period values are used for long-term analysis while low period values are used for short-term analysis. Moving Average As we previously said, the moving average is the best known indicator to detect trends. It is simply the average of the N-previous bars. There are several ways to use the moving average; we could detect the crossover of a moving average with another one, or the crossover of a moving average with the price series... Example of rules using QuantShare: cross(close, sma(25)) cross(sma(25), sma(50)) Directional Movement Index (DMI) By comparing today's high and low prices against previous day's high and low, the DMI is a technical indicator that measures the direction and strength of a trend. DMI is based on the theory that says that an uptrend is formed by higher highs and a downtrend is formed by lower lows. Example of rule using QuantShare: cross(Plus_Dm(14), Minus_Dm(14)) Average Directional Index (ADX) The average directional index shows the strength of a trend. ADX indicates a moderate strength trend when its value is above 30. It shows a strong trend if the value is above 40. In that case, the trend is likely to continue. Note that the ADX is part of the DMI indicator and as we said it shows the strength of a trend but it doesn't indicate the direction of the trend. Example of rules using QuantShare: adx(14) > 40 adx(14) > 40 and cross(Plus_Dm(14), Minus_Dm(14)) Aroon Indicator The aroon indicator is made up of two lines. The "Aroon up" measures the strength of the uptrend and the "Aroon down" measure the strength of the downtrend. Each line calculates, in percentage, the time it takes the price to reach the highest or lowest point in a given time period. Example of rules using QuantShare: cross(AroonUp(14), 50) Percentage Price Oscillator The percentage price oscillator or PPO shows the difference, in percentage, of two exponential moving averages. It is very helpful particularly when comparing stocks together. You can for example use it to create market composites or to rank stocks in your trading system. Example of rules using QuantShare: ppo(14, 50, _MaSma) > 5 => The short term moving average is 5% above the medium-term average. How to create a list of trading rules Now that we have listed few trend indicators, let us create a list of rules. To create a new list of rules, select "Analysis" then "Rules Manager". In the new control, click on "Create", type the list of rules name then select that list from the "List of Rules" panel. Use, the right control to add trading rules. You can add the rules have described in the above examples and of course you can add trading rules based on other trend indicators. A list of rules containing the above example can be downloaded here: Trading Rules using Trend Indicators More technical indicators can be created by using masks and optimizing the different parameters. Here is how to do that: How to create and backtest thousands of trading rules in less than 10 minutes How to analyze each trading rule individually While you are still using the "Rules Manager" control, select your list of rules then click on "Analyze the list". Select the list of stocks or securities to analyze as well as the start/end dates and the time frame (daily, weekly or intra-day). Click on "Continue" to start analyzing each trading rule individually. It is also important to define an exit rule. For this, select "Outputs" tab in "Rules Analyzer Settings" form, click on "Select Outputs/Exit rules". To define an N-bar stop (For example: Enter when the rule is true and exit after 10 bars), select "Performance, use N-Bars stop", click on "Add" then set "10" under "Number of bars" column. Click on "OK" to save your settings. Note that you can define several exit rules. In that case, for each trading rule, you will get several reports; one for each exit rule. Each exit rule is analyzed individually. Once completed, you will have a better idea of which trading rule performs well. You can also create a new list of rules based on the top performing ones. More info: Introduction to the trading rules analyzer How to select the best combination of trading rules for your trading system The last step would be to include one or several of these trading rules into your trading system. You can even perform an optimization looking for the best rule or combination of trading rules that has the best performance. The following blog posts show you how to add trading rules into a trading system and how to optimize them: How to choose which technical indicators to use in your trading system How to turn any ordinary trading strategy into a very profitable one The opposite of a trending market is referred to as a ranging market. In a future post, we will write about how to detect ranging markets and which indicators to use for that.
|