Build an EA using 2 Moving Average lines

MQL5 Experts

Trabalho concluído

Tempo de execução 3 dias
Comentário do cliente
You completed very quickly and do what my expectation. Thank you
Comentário do desenvolvedor
Good job. Recommended user.

Termos de Referência

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


Arquivos anexados:

Respondido

1
Desenvolvedor 1
Classificação
(39)
Projetos
50
18%
Arbitragem
5
40% / 40%
Expirado
0
Livre
2
Desenvolvedor 2
Classificação
(12)
Projetos
16
44%
Arbitragem
1
100% / 0%
Expirado
0
Livre
3
Desenvolvedor 3
Classificação
(56)
Projetos
92
62%
Arbitragem
0
Expirado
4
4%
Livre
4
Desenvolvedor 4
Classificação
(475)
Projetos
504
53%
Arbitragem
10
60% / 20%
Expirado
3
1%
Livre
5
Desenvolvedor 5
Classificação
(196)
Projetos
318
35%
Arbitragem
64
13% / 56%
Expirado
82
26%
Livre
6
Desenvolvedor 6
Classificação
(8)
Projetos
11
0%
Arbitragem
11
18% / 73%
Expirado
2
18%
Livre
7
Desenvolvedor 7
Classificação
(363)
Projetos
389
70%
Arbitragem
3
100% / 0%
Expirado
2
1%
Carregado
8
Desenvolvedor 8
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
9
Desenvolvedor 9
Classificação
(34)
Projetos
60
23%
Arbitragem
11
73% / 9%
Expirado
3
5%
Livre
10
Desenvolvedor 10
Classificação
(10)
Projetos
13
8%
Arbitragem
3
67% / 33%
Expirado
0
Livre
Pedidos semelhantes
Hi, I have an indicator from my friend, I want to copy it to my own MT5 can you do that for me. Here is the link
I'm looking for someone to help me create an arbitrage trading robot that can trade on any decentralized exchange and forex market. I already have some source code to a strategy but would like to enhance it to make it profitable and automated
I installed the E.A. into the Experts folder in MT4. When I double click on it nothing happens. When I right click and "attach to chart" nothing happens. The E.A. is not grayed out, it simply will not attach. Any help would be greatly Appreciated
I have an EA and want to add few new logic to fetch profit taking factors and other values from an external master data and use it in existing EA
Hello Every one, Good day, I want from someone professional to create an EA is working on Mt5, This EA is working by depend on some indicators, and all those indicators must be working on MACD window, not on the chart, for more details please read my attached pdf file carefully. Many Thanks
I'm looking for an expert MQL5 developer that can create an EA that's based on my price action trading strategy with no indicators. The EA must analyze trades based on my price action rules, enter trades based on my price action rules, manage trades based on my price action rules and exit trades based on my price action rules
hi hi there i have an strategy on tradingview and i want to automate it like metatrader EA so i want the strategy to open and close trade automaticlly on tradingview
We are looking for an experienced Expert Advisor Developer who can build a customized MT5 Expert Advisor for us. The Expert Advisor would use two built-in indicators as entry/exit signals and our own risk management strategy with customizable inputs. The goal is to create a reliable and efficient trading tool that can automate our trading process on the MT5 platform. Skills required: - Strong understanding of
I need stochastic div (hidden &regular ea) that should perform task in all tf's ..divergence is a repaint stly so i want to use it with candlestick flips .. so bet for it
Hello, I have an indicator from a friend and I'd like to replicate it on my own TradingView or MT5 platform. Could you assist me with that?. Here is the link

Informações sobre o projeto

Orçamento
50 - 100 USD
Desenvolvedor
45 - 90 USD
Prazo
de 1 para 3 dias