Lavoro terminato
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Specifiche
Summary: This request is to generate an mt5 expert advisor which will generate a buy or sell signal based on the separation of the 5 and 21 exponential moving averages for multiple time periods. The amount of separation is compared to a table of values which can be manually updated as the optimization process indicates. The application will be able to run for multiple currencies with applicable tables adjusted accordingly. I want the source code for this expert advisor so I can copy a unique expert advisor for each currency pair. I also want to be able to specify a time period to run the application – initially from 12:00 AM GMT to 6:00 PM GMT. Finally, I want the ability to turn off the live trade aspect and use the same triggers to generate an alert on the computer and a text message.
Once this first application is fully operational, I will want to take the trigger data and reflect it in a separate chart. This will be a separate programming request.
Here is the application detail:
Allow for various Symbols
Initial Symbol: USD/JPY
Allow for a change in the code, then recompile for a separate EA for each currency pair
Allow for selected time periods
Start with time beginning at 12:00 AM GMT
End at 6 PM GMT
The time periods can e changed in the code and recompiled
Allow for modification of the following initial values. Modification can be completed within the code and then recompiled:
Initial Table Values:
diff15up = .02
diff15down= -.02
diff5up = .02
diff5down = -.02
diff1up = .02
diff1down = -.02
Set 1 Hour value (The reason I suggest a negative value for the down signals is because eventually I want to develop a chart which reflects the actual data for the currency pair. ie. if the trigger for the 15 minute cycle is triggered, a value of 1 or -1 is displayed, if the trigger for the 5 minute cycle is triggered a value of 1.5 or -1.5 is displayed, etc.)
Trigger1hup = if EMA for 5 periods > EMA for 21 periods then 1 else 0
Trigger1hdown= if EMA for 5 periods < EMA for 21 periods then -1 else 0
Set 15 Minute Values
Moving Average, Exponential, 5 periods, most recent close = x15
Moving Average, Exponential, 21 periods, most recent close = y15
z15 = x15-y15
Trigger15up = If z15 > diff15up then 1 else 0
Trigger15down = if z15 < diff15down the -1 else 0
Set 5 Minute Values
Moving Average, Exponential, 5 periods, most recent close = x5
Moving Average, Exponential, 21 periods, most recent close = y5
z5 = x5-y5
Trigger5up = If z5 > diff5up then 1 else 0
Trigger5down = if z5 < diff5down the -1 else 0
Set 1 Minute Value
Moving Average, Exponential, 5 periods, most recent close = x1
Moving Average, Exponential, 21 periods, most recent close = y1
Z1 = x1-y1
Trigger1up = If z1 > diff1up then 1 else 0
Trigger1down = if z1 < diff1down the -1 else 0
Signal “Buy” or “Sell” for an actual buy/sell or alert only options
Buy/Sell only option (This will be used for strategy testing)
If (Trigger1hup + Trigger15up + Trigger5up + Trigger1up) > 3 then “Buy”
If(Trigger1hdown + Trigger15down + Trigger5down + Trigger1down) < -3 the “Sell”
Alert to Text message only option (this will be used for live trading without text)
If (Trigger1hup + Trigger15up + Trigger5up + Trigger1up) > 3 then send a “Buy” text
If(Trigger1hdown + Trigger15down + Trigger5down + Trigger1down) < -3 the send a “Sell” text
Alert & Buy Sell – both option (this is used for live trading)