Tuesday, June 23, 2015

MACD Divergence indicator for Thinkorswim TOS

Buy Now!

MACD Divergence indicator gives possible reversal signals when there are discrepancies between MACD and price movement.
 
Divergence emerges when price and oscillator indicator move in different directions. 


For instance, an uptrend Negative Divergence occurs when price reaches a higher high, but the indicator fails to follow. In a downtrend, positive divergence occurs when price reaches a lower low, yet the indicator does not reach a lower low.
For the most part, oscillator indicators and price trailing each other and move in the same direction. However, when they start to drift apart, the current trade may consolidate or exhibit a reverse pattern. 
 
Features:
  1. Alert: provide both sound and message alert whenever a divergence is found. You can turn it on or off.
     
  2. Length 1&2: Define the range of bars which are used to calculate the recent High and previous High, as shown in picture.
     
  3. MACD_mode: Choose "Upper" to only plot signal arrows on price chart.
    Choose "lower" it will plot as a MACD indicator with divergence signals.

     
  4. Percent: The difference between High1 and High2, as shown in picture. 
     
  5. MACD_Percent: The difference between MACD1 and MACD2, as shown in picture. 
     
  6. All Parameters of MACD: Adjust the inputs of MACD indicator.
     


How to use:
The purpose of divergence indicator is to point when price  trend are moving into  opposite direction.
Negative divergence:
First of all, we need to locate the recent High1 and its MACD1 value within the given range(lenght1).
Secondly, we find the previous High2 and its MACD2 value within the given range(lenght2).

Then we compare the ratio of these 2 Highs and MACD values to determine if they meet the percentage you set.

For example, if you set "percent=3", then it will check if High1 is greater than High2 by 3%. If you set "MACD percent=5" then it will check if MACD1 is less than MACD2 by 5%.
If both percent conditions are met, there will be a red arrow pointing downward.

Positive divergence:
The indicator will find the recent Low1 and its MACD1 value within the given range(lenght1).
And then it will find the previous Low2 and its MACD2 value within the given range(lenght2).

If you set "percent=1", then it will check if Low1 is less than Low2 by 1%. If you set "MACD percent=5" then it will check if MACD1 is greater than MACD2 by 5%.
If both percent conditions are met, there will be a green arrow pointing upward.


Please note: in order to plot this indicator on both price chart and lower chart, you need to load it in two places. And set MACD_mode to "Upper" in Price chart and MACD_mode to "lower" in Lower chart. As shown in the following picture.
If you want the same signals on both charts, all parameters have to be consistent on both sides.


This indicator works in any time period and applicable for all securities(Stocks, Futures, Forex, Options,ETF, etc.).
When you use this indicator in minute chart, it's better to set "percent" less than 1, otherwise, lots of signals will be filtered.

If you want to add any feature to this indicator, please send us a Customization request.









No comments:

Post a Comment