Trabalho concluído
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Termos de Referência
I have a ready made indicator with buy and sell conditions working perfectly, i have attached sample of the picture of it behaviour. The conditions of the EA are stated below:
CONVERTING INDICATOR TO EA LOGIC
***VERY, VERY IMPORTANT:
When the EA is complied or active on the chart, the Expert Advisor should not trade the first arrow that appears on the chart. Whether it is Green or Red arrow, for everyday , the first arrow that appears on the chart should not be traded. Do not trade first arrow that appears on the chart on every trading day. This is because the arrow does not appear at the intersection of a red and green Bollinger bands. This first arrow will lead to a very big or significant loss. So, do not trade the first arrow at all on each day . See indicator attached to mail.
***Make notification alert whenever a profit is made”
EA makes a “Sound” and use electronic speech to say“ Profit made” in English Language.
*** No Trade Report:
The EA should write a report on the left hand side of the chart, why a trade cannot open when the right conditions are met. E.g High spread, Low margin, Low deposit, Moving average filter, time filter, lot size, etc.
***Trade Filter:
a. Time Filter: 06:00 - 21:00
b. Spread Filter: Do not open buy or sell if spread is > 4 for a four-digit broker as (Input)
Do not open buy or sell if spread is > 40 for a five-digit broker as (input)
c. Moving Average Filter (True/False)
i. If MA is True at (Period = 23 or Period = 55 or Period = 97 or Period = 217 or any period at all), open Sell trade only (Red arrow) BELOW (MA) when MA is falling or facing down.
ii. ***If MA is True do not open Buy trade below (MA) when is falling or facing down, even if the indicator arrow shows green.
iii. If MA is True at (Period = 23 or Period = 55 or Period = 97 or Period = 217 or any period at all),, open Buy trade only (Green Arrow) ABOVE (MA) when MA is rising or facing up.
iv. ***If MA is True do not open Sell Trade above (MA) when is rising or facing up, even if the indicator arrow shows red.
v. IF (MA) IS FALSE, TRADE AT ALL BUY (GREEN ARROWS) AND ALL SELL (RED ARROWS) AS SHOWN IN THE INDICATOR.
vi. MA Conditions, Shift = 0, MA method = Simple, Apply to = Medin Price (HL/2), Colour = Blue.
Moving Average summary.
1. If MA is True and price is below MA
· Show red arrow and open sell trades only.
· Show green arrow and DO NOT open buy trades
2. If MA is True and price is above MA
· Show red arrow and DO NOT open sell trades only
· Show green arrow and open buy trades
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Buy Entry
1. Open Buy as shown by the green arrow in the indicator.
Buy Conditions
1. Open Buy at green arrow shown in the indicator.
2. At Buy entry, open Buy positions simultaneously at once;
a. Buy 1 (B1) with input (True/False)
b. Buy 2 (B2) with input (True/False)
c. Buy 3 (B3) with input (True/False)
d. Buy 4 (B4) with input (True/False)
e. Buy 5 (B5) with input (True/False)
f. Buy 6 (B6) with input (True/False)
g. Buy 7 (B7) with input (True/False)
h. Buy 8 (B8) with input (True/False)
i. Buy 9 (B9) with input (True/False)
j. Buy 10 (B10) with input (True/False)
3. Buy Lot size
Each Buy trade will have its own different lot size
a. Buy 1 (B1) has its own input lot size (0.01)
b. Buy 2 (B2) has its own input lot size (0.01)
c. Buy 3 (B3) has its own input lot size (0.01)
d. Buy 4 (B4) has its own input lot size (0.01)
e. Buy 5 (B5) has its own input lot size (0.01)
f. Buy 6 (B6) has its own input lot size (0.01)
g. Buy 7 (B7) has its own input lot size (0.01)
h. Buy 8 (B8) has its own input lot size (0.01)
i. Buy 9 (B9) has its own input lot size (0.01)
j. Buy 10 (B10) has its own input lot size (0.02)
Note: B1,B2,B3,B4,B5,B6,B7,B8,B9,B10 has the same lot sizes as S1,S2,S3,S4,S5,S6,S7,S8,S9,S10 respectively.
4. Buy Exit
Buy exit at take profit
a. Exit B1 at take profit 20 (input)
b. Exit B2 at take profit 30 (Input)
c. Exit B3 at take profit 40 (input)
d. Exit B4 at take profit 50 (input)
e. Exit B5 at take profit 60 (input)
f. Exit B6 at take profit 70 (input)
g. Exit B7 at take profit 80 (input)
h. Exit B8 at take profit 90 (input)
i. Exit B9 at take profit 100 (input)
j. Exit B10 at the next SELL or Red Arrow. That is, when the sell indicator or red arrow shows, even when there are current or floating Buy positions, immediately close the B10 and other existing trades, when the sell arrow shows, or is opened.
Trailing Profit (True/False)
Each opened position from B1 to B9 has their unique/individual trailing profit.
a. B1 TrailingStart at (B1 take profit), TrailingDistance 20 pips
b. B2 TrailingStart at (B2 take profit), TrailingDistance 40 pips
c. B3 TrailingStart at (B3 take profit), TrailingDistance 60 pips
d. B4 TrailingStart at (B4 take profit), TrailingDistance 80 pips
e. B1 TrailingStart at (B5 take profit), TrailingDistance 100 pips
f. B1 TrailingStart at (B6 take profit), TrailingDistance 150 pips
g. B1 TrailingStart at (B7 take profit), TrailingDistance 200 pips
h. B1 TrailingStart at (B8 take profit), TrailingDistance 250 pips
i. B1 TrailingStart at (B9 take profit), TrailingDistance 300 pips
Buys Stop loss at next Sell
Automatically close B1,B2,B3,B4,B5,B6,B7,B8,B9,B10 at the same time if the loss falls to the point that, the next sell arrow or red arrow shows or sell trade opens . All existing buy trades will close at next sell or red arrow.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Sell Entry
1. Open Sell as shown by the red arrow in the indicator.
Sell Conditions
1. Open Sell at red arrow shown in the indicator.
2. At Sell entry, open Sell positions simultaneously at once:
a. Sell 1 (S1) with input (True/False)
b. Sell 2 (S2) with input (True/False)
c. Sell 3 (S3) with input (True/False)
d. Sell 4 (S4) with input (True/False)
e. Sell 5 (S5) with input (True/False)
f. Sell 6 (S6) with input (True/False)
g. Sell 7 (S7) with input (True/False)
h. Sell 8 (S8) with input (True/False)
i. Sell 9 (S9) with input (True/False)
j. Sell 10 (S10) with input (True/False)
3. Sell Lot size
Each Sell trade will have its own different lot size
a. Sell 1 (S1) has its own input lot size (0.01)
b. Sell 2 (S2) has its own input lot size (0.01)
c. Sell 3 (S3) has its own input lot size (0.01)
d. Sell 4 (S4) has its own input lot size (0.01)
e. Sell 5 (S5) has its own input lot size (0.01)
f. Sell 6 (S6) has its own input lot size (0.01)
g. Sell 7 (S7) has its own input lot size (0.01)
h. Sell 8 (S8) has its own input lot size (0.01)
i. Sell 9 (S9) has its own input lot size (0.01)
j. Sell 10 (S10) has its own input lot size (0.02)
Note: B1,B2,B3,B4,B5,B6,B7,B8,B9,B10 has the same lot sizes as S1,S2,S3,S4,S5,S6,S7,S8,S9,S10 respectively.
4. Sell Exit
i. Sell exit at take profit
Sell exit at take profit
a. Exit S1 at take profit 20 (input)
b. Exit S2 at take profit 30 (Input)
c. Exit S3 at take profit 40 (input)
d. Exit S4 at take profit 50 (input)
e. Exit S5 at take profit 60 (input)
f. Exit S6 at take profit 70 (input)
g. Exit S7 at take profit 80 (input)
h. Exit S8 at take profit 90 (input)
i. Exit S9 at take profit 100 (input)
j. Exit S10 at next BUY or Green Arrow. That is, when the Buy indicator or green arrow shows, even when there are current or floating Sell positions, immediately close the S10 and other existing sell trades, when the Buy arrow shows, or is opened.
Trailing Profit (True/False)
Each opened position from S1 to S9 has their unique/individual trailing profit.
a. S1 TrailingStart at (S1 take profit), TrailingDistance 20 pips
b. S2 TrailingStart at (S2 take profit), TrailingDistance 40 pips
c. S3 TrailingStart at (S3 take profit), TrailingDistance 60 pips
d. S4 TrailingStart at (S4 take profit), TrailingDistance 80 pips
e. S1 TrailingStart at (S5 take profit), TrailingDistance 100 pips
f. S1 TrailingStart at (S6 take profit), TrailingDistance 150 pips
g. S1 TrailingStart at (S7 take profit), TrailingDistance 200 pips
h. S1 TrailingStart at (S8 take profit), TrailingDistance 250 pips
i. S1 TrailingStart at (S9 take profit), TrailingDistance 300 pips
Sell Stop loss at next Buy
Automatically close S1,S2,S3,S4,S5,S6,S7,S8,S9,S10 at the same time if the loss falls to the point that, the next Buy arrow or green arrow shows or Buy trade opens . All existing Sell trades will close at next buy or green arrow.
***Please make indicator visible when running EA in back test and forward test.
Thank you in anticipation.