Description
The MACD-Cross EA buys and sells depending on the relationship of the MACD main line to the MACD signal line. The Moving Average Convergence Divergence (MACD) indicator is a trend following momentum indicator.

Buying Logic
When the MACD main line crosses above the MACD signal line a buy trade is opened.

Note: Trades are closed with a stop or a limit, whose price is defined by the user. All trades open at the close of the current candle. Only one trade at a time is opened, regardless of the number of crossovers that occur.

Selling Logic
When the MACD main line crosses below the MACD signal line a sell trade is opened.

Note: Trades are closed with a stop or a limit, whose price is defined by the user. All trades open at the close of the current candle. Only one trade at a time is opened, regardless of the number of crossovers that occur.

Inputs
The following inputs are available in the EA’s properties window and can be defined by the app user:

1. Money Management Inputs
MagicNumber: A unique identifier that allows the EA to account for and manage its trades
LotSize: The number of lots traded
MaxDeviation: The maximum slippage allowed (in pips)
StopLoss: The stop price, as defined by a number of pips away from the open price
TakeProfit: The take profit price, as defined by a number of pips away from the open price

2. Indicator Inputs
MACD_Fast_EMA: The number of periods used to calculate the “fast” Exponential Moving Average value
MACD_Slow_EMA: The number of periods used to calculate the “slow” Exponential Moving Average value
MACD_SMA: The number of periods used to calculate the Simple Moving Average of the MACD (signal line)
ExtendCross: The minimum number of pips between the MACD main line and the MACD signal line, when a crossover occurs, before a signal to buy or sell is created.

Requirements
This Expert Advisor (EA) is only compatible with FXCM MetaTrader 4 software. It does not operate on MetaTrader 4 software provided by any other brokerage. Additionally, an FXCM account is required (including free FXCM demo accounts).

Download MACD-Cross