Работа завершена
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Техническое задание
Bull Candle touch and close above/Bear Candle touch and close below all selected indicators with Hedge.
The idea:
Expert Advisor to open buy when a bull candle closed above a nos of indicators selected manually from the settings.
And to open a sell when a Bear Candle closed below nos of Indicator selected manually from the settings.
The ea should differentiate between Bull and Bear Candles.
(Sometimes a bull candle closes below selected indicator/ and vice versa, may a Bear candle can closed above selected indicator -in this case no more position should be opened).
This is a hedging ea that have incremented lot values whenever the target of TP specified in the setting not reached.
(bull candle closed above selected indicators, open buy lot1 value, TP not reached and Bear Candle open below selected indicators open Sell Lot2 value and so on lot will be incremented till reaching TP)
Time frame: All
Currency Pairs: All
Platform: MT4
All indicators are MT4 Default Indicators
EMA1- True/false
EMA1 manual values (Period/Shift/Method/Apply to/Style)
EMA2- True/false
EMA2 manual values (Period/Shift/Method/Apply to/Style)
Envelope – True/false
Envelope manual values (period/Shift/Method/Apply to/Deviation/Colors)
Lot steps if take profit not achieved (Hedge): lot 1 – 15 (manual value)
Take profit targets (in $) of the total open positions
Close (hedged) losing position – True/False
Just in case TP target not achieved and so many nos of positions opened I should be able to close any positions manually without effecting the automatic work of ea.
Buy Example:
Bull candle closed above Selected Indicator/s Open buy Lot1 value
Scenarios for Buy Lot1
a) Take profit in $ reached, close Buy Lot1 in profit. And (wait for BEAR CANDLE ONLY to close below Selected Indicator/s open sell Lot1 value, and so on) OR
b) A Bear candle closed below Selected Indicator/s before achieving target (Open Sell Lot2-hedging) first position was buy so next position should be sell only.
If I select TRUE in the option of close losing position then the ea should close the
buy lot1 in loss. And so on whenever a new buy or sell opened ea should close the previous order in loss.
If I select FALSE in the option of close losing position the ea should not close any position and keep all position opened.
Scenarios for opened sell Lot2
a) Sell Lot2 - take profit in $ reached close sell2 (wait for Bull Candle to close above Selected Indicator/s and open Buy Lot1 value)
OR
b) A Bull candle closed above Selected Indicator/s (Open buy Lot3)
Scenario for Buy Lot3
The same except the lot will be lot4 value. And so on
Remarks:
In later stage after testing some changes in the strategy may required and should be done without any extra charges.