The Dealers Trade MACD Expert Advisor is an innovative VertexFX client side script that employs trend

reversal trading techniques based on the MACD indicator, along with advanced account protection mechanisms

during trade reversals.
This Expert Advisor identifies MACD divergence, whereby a BUYING opportunity is created when the MACD is

falling, but the price is rising. Since the price is rising, but the MACD is falling, eventually the MACD must rise,

and the potential of a bullish breakout is increased due to the feedback loop.
Similarly, a SELLING opportunity is created when the MACD is rising, but the price is falling. Eventually, the

MACD must fall, and the potential of a bearish breakout increases due to the feedback loop.
The Expert Advisor evaluates conditions for a BULLISH or BEARISH divergence. When a divergence

condition is detected, it places a trade in the direction of the divergence. For example, if MACD is rising, and the

price falling, a BEARISH divergence is formed. The Expert Advisor places a SELL trade at market price.
The take-profit and stop-loss are set accordingly.
In the likelihood that the price continues to fall, no further action is necessitated because the SELL trade is

profitable. The SELL trade is then managed using the trailing stop.
On the contrary, if the price continues to rise, the SELL trade is adversely affected, and at a loss. When this

SELL trade reaches a loss of PIPS (pips), and the BEARISH divergence still exists, a new SELL trade is opened.
This process continues till the SELL trades become profitable (some SELL trades may become profitable, while

the earliest opened SELL trades may not become profitable), or new SELL trades will be opened at a distance

of PIPS from the previous SELL trade, till the total number of SELL trades opened is equal to MAX_TRADES.
The lot-size of the new trade is multiplied by DOBLE of the previous trade’s lot-size. When the maximum

number of trades is reached, the robot does not open new trades – it waits for the stop-loss to hit, or for the

trades to turn profitable.
If a BULLISH divergence is detected while SELL trades are open, the robot does not close the open SELL

trades, but rather opens BUY trades with similar rules – each BUY trade is opened PIPS distance below the

previous BUY trade.
The BUY and SELL trades are tracked independently, and their profits are not combined. If

ACCOUNT_PROTECTION is enabled, then when the open profit of each leg (SELL or BUY)reaches

SECURE_PROFIT amount, then the stop-loss of all the trades in that leg are moved to the average price

(break-even) of that leg.

http://www.hybrid-solutions.com/plug...ade-macd-.html