İş tamamlandı
![](https://c.mql5.com/i/avatar/avatar_na2.png)
İş Gereklilikleri
Expert Advisor based on three Moving Averages and Parabolic Stop and reverse indicators. Stop Loss and Take Profit based on ATR or a specified number of pips. EA to be tested on Stocks, Indices and Currencies.
Requirement Specification For A MetaTrader 5 Expert Advisor
List of indicators
1. Simple Moving Average SMA (15), no offset, colour – white, 2 pixels
2. Simple Moving Average SMA (50), no offset, colour – red, 2 pixels
3. Simple Moving Average SMA (100), no offset, colour – white, 2 pixels
4. Average True Range (ATR) Period – 14. Do not plot this on the chart.
5. Parabolic Stop And Reverse (PSAR). Default setting. Colour- green.
Buy Signal (long)
1. Price closes above SMA(15), SMA(50) and SMA(100) and
2. Price is or goes above PSAR of current bar. Enter 1 lot immediately. Buy cycle has started.
3. Go long again (1 lot) if two consecutive bars have lower close prices (I call these ‘Reversal Candles’. I would like this to be a variable so that I can change it to 3 or 4 consecutive candle bars, etc.
4. Continue to add to long positions as long as Step 3 happens in a buy cycle and maximum lot size (described later) has not been reached.
5. Enter trades at Market i.e. Market Order.
Exit Long Trade(s)
1. Each lot added will have a pre-determined Stop Loss (SL) and Take Profit (TP).
2. Close a lot when SL or TP level is reached.
3. Close all opened trades when price goes below PSAR of the current bar.
4. Do not enter short positions unless sell signal is received.
5. Close trades at Market.
Stop Loss
1. Set stop loss at 2.5x ATR or a specified number, whichever is higher.
Take Profit
1. Set take profit point at 5x ATR or specified number, whichever is higher.
Do reverse for Sell Signal.
Managing parameters for optimisation:
1. I should be able to change the values of the three moving averages.
2. I should be able to change the parameters of PSAR.
3. I should be able to change the period of the ATR.
4. I should be able to change the multiples of the ATR for both Stop Loss and Take Profit. E.g. 1.8x ATR for Stop Loss and 3.9x ATR for Take Profit.
5. I should be able to set a limit for the number of trades to enter per cycle. E.g. Not more than 3 opened positions for each cycle.
6. I should be able to set the lot size per trade. E.g. £1/point
7. I should be able to set the number of ‘reversal candles’ within a cycle. E.g. if there is a Buy Signal, and there are 2 or 3 or 4 consecutive bars that have lower close prices, I want to optimise on this. So, there should a parameter like ‘Reversal Candles’ = x. where x is any number of candle sticks.
8. I should be able to set StartHour and EndHour to optimise best trading periods.
9. Others
1. Plot all indicators on the screen except ATR indicator.
2. Plot buy and sell entry points below and above entry candle, whichever is appropriate.
3. Plot stop Loss and Take Profit Lines.
4. Allow for trading Stocks, Indices and Currencies of 3 or 5 digits.
5. I would like to have the source code for this Expert Advisor.
My vocabulary
1. Reversal Candles in Buy Signal: These are consecutive candle sticks that have closed lower than previous bar in a Buy Signal. E.g. Three Reversal Candles are three consecutive candle sticks where bar 0 closes lower than bar 1 and bar 1 closed lower than bar 2 and bar3 closed lower than bar 4.
2. Reversal Candles in Sell Signal: These are consecutive candle sticks that have closed higher than previous bar in a Sell Signal. . E.g. Three Reversal Candles are three consecutive candle sticks where bar 0 closes higher than bar 1 and bar 1 closed higher than bar 2 and bar3 closed higher than bar 4.