Работа завершена
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Техническое задание
I need an indicator which would generate a trading signal when a certain conditions on a chart with 3 MA is met.
It's better to explain a trading setup by an example.
Indicators used:
20, 50, 200 MA.
Prerequisites for a long signal:
1. 20 MA is above 50 MA, 50 MA is above 200 MA.
Signal market condition: The price goes below the 20 EMA, and, WITHOUT closing below 50 EMA, gets back and closes ABOVE 20 EMA again.
If the price goes and closes above the 50 MA, the setup is INVALIDATED.
The candle which crosses 20 EMA back is our signal candle.
Everything is vice versa for short signals.
Signal examples:
What needs to be configurable:
1. 1,2,3 MA's calculation type (weighted, simple, exponential) and period.
2. The distance between MA's in ATR values (e.g. if the distance between 1 MA and 2 MA is LESS than 1 ATR -- the signal should not be produced).
2.1. The distance between 1 and 2 MA;
2.2. The distance between 2 and 3 MA:
2.3. If the distance is set to 0, the only thing that matters is that one MA is above/below another.
3. The size of a signal candle in ATRs
How a signal should look like:
1. Buy signal should be displayed as a green arrow UP;
2. Sell signal should be displayed as a red arrow DOWN;
3. If the signal candle's size is more than the value set in the parameters -- the signal candle should be YELLOW (both up and down);
What should be displayed in alert:
1. Pair, TF, Time, Up/Down signal/ Huge candle (if the size is more than specified)/ usual candle;
Alerts should be available on:
1. Email;
2. Pop up window;
3. On the phone using MetaQuotes ID.
The signal should only happen on a candle's close.