Build an EA using 2 Moving Average lines

MQL5 Experts

Job finished

Execution time 3 days
Feedback from customer
You completed very quickly and do what my expectation. Thank you
Feedback from employee
Good job. Recommended user.

Specification

Build an EA using 2 Moving Average lines

Name: MovingAverageEA

Source code: MT4, MT5 included.


SETTING

AssetItem:

- Current chart

MagicNumber:

- Default: 123456789

- User can change this number

MinLot:

- Minimum lot when making an order

- Default: 0.01

MaxLot:

- Maximum lot when making an order

- Default: 50

- Maximum value is 50

AccountCapital

- Default: 100$

- The money amount from the account

StopLoss

- Pip number.
- Default 20

Moving Average setting

MovingAverage_1

- MA1_Period: default = 10

- MA1_Shift:  default = 0

- MA1_Method: default = MODE_SMA

- MA1_Price: default = CLOSE_PRICE

MovingAverage_2

- MA2_Period: default = 1

- MA2_Shift:  default = -1

- MA2_Method: default = MODE_SMA

- MA2_Price: default = CLOSE_PRICE



Flow processing (please look at the picture to understand what I said)

- Only 1 order at the time

- MA2 cross up MA1, make a buy order. Close this order until the MA2 goes down MA1.

- MA2 goes down MA1, make a sell order. Close this order unitl the MA2 goes up MA1.

- Do not make 2 orders at the same time.

- If make a buy order, please close a previous sell order if exists.

- Before making a new order, EA has to re-calculate the volume

- Update stop loss processing: 
- Step 1: Get the maximum low/high price from 3 previous candlesticks to set the stop loss for buy/sell order.
- Step 2: calculate the stop loss number Math.abs(the price when making an order - price from step 1)
- Step 3: compare the value from step 2 with the [StopLoss] setting. use the bigger one
- Update the stop loss for the existing order when it moves to the next bar like the method above


Volume calculation

 - If account balance < [AccountCapital] => use [MinLot]

 - If Lot calculation > [MaxLot] => use [MaxLot] setting value
 
 Lot calculation use this form
 
 100$-200$ => 0.01

 200$-400$ => 0.02

 400$-800$ => 0.04

 800$-1600$ => 0.08

 1.600$-3.200$ => 0.16

 3.200$-6.400$ => 0.32

 6.400$-12.800$ => 0.64

 12.800$-25.600% => 1.28

 25.600$-51.200$ => 2.56

 51.200$-102.400$ => 5.12

 102.400$-204.800$ => 10.24

 204.800$-409.600$ => 20.48

 409.600$-819.200$ => 40.96

 > 819.200 => 50


Explain how to make a buy or sell


Files:

Responded

1
Developer 1
Rating
(39)
Projects
50
18%
Arbitration
6
33% / 50%
Overdue
0
Free
2
Developer 2
Rating
(31)
Projects
38
53%
Arbitration
2
50% / 50%
Overdue
3
8%
Free
3
Developer 3
Rating
(56)
Projects
92
62%
Arbitration
0
Overdue
4
4%
Free
4
Developer 4
Rating
(515)
Projects
554
53%
Arbitration
13
69% / 15%
Overdue
3
1%
Free
5
Developer 5
Rating
(206)
Projects
333
35%
Arbitration
66
12% / 58%
Overdue
87
26%
Free
6
Developer 6
Rating
(8)
Projects
11
0%
Arbitration
11
18% / 73%
Overdue
2
18%
Free
7
Developer 7
Rating
(462)
Projects
489
70%
Arbitration
6
67% / 0%
Overdue
2
0%
Working
8
Developer 8
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
9
Developer 9
Rating
(34)
Projects
60
23%
Arbitration
11
73% / 9%
Overdue
3
5%
Free
10
Developer 10
Rating
(10)
Projects
13
8%
Arbitration
3
67% / 33%
Overdue
0
Free
Similar orders
I am looking for an experienced MQL5 developer to build a professional MT5 Expert Advisor specifically for XAUUSD (Gold) and other indices. I saw that XAUUSD is one of your primary areas of specialization, so I would like to discuss a custom EA with you. My priority is NOT extremely high returns. I want a robust EA designed for controlled risk and long-term survival. Requirements: • MT5 / MQL5 • XAUUSD, usoil,btc and
VENOM EA 35 - 50 USD
So, im a beginner and I'm pleading you to built me a bot that runs 24hrs and that can buy and sell at the same time, choose a better and profitable strategy. I will do anything thing it takes to get the bot. I hope you take my request into consideration
Je cherche un développeur MQL4 / MQL5 expérimenté pour créer un robot de trading automatique (Expert Advisor) performant et sécurisé. Validation de comptes Prop Firm capable de trader sur le forex et les matière première
XAUUSD Digger 50 - 300 USD
I want you to create a strategy that fits for my funded account conditions like winrate of 60%+ with good risk reward ratio min 1:2 and max drawdown per day is 2% or 3% and overall should be less then 10% with less consecutive losses should be able to finish the funded stage in of phase 1 8% target and phase 2 of 10% target in a month with good number of trades in a month need journal of all the back tested data and
I need a simple Expert Advisor for MT5 that trades based on RSI overbought/oversold levels. - Entry: Buy when RSI(14) < 30, Sell when RSI(14) > 70 - Exit: Take Profit and Stop Loss as adjustable input parameters (default 50/25 pips) - Position sizing: Risk 1% of account balance per trade, auto-calculated from stop-loss distance - Timeframe and currency pair: adjustable inputs, not hardcoded - Should include basic
1. Trading Instruments: - The robot should trade exclusively on the following currency pairs: - NZD/CHF - NZD/USD - GBP/USD 2. Trading Style: - The robot should implement a day trading strategy, focusing on short-term trades. 3. Risk Management: - Maximum drawdown percentage: 10%. - Stop loss settings: Adjustable based on volatility (suggested default: 30 pips). - Take profit settings: Adjustable
I have an existing working MQL5 Expert Advisor and require an experienced MQL5 programmer/trading-system analyst to independently analyse its historical performance. This is NOT initially a request to rewrite the EA or simply optimize parameters. Current strategy: - MetaTrader 5 - M15 timeframe - EMA / ADX / ATR based - Approximately 1,337 historical trades - Gross Profit approximately USD 271,000 - Gross Loss
Gold robot 30 - 1000 USD
Hello everyone, I’m looking for a developer who has an algorithm in their arsenal that generates quick profits over the long term. I’m interested in a scalping expert advisor—it can be a one-shot, averaging, or grid strategy, with or without TP/SL. Please share your ideas and results; I’ll consider all options. The most important thing is the result. Good luck
Zwivhuya 100+ USD
I would like to be part of this trade because i want to help my family out of the hopeless life we are living now . i thoughts going to school will help me get better job but no i am still sitting for us to eat at home i have to sell my body to someone and get pay with that small money i can buy bread and cooldrink for my family that we can not sleep with emyter stomach
I need an Expert Advisor that trades by signal of ADX and Moving Average indicators. It must check and correctly process possible errors in trading operations. The main criteria of opening and closing positions , direction of Moving Average, Price of last bar . Set the number of lots to trade as an input parameter

Project information

Budget
50 - 100 USD
Deadline
from 1 to 3 day(s)