Expert Advisor for MT4 using MACD and TRIX Note to developers: PLEASE READ THE ATTACHED DOCUMENT FULLY TO ENSURE THAT YOU UNDERSTAND THE WHOLE BRIEF. PLEASE RESPOND ONLY IF YOU ARE CERTAIN THAT YOU CAN COMPLETE THE BRIEF. PLEASE ALSO LOOK AT THE ACCOMPANYING SCREEN SHOTS WHICH ILLUSTRATE THE CONCEPT. Rules Values marked [xx] are variables set by the user in EA settings. Indicators used: MACD Settings: Fast EMA [13] Slow EMA [21] SMA [1] Trix Trix period [13] Signal period [3] Rules Please see the attached screenshots which explain clearly where the entry signals are. Establishing the Trend The MACD at a higher time frame typically [H4] is used to establish the trend. An UP trend is in place when the MACD histograms cross above zero. An DOWN trend is in place when the MACD histograms cross below zero. BUY trades are only entered whilst the trend established at the higher time frame is UP. SELL trades are only entered while the trend established at the higher time frame is DOWN. Entry signal Enter a BUY trade while the trend established at the higher time frame is UP, and The Trix line crosses up through its signal line, irrespective of its value. Enter a SELL trade while the trend established at the higher time frame is DOWN, and The Trix line crosses down through its signal line, irrespective of its value. Trade Management Number of Trades per signal When a signal to trade is given, open up to 2 trades if lot size (below) or equity are both not zero. If the lot size and the equity factor are both zero, do not open that trade. The Two trades: Trade 1: SWING TRADE Lot sizing: [0.01] fixed manually by user OR (if manual lot size = 0), Auto lot size calculation: Auto lot account equity per 0.01 lots: [500] Take Profit: Take Profit and close trade at [0.50%] of equity. If the equity % figure is set at 0, there is no Take Profit set. So, as an example, if the account equity is 1000 euros and the Take Profit setting is 0.5%, then the trade would hit its Take Profit and close at 5 euros. If the account equity was 1000 euros and Take Profit setting was 3.0%, then the trade would close at 30 euros. Stop Loss: Set initial stop loss? [true / false] Initial stop loss distance [25] pips . Trailing stop Use trailing stop? [true / false] Start trailing at [xxx] pips Trailing step [xx] pips Break even protection: Use break even protection? [true / false] When trade is [15] pips in profit, move the initial stop loss to break even plus [1 pip]. Trade exit. One of the following: * Manually * The Trix line closes below the trailing MA (for a BUY trade) * The Trix line closes above the trailing MA (for a SELL trade) * Hitting the stop loss or trailing stop described above * Hitting a predefined Take Profit level Trade re-entry in the same direction: Allow re-entries if stopped out by the Trix whilst the trend remains in place? [true / false] Trade 2: SCALP TRADE Lot sizing: [0.01] fixed manually by user OR (if manual lot size = 0), Auto lot size calculation: Auto lot account equity per 0.01 lots: [500] Take Profit: Take Profit and close trade at [0.25%] of equity. If the equity % figure is set at 0, there is no Take Profit set. Stop Loss: Set initial stop loss? [true / false] Initial stop loss distance [25] pips . Trailing stop Use trailing stop? [true / false] Start trailing at [xxx] pips Trailing step [xx] pips Break even protection: Use break even protection? [true / false] When trade is [15] pips in profit, move the initial stop loss to break even plus [1 pip]. Trade exit. One of the following: * Manually * The Trix line closes below the trailing MA (for a BUY trade) * The Trix line closes above the trailing MA (for a SELL trade) * Hitting the stop loss or trailing stop described above * Hitting a predefined Take Profit level Trade re-entry in the same direction: Allow re-entries if stopped out by the Trix whilst the trend remains in place? [true / false] Settings, Filters and other user options Trade limits Limit the number of open trades to [5] pairs of trades (5 signals) (Once this number of trades is open, do not open any more new trades, irrespective of trade signals) Candle size “Spikes” in candles can distort patterns, so I would like two optional filters, one for a trade signal and the other for closing a trade. The measurement here is the distance in pips between the open price and the close price. Use candle size filter for trade entry? [true / false] “Spike candle” entry filter: If the candle which triggers the sell signal is more than [25] pips, do not enter the trade. Use candle size filter for trade exit? [true / false] “Spike candle” close trade filter: If, while in a trade, a candle is more than [25] pips, close the trade at the close of the candle. Days and times to trade: Monday: Don’t open a new trade before [09:00] Don’t open a new trade after [22:00] Tuesday: Don’t open a new trade before [09:00] Don’t open a new trade after [22:00] Wednesday: Don’t open a new trade before [09:00] Don’t open a new trade after [22:00] Thursday: Don’t open a new trade before [09:00] Don’t open a new trade after [22:00] Friday: Don’t open a new trade before [09:00] Don’t open a new trade after [22:00] High Impact news events: Don’t open trades within [1 hour] before and [2 hours] after a big news event. (These high impact news events: https://www.dailyfx.com/economic-calendar#today) Magic Number: xyz