find elusive macd divergences easily - back · pdf filefind elusive macd divergences easily...

18
1 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm. Find Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts ® Workspace After following these instructions, you will have Charts displaying MACD lines and histogram which highlight price/indicator divergences Color-coded price bars indicating buy and sell signals similar to the back-tested strategy Scans to show which stocks in your symbol list got a buy signal and a sell signal Easy Language® signals implementing the best of the strategies tested by BackTesting Report o Note: Implementation modified to back-test one market at a time. Bonus Charts, Signals, and Scans which implement other common MACD strategies The MultiCharts Workspace applies what you learned in the companion BackTesting Report. You can further your education about MACD by Seeing the strategies in action on your favorite charts Tweaking the strategy to add your own rules Check results over your own dates and stocks with Strategy Performance Report Forward testing by tracking buy and sell signals as they occur in the future To understand MACD Divergences and their hypothetical past performance see the Backtesting Report titled “Finding Big Bottoms with MACD Bullish Divergences”. Before actually investing with these strategies, you are strongly advised to read the MACD BackTesting Reports, consider the risk of loss, maybe even consult a professional for advice. Ultimately, you make your own decisions about your own money. Install MultiCharts If you don’t already have MultiCharts, you will need to download and set it up. Please see multicharts.com for more information. The custom software from BackTesting Report supports version 7.4 or later. HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN.

Upload: dinhnhi

Post on 06-Feb-2018

250 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

1 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

Find Elusive MACD Divergences Easily Test this and other MACD Strategies

By using a Custom MultiCharts® Workspace After following these instructions, you will have Charts displaying MACD lines and histogram which highlight price/indicator divergences Color-coded price bars indicating buy and sell signals similar to the back-tested strategy Scans to show which stocks in your symbol list got a buy signal and a sell signal Easy Language® signals implementing the best of the strategies tested by BackTesting

Report o Note: Implementation modified to back-test one market at a time.

Bonus Charts, Signals, and Scans which implement other common MACD strategies The MultiCharts Workspace applies what you learned in the companion BackTesting Report. You can further your education about MACD by Seeing the strategies in action on your favorite charts Tweaking the strategy to add your own rules Check results over your own dates and stocks with Strategy Performance Report Forward testing by tracking buy and sell signals as they occur in the future To understand MACD Divergences and their hypothetical past performance see the Backtesting Report titled “Finding Big Bottoms with MACD Bullish Divergences”. Before actually investing with these strategies, you are strongly advised to read the MACD BackTesting Reports, consider the risk of loss, maybe even consult a professional for advice. Ultimately, you make your own

decisions about your own money.

Install MultiCharts

If you don’t already have MultiCharts, you will need to download and set it up. Please see multicharts.com for more information. The custom software from BackTesting Report supports version 7.4 or later.

HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN.

Page 2: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

2 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

Install BackTesting Report Custom WorkSpace and EasyLanguage® Scripts

1. Download the file BTR_All_MultiCharts.exe After agreeing to license terms, download and unzip according to the instructions below. This package contains two file types. Import the BTR_ALL_PORTABLE.ELD file into MultiCharts and put all the .wsp files in a folder where they are easy for you to find. The instructions below apply to the BTR_All_MultiCharts.exe file you download in this step.

Internet Explorer: Run download directly

Or for Firefox: Save the file to your desktop and then double-click it to Run.

a. Click Browse to select an location easy location like a folder on your Desktop

b. Click the Unzip Button to place the files in the folder you just selected in step c.

c. Click OK and then Close. The number of files may be more if you are installing a version with more features than when this document was written. The downloaded files will be in a folder called BTR_All_Multicharts in the location you chose.

Page 3: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

3 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

2. Import the ELD files into MultiCharts (before opening the workspaces). Open

MultiCharts and then open the PowerLanguage Editor by clicking its icon on the toolbar:

3. Choose Import from the File menu and navigate to your downloaded BTR_All_MultiCharts folder:

Page 4: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

4 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

4. Select the ELD file and click Open

5. Then click OK on the resulting dialog boxes. Again, the number of files may vary.

Page 5: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

5 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

6. Select Compile->All Uncompiled from the menu

7. On the MultiCharts menu, click File->Open WorkSpace, navigate to your downloaded BTR_All_MultiCharts folder and choose BTR_MACDL_Div.wsp, or BTR_MACDH_Div.wsp,

etc.

8. The workspace will appear with a large chart window open as shown in Figures 1 below.

Figure 1-MultiCharts Screenshot of MACDL_Div workspace

Page 6: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

6 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

Understanding the MACD Divergence Workspaces and Strategy

All workspaces included in this package follow the same general layout. The price is plotted in the top portion of the chart window. Positive divergences are color-coded green, and negative divergences are marked in red. The neutral-colored bars are ignored in this strategy. The indicator below the chart is the MACD. Most strategies are installed with the standard MACD settings of 12,26,9 lines and histogram. The BTR_MACDL_Div_Pwr strategy relies on the 12,26,9 MACD Lines and the slower 19,39,9 MACD. If present, the bottom indicator is volume. A buy signal only takes place if volume is above the threshold set as an input. The units are hundreds of shares, so a setting of 5000 is 500,000 shares. If you change the timeframe on the chart, you probably want to adjust this parameter in the strategy, PaintBars, ShowMes, and indicators. When a divergence is detected at the right edge of the chart, an alert is given, and text instructions printed on the chart. The instructions include suggestions for a stop loss and trade size. These suggestions are based on the input settings for risk_amt (in dollars) and ATR_factor. The stop loss is calculated by multiplying the ATR by the ATR_factor and subtracting from the long entry price (or adding to a short entry price). The entry price is estimated as the closing price of the current bar. Unless otherwise noted, the strategy enters at market on the next bar so the actual entry price will vary. The size suggestion is calculated as the number of shares that will put risk_amt in play, assuming the calculated stop loss. The stop price for the life of the trade is calculated based on the average true range (ATR) on the day of the buy signal. It is held constant and displayed above the price for the life of the trade. The blue arrows and blue dotted lines are the MultiCharts back-testing engine simulated trades. The number of shares is based on the risk amount and stop input factors. Unless otherwise noted, the strategies are all long-only, meaning that they buy on positive divergences and sell on negative divergences. The indicators, PaintBars, and ShowMes will mark positive and negative divergences equally.

MACD Lines Divergences

The BTR_MACDL_Div workspaces and EasyLanguage code detects divergences on the MACD Lines. This is the most general of the workspaces, and a good place to start getting familiar with MACD and this software. The definition of divergence is taken from Gerald Appel – the inventor of the MACD. It requires that is that price makes a higher high (or lower low) which is not confirmed by the MACD line. It also requires the MACD line below zero for positive divergence and above zero for negative divergence. It places no requirements on crossing the zero line or lines crossing each other. The example in Figure 2 shows both positive and negative divergences marked on the price history.

Page 7: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

7 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

Figure 2 - TradeStation Screenshot of MACDL_Div workspace

MACD Histogram Divergences

The BTR_MACDH_Div series of workspaces and EasyLanguage code detect divergences on the MACD Histogram. The definition of divergence is taken from Dr. Alexander Elder. The histogram is the difference between the MACD line and its signal line. The definition of divergence is that price makes a higher high (or lower low) which is not confirmed by the MACD Histogram. The MACD lines must be below zero for positive divergence and above zero for negative divergence. The MACD Histogram must “break the back of the bear” (or bull) between humps of the divergence. For a positive divergence, this means that the histogram begins below zero and crosses above zero before the price low. At the point of the price low, the histogram may be either above or below zero. Likewise for a negative divergence, the histogram must start above zero and cross below zero at least once. See Figure 3.

Figure 3 - Screenshot of MACDH_Div workspace

Page 8: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

8 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

MACD Power Tools Divergences

The BTR_MACDL_Div_Pwr strategy refers to the 50-day ema to decide the settings for the MACD. If price is above the 50 DEMA, it uses the 12,26,9 MACD Lines to detect positive divergences. If price is below the 50 DEMA it uses the slower 19,39,9 MACD lines settings to detect positive divergences. The slower settings are always used to detect negative divergences. Note in Figure 3 that the MACD lines are plotted as Appel’s Histogram. You may plot the MACD line as Appel’s Histogram by selecting the MACD line, right-click, choose Format ‘MACD’, click the Style tab, select Plot of MACD and Type of Histogram.

Figure 3 - Screenshot of MACDL_Div_Pwr workspace

Fuzzy Divergences

While the other strategies take a hard-line approach to detecting divergences, the BTR_MACDL_Fz_Div strategy allows for more flexibility. It defines a divergence as a double bottom or double top where the price does not necessarily hit a new low or new high. If the price is sufficiently close it will treat it as a double bottom (or top) and check for confirmation of reversal from the MACD lines. For example, see Figure 4. The positive divergence detected on MSFT in September of 2011 is what we call a fuzzy divergence. The price did not come all the way back down to test the lows of July but did come close enough to flag a divergence since the other conditions were present (MACD lines below zero and rising with MACD above signal line).

Page 9: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

9 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

Figure 4 - Screenshot of MACDL_Fz_Div workspace You decide how close is close enough by setting inputs to the MACDL_Fz_Div Strategy, Indicator, PaintBar, and ShowMe. The units are Average True Range (ATR) – a measure of volatility of each individual market. Control how far the local low is from the price at macdl low for a positive divergence with two parameters:

1. Low_bound_pos : the allowed multiple of ATR below the low - makes sure price is not too low

set to 0 to require the local low is higher than the price at macdl low

set to +1 to limit a local low to within 1 ATR lower than the price at macdl low

set to + 2 to limit a local low to within 2 ATR lower than the price at macdl low 2. Upper_bound_pos: the multiple of ATR above the low - makes sure the price is low

enough

set to 0 to require a new low of any kind

set to +1 to require a local low within 1 ATR higher than the price at macdl low

set to + 2 to require a local low within 2 ATR higher than the price at macdl low

set to -1 to require the local low to be 1 ATR lower than the price at macdl low (can be used to wait for more significant divergences in down markets)

DO NOT Set BOTH to 0 ... or nothing will qualify Control how far the local high is from the price at macdl high for a negative divergence with two parameters:

1. Low_bound_neg : the allowed multiple of ATR below the high - makes sure price is not too low

set to 0 to require the local low is higher than the price at macdl low

set to +1 to limit a local high to within 1 ATR lower than the price at macdl high

set to + 2 to limit a local high to within 2 ATR lower than the price at macdl high

set to -1 to require the local high to be 1 ATR high than the price at macdl high (can be used to wait for more significant divergences in up markets)

Page 10: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

10 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

2. Upper_bound_neg: the multiple of ATR above the high - makes sure the price is low enough

set to 0 to require a high of any kind

set to +1 to require a local high within 1 ATR higher than the price at macdl high

set to + 2 to require a local high within 2 ATR higher than the price at macdl high DO NOT Set BOTH to 0 ... or nothing will qualify

Volume Surge and Divergences

Extensive backtesting showed that a volume surge in conjunction with a divergence reduced the win rate of the divergence, especially for positive divergences. The BTR_MACDL_V_Div allows you to filter out divergences when the volume exceeds the average. The moving average of volume is calculated according to Vmalength. If the volume at the low or high for positive or negative divergences respectively exceeds the average multiplied by the input surge_pos or surge_neg, the divergence is ignored.

Figure 5 - Screenshot of MACDL_V_Div workspace.

Basic MACD Signals in MACDH_MA Workspace

The captions on the chart in Fig. 6 below show the buy and sell signals of this strategy. Note that this screenshot is NOT representative of the past performance of the MACDH_MA strategy. Mechanical trading of this the MACDH_MA strategy is NOT recommended. For exactly what is implemented in this strategy, and it’s hypothetical past performance, see the MACD Sell Signals Backtesting Report.

Page 11: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

11 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

Figure 6 - Screenshot of MACDH_MA workspace

Missing Link Between MA and MACD

On the price chart, buy signals from moving averages crossing upwards are green. Sell signals from moving averages crossing downwards are red and sell signals from the price falling below the 200 day MA are not shown. The neutral-colored bars are ignored in this strategy. See Fig. 7. The stop price for the life of the trade is calculated based on the average true range (ATR) on the day of the buy signal. It is displayed above the price for the life of the trade. To reposition it for readability, left click to select it and drag it to where you want it.

Figure 7 - Screenshot of Missing_Link workspace

Page 12: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

12 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

The middle indicator is the MACD lines and histogram. Note how the MACD lines cross zero at the same time that the moving averages in the top pane cross each other. Alerts are set on the PaintBar. MultiCharts will signal when the MACD lines cross zero.

Golden Cross

On the price chart, Golden Cross buy signals are green bars, Death Cross sell signals are red bars. The neutral-colored bars are ignored in this strategy, so if you are already in a position you hold and if not just stand aside. The stop price for the life of the trade is calculated based on the average true range (ATR) on the day of the buy signal. It is displayed above the price for the life of the trade. To reposition it for readability, left click to select it and drag it to where you want it.

Figure 8 - Screenshot of Golden_Cross workspace To understand exactly what is implemented in this strategy and it’s hypothetical past performance see the Golden Cross and Stop Loss Backtesting Report.

Important Note:

Neither these strategies nor their documentation are a recommendation to buy or sell any securities. It is a way to learn more about the stock market and technical indicators. These example screenshots were chosen to illustrate the concepts. The trades are not always profitable.

Page 13: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

13 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

Alerts

TradeStation Alerts are enabled on the PaintBar analysis technique. Alerts can be enabled on the ShowMes and Indicators as well. MultiCharts will audibly tell you when a divergence is detected on the last bar of the chart. The settings can be changed on the Alerts tab of the Format Indicators dialog box. For more information, see the MultiCharts documentation on the use of alerts.

Using the MultiCharts Scanner to Find MACD Divergences

You can use the custom Indicators in this package with the MultiCharts Scanner to detect MACD Divergences occurring in a list of symbols. Open Workspace BTR_MACD_Div_Scanner for an example of a scan that looks for MACD lines divergences and MACD histogram divergences.

Figure 9 – Screenshot of BTR_MACD_Div_Scanner workspace, scanner window The scan results are displayed as a column of numbers. “-9999” indicates no divergence detected. A positive number indicates a positive divergence and, in most cases, the number is the position size calculated using the risk amount and the ATR stop distance given as inputs (defaults are $1000 and 3 ATR respectively). A red “0.00” or a negative price indicates a negative divergence.

Page 14: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

14 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

Advanced Instructions

Changing Parameter Settings

To change parameter values of the strategy: 1. Right click on the chart 2. Choose Format Signals 3. Click the Format button 4. Change parameters as desired

Parameter definitions for the MACD Lines Divergence (BTR_MACDL_Div) and MACD Histogram Divergence (BTR_MACDH_Div) ELD modules in the MACD Divergence Detector are: Parameter Default

Setting Description

risk_amt 100 Dollars to risk per trade. Influences stop loss and size calculations.

min_volume 1 Minimum acceptable volume to enter. Set this to a low number for intra-day charts and a high number for daily, weekly, monthly charts.

atr_factor 3 Multiple of Average True Range (ATR) for stop distance

atr_len 20 Number of bars to collect data for ATR

sep_len 6 Bars between the humps of MACD to check for a divergence

extreme_period 50 Look-back period. How many bars to check backwards for a divergence

macd_fast 12 Number of periods to use for fast EMA in MACD Line calculation

macd_slow 26 Number of periods to use for slow EMA in MACD Line calculation

SigLen 9 Number of periods to use for EMA in Signal Line calculation

Page 15: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

15 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

Parameter definitions for the Power Tools (BTR_MACDL_Pwr_Div) ELDs: Parameter Default

Setting Description

risk_amt 100 Dollars to risk per trade. Influences stop loss and size calculations.

min_volume 1 Minimum acceptable volume to enter. Set this to a low number for intra-day charts and a high number for daily, weekly, monthly charts.

atr_factor 3 Multiple of Average True Range (ATR) for stop distance

atr_len 20 Number of bars to collect data for ATR

sep_len 6 Bars between the humps of MACD to check for a divergence

extreme_period 50 Look-back period. How many bars to check backwards for a divergence

MA_period 50 Price must be above this EMA to use medium MACD settings

macd_fast_med 12 Number of periods to use for fast EMA in medium MACD Line calculation (used for entries)

macd_slow_med 26 Number of periods to use for slow EMA in medium MACD Line calculation (used for entries)

macd_fast_slow 19 Number of periods to use for fast EMA in slow MACD Line calculation (used for exits)

macd_slow_slow 39 Number of periods to use for slow EMA in slow MACD Line calculation (used for exits)

SigLen 9 Number of periods to use for EMA in Signal Line calculation

Parameter definitions for the Fuzzy MACD Lines Divergence Detector (BTR_MACDL_Fz_Div) ELDs: Parameter Default

Setting Description

risk_amt 100 Dollars to risk per trade. Influences stop loss and size calculations.

min_volume 1 Minimum acceptable volume to enter. Set this to a low number for intra-day charts and a high number for daily, weekly, monthly charts.

Lower_bound_pos 1 Multiple of ATR below the low to control the range of acceptable positive divergences

Upper_bound_pos 1 Multiple of ATR above the low to control the range of acceptable positive divergences

Lower_bound_neg 1 Multiple of ATR below the high to control the range of acceptable negative divergences

Upper_bound_neg 1 Multiple of ATR above the high to control the range of negative divergences

atr_factor 3 Multiple of Average True Range (ATR) for stop distance

atr_len 20 Number of bars to collect data for ATR

sep_len 6 Bars between the humps of MACD to check for a divergence

extreme_period 50 Look-back period. How many bars to check backwards for a divergence

macd_fast 12 Number of periods to use for fast EMA in MACD Line calculation

macd_slow 26 Number of periods to use for slow EMA in MACD Line calculation

SigLen 9 Number of periods to use for EMA in Signal Line calculation

Page 16: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

16 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

Parameter definitions for the Volume-Aware MACD Lines Divergence Detector (BTR_MACDL_V_Div) ELDs: Parameter Default

Setting Description

risk_amt 100 Dollars to risk per trade. Influences stop loss and size calculations.

min_volume 1 Minimum acceptable volume to enter. Set this to a low number for intra-day charts and a high number for daily, weekly, monthly charts.

surge_pos 1.5 Volume surge on positive divergences is defined as surge_pos times the VmaLength EMA of volume

surge_neg 1.5 Volume surge on negative divergences is defined as surge_neg times the VmaLength EMA of volume

VmaLength 20 Length of EMA for volume surge measurement

atr_factor 3 Multiple of Average True Range (ATR) for stop distance

atr_len 20 Number of bars to collect data for ATR

sep_len 6 Bars between the humps of MACD to check for a divergence

extreme_period 50 Look-back period. How many bars to check backwards for a divergence

macd_fast 12 Number of periods to use for fast EMA in MACD Line calculation

macd_slow 26 Number of periods to use for slow EMA in MACD Line calculation

SigLen 9 Number of periods to use for EMA in Signal Line calculation

Parameter definitions for the Basic MACD Signals (BTR_ MACDHMA_ATR) ELDs: Parameter Default

Setting Description

risk_amt 100 Dollars to risk per trade. Influences stop loss and size calculations.

min_volume 1 Minimum acceptable volume to enter. Set this to a low number for intra-day charts and a high number for daily, weekly, monthly charts.

atr_factor 2 Multiple of Average True Range (ATR) for stop distance

atr_len 20 Number of bars to collect data for ATR

MA_trend 200 Bars between the humps of MACD to check for a divergence

macd_fast 12 Number of periods to use for fast EMA in MACD Line calculation

macd_slow 26 Number of periods to use for slow EMA in MACD Line calculation

macd_fast_exit 19 Number of periods to use for fast EMA in MACD Line calculation

macd_slow_exit 39 Number of periods to use for slow EMA in MACD Line calculation

SigLen 9 Number of periods to use for EMA in Signal Line calculation

Page 17: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

17 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

Parameter definitions for the Missing Link Between MACD and MA (BTR_Missing_Link) ELDs: Parameter Default

Setting Description

risk_amt 100 Dollars to risk per trade. Influences stop loss and size calculations.

min_volume 1 Minimum acceptable volume to enter. Set this to a low number for intra-day charts and a high number for daily, weekly, monthly charts.

atr_factor 2 Multiple of Average True Range (ATR) for stop distance

atr_len 20 Number of bars to collect data for ATR

MA_trend 200 Bars between the humps of MACD to check for a divergence

macd_fast 12 Number of periods to use for fast EMA in MACD Line calculation

macd_slow 26 Number of periods to use for slow EMA in MACD Line calculation

SigLen 9 Number of periods to use for EMA in Signal Line calculation

Parameter definitions for the Golden Cross (BTR_Golden_Cross) ELDs: Parameter Default

Setting Description

risk_amt 100 Dollars to risk per trade. Influences stop loss and size calculations.

min_volume 1 Minimum acceptable volume to enter. Set this to a low number for intra-day charts and a high number for daily, weekly, monthly charts.

surge_pos 1.5 Volume surge on positive divergences is defined as surge_pos times the VmaLength EMA of volume

surge_neg 1.5 Volume surge on negative divergences is defined as surge_neg times the VmaLength EMA of volume

VmaLength 20 Length of EMA for volume surge measurement

atr_factor 3 Multiple of Average True Range (ATR) for stop distance

atr_len 20 Number of bars to collect data for ATR

sep_len 6 Bars between the humps of MACD to check for a divergence

extreme_period 50 Look-back period. How many bars to check backwards for a divergence

macd_fast 12 Number of periods to use for fast EMA in MACD Line calculation

macd_slow 26 Number of periods to use for slow EMA in MACD Line calculation

SigLen 9 Number of periods to use for EMA in Signal Line calculation

BackTesting

The strategy back test is enabled. The results summary is available from the menu: View->Strategy Performance Report. See MultiCharts documentation for complete information on how to read the strategy report.

Workspace Settings

1. Right-click on the chart and select Format Signals. On the Signals tab, click the “Properties” button at the bottom right.

a. In the middle, you can increase the “Maximum Number of Bars Study Will Reference”. For each Signal, it starts out at the minimum required.

Page 18: Find Elusive MACD Divergences Easily - Back  · PDF fileFind Elusive MACD Divergences Easily Test this and other MACD Strategies By using a Custom MultiCharts

18 Copyright 2012 Own Mountain Trading Company. TradeStation and EasyLanguage are trademarks of TradeStation Group, Inc. Material intended for educational purposes, not investment advice. http://www.backtestingreport.com/termsofuse.htm.

b. In the upper left corner, set the commission assumption. $0.005 per share is set for backtesting or you can set your own value.

2. The Alerts are coded into Paint Bar EasyLanguage. To turn on/off Alerts, on the Format Analysis Techniques tab,

a. Select the Paint Bar (name ends in _PB) b. Click the Format button c. Select the Alerts tab d. Check/uncheck the box marked Enable Alerts e. Click Ok f. Click Close