Tâche terminée
Spécifications
Moving average crossover strategy
We need an Expert Advisor for MetaTrader 4.
It needs to be able to work on different time periods, currency pairs and Moving average indicators (EMA and SMA).
Bullet points
· It will use exponential moving average and simple moving average indicators.
· When moving average cross, it may trigger a sale or buy passion.
· The actual bar needs to finish to be a certain trade signal.
· It needs to be able to work on different time periods.
· It needs to be able to work on different currency pairs.
· Be able to choose different periods for the moving average.
Strategy
Opening positions
a. When the two moving average cross.
b. In order it to be a positive trade signal the bar needs to finish. The bar finish and the moving average has crossed.
c. It will open a trade on the direction the cross of the moving average point.
a. Big moving average below small moving average BUY (Long).
b. Small moving average below big moving average SELL (short).
d. Open order post crossing: Set an opening position to the direction the moving average point at a set price in points.
Closing positions
Tree ways to close a position. We should be able to choose witch one we want.
1. When the moving average change direction, the cross and go to the appositive, Bar needs to finish, it doesn’t close with a single touch. It will close at the closing price.
2. If take profit is meet.
3. If a stop loss is set.
4. Trailing Stop.
Input Parameters
§ Lot: *****
§ Increment lot: if 0%, lot will be always what is defined. If above 0% it will be use in the following formula, “lot x (Actual balance/last trade balanxce) x (1+ increment lot)” = new lot to be use. Increment of balance is “Latest balance ÷ inicial balance”.
§ Take profit: In points, if 0, when moving average change directions.
§ Open Exception: if 0, Bar needs to finish with moving average crossed, if 1 open a trade at the moment they touch.
§ Stop loss: In points, if 0, when moving average change directions
§ Trailing Stop: from stop loss.
§ EMA 1: If 0 means we are using SMA.
§ EMA 2: If 0 means we are using SMA.
§ SMA 1: If 0 means we are using EMA.
§ SMA 2: If 0 means we are using EMA.
§ Open order post crossing: if 0, the closing price of the bar that confirms change direction. If other value, XX points opposite the direction of the trade from the closing price of the bar that confirms change direction.
§ Balance: wallet money
Example 1
See Parameters, description and photo.
Parameters
§ Lot: 0.1
§ Increment lot: 2%
§ Take profit: 15 pips
§ Open Exception: 0
§ Stop loss: 30 pips
§ Trailing Stop: 0
§ EMA 1: 10
§ EMA 2: 40
§ SMA 1: 0
§ SMA 2: 0
§ Open order post crossing: 0
§ Balance 10,500$
Time frame: 4h
Pair: EURUSD
Balance before last trade: 10,000$
Description
1. EMA 10 and EMA 40 cross. EMA 10 is below EMA 40, it triggers a Sell positions.
2. Bar closes at 1,0990. An order is place at that price, sell lots 0.1071. (10,500/10,000) x (1 + Increment lot: 2%)
3. Stop loss and take profit is set.
4. Price move to take profit and 15 pips
5. Expert advisor waits until EMA Cross Again
I would like to have and see the source code.
Thank you!!!!