Martingale on a Moving Average strategy. Adding the feature on an existing EA

Termos de Referência

Modify an existing moving average crossover EA

 

We need two things to be done in our existing and functioning EA for MetaTrader 4. 

 

1.          Adding a feature that offset losses

2.          Adding brokers’ commissions cost to the EA

 

1. Offset losses

 

The existing EA, buys and sells as explain on the document attached, called “moving average strategy”.

 

Our intention is to add a feature that is triggered when a trade make a loss. The objective is to cope with the losses generating more trades, a kind of “Martingale strategy”. 

 

Bullet points

 

·       The strategy tries to offset the loss trades, generating more trades.

·       It can generate one or more trades to cope with the losses of a trade.

·       We may want to generate more than one trade to cope with the losses of a trade.

·       Those trades that are generated to offset loss trades, can generate more trades. In classic martingale, your next trade will try to cope with your previous trade loss, here we will divide in X trade to cope with the loss.

·       Be able to choose how many trades are open every time.

·       On report, we will need to be able to see how many trades still to be open. So, it needs to save information of pass trades and pending trades.

 

Parameters

 

Loss trade divided: 0 means the feature is off. 1 to XX, it will divide the loss trade in XX future trades, if parameter is 5, it will generate 5 consecutive trade to cope with the loss.

Active trades: At some point we would like to choose how many trades the EA opens. If 0, unlimited if above 0 whatever it says. With this parameter you limit the trades the EA generate every time, as market conditions could make the EA to generate lots of trades in a matter of MA crosses.

 

 

 

 

 

On report

 

On report we need the following figures;

 

Number of trades still to go in case we limit the active trades.

Value of the trades to go.

Number of trades trading.

Value of the trades trading.

Sum of commissions.

 

A compressive case

 

See on photo attached, 3.png

 

First column, called CROSS, this is when a MA cross the EA generate an order.

Second column, called profit main trade, it is simple the main trade the EA does when MA crosses, to make it easy I choose take profit on 4 pips $60 and 40 pips $600.

Third column, called loss trade trigger is a reference of each main trade that goes to losses.

Then the one called profit and loss, is a simple sum of each trade.

And the last one equity, this is the net deposit.

 

Those this exemple we hae used this parameters

 

Loss trade divided by: 10

Active trades: 0

 

So, it will dived the losses by 10 and it will allow the EA open as much trades as the MA and losses dictates.

 

1.      Cross 1 goes wrong and loss money, $600. The EA will generate 10 trades for the next Crosses to cope with loss of Cross 1, and the calculations for the next 10 trades goes as follows $600/10 + target profit / 10. This trades is 1.1.

2.      On Cross 2 the EA will generate two trades, the main one and a second one that tries to cope with losses of trade on Cross 1, trade 1.1. 

3.      Cross 3 the EA will generate two trades, the main one and a second one that tries to cope with losses of trade on Cross 1, trade 1.1.

4.      Cross 4 the EA will generate two trades, the main one and a second one that tries to cope with losses of trade on Cross 1, trade 1.1. As it goes wrong, the EA will generate trade 1.2 and 2.1, those two trades will try to cope with losses of trade 1.1 and main trade of cross 4.

5.      Cross 5 EA wil generate 4 trades Main trade plus 1.1, 2.1 and 1.2.

 

 

 


 

 

 


2. Adding brokers’ commissions cost to the EA

 

We need a parameter to be able to define commissions. 0 means no commissions, and then euros per lot.

Arquivos anexados:

PNG
1.png
229.0 Kb
PNG
2.png
232.4 Kb
PNG
3.png
335.1 Kb
PNG
4.png
44.7 Kb
PNG
1_MA.png
257.3 Kb
PNG
2_MA.png
353.7 Kb
PNG
3_MA.png
591.5 Kb

Respondido

1
Desenvolvedor 1
Classificação
(137)
Projetos
167
35%
Arbitragem
11
91% / 0%
Expirado
0
Livre
2
Desenvolvedor 2
Classificação
(23)
Projetos
45
20%
Arbitragem
24
29% / 46%
Expirado
12
27%
Livre
3
Desenvolvedor 3
Classificação
(62)
Projetos
140
46%
Arbitragem
19
42% / 16%
Expirado
32
23%
Livre
4
Desenvolvedor 4
Classificação
(3)
Projetos
1
100%
Arbitragem
1
0% / 0%
Expirado
0
Livre
5
Desenvolvedor 5
Classificação
(253)
Projetos
408
38%
Arbitragem
86
43% / 19%
Expirado
70
17%
Trabalhando
6
Desenvolvedor 6
Classificação
(8)
Projetos
10
40%
Arbitragem
0
Expirado
0
Livre
Pedidos semelhantes
// @version= 5 strategy ( "EMA Crossover Strategy with 1:1.6 Risk-Reward" , overlay = true ) // Define the EMAs shortEma = ta.ema ( close , 10 ) longEma = ta.ema ( close , 20 ) // Plot the EMAs on the chart plot ( shortEma , color = color.blue , title = "10 EMA" ) plot ( longEma , color = color.red , title = "20 EMA" ) // Calculate the crossover conditions longCondition = ta.crossover ( shortEma , longEma )
Hi, i have a tos script i need converted to Ninja script, but someone who knows both coding. Cant be someone who is just going to paste into chat gpt, it requires more understanding for compatibility
1. Combination of Market Profiles on daily basis a) this should be combined if the bell curve is similar to the previous day. Rotational day (volume - standard deviation). b) If breakout, new range should be drawn Conclusion: Market profile should be combined on daily after the market is closed 2. Use Vwap indicator, with 0.5 - slow trend, 1.0 - normal trend, 1.5 fast trend. The stop loss should be under the trend
Make a 10000 plus script trading Expert advisor with detail and make it flawless with no errors no tiny mistakes and make it in mql 5 language. Make it adjustable for it to be able to trade on its own and not be disturbed and make it study the chart and be able to trade any currency pair. I have zero experience and I would just like to copy and paste the code in MetaTrader. Can you make it be compatible with both
I need a trading bot, My strategy works with the 1hour timeframe .My stop-loss should be put using Atr of the candle multiply by 1.5 then the value will be added or subtracted from my entry depending on if it's a buy or sell and my entry should be a candlestick pattern also in addition to when the 3 Ema corresponds .When the 8Ema is above the 20Ema and they are both above the 100Ema it is a buy and when the 20Ema is
Looking to create EA for forex tradding with strategy as per price action, where order get excuted with proper stop loss and take profit. and order size should change as per privious trade result
Hi, I would like to create an expert advisor to fully automatic trade in MT4 as below, it should be possible with gold or any currency pairs and need to possible with 2, 3, 4 or 5 after decimal quotes PAROL MA CROSSOVER 1. Magic Number : Customize 2. Take profit in points : Customize 3. Stop loss in points : Customize 4. Strat time in GMT : Customize 5. End time in GMT : Customize (It means no need to open a new
i need someone who can remake this indicator to a winning strategy. i need someone who can make my signal on that indicator to appear fast on the chart... let me know if you can
I am seeking a coder who has experience in converting an MT4 indicator & EA(.mq4 file, source code provided) to TradingView's Pine Script. The indicator should be identical to the original, with the same inputs and settings. Upon completion of the task, the coder will send me the Pine Script indicator & EA along with the full source code, and the project will remain confidential. This task should be straightforward
We are seeking an experienced developer with expertise in converting cTrader bots to MT4 Expert Advisors (EAs). The ideal candidate will have a strong background in both C# (used in cTrader) and MQL4 (used in MT4). You will be responsible for translating trading algorithms and strategies from cTrader to MT4, ensuring that all functionalities and performance criteria are met

Informações sobre o projeto

Orçamento
70 - 120 USD
IVA (21%): 14.7 - 25.2 USD
Total: 84.7 - 145.2 USD
Desenvolvedor
63 - 108 USD
Prazo
de 5 para 7 dias