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

Specification

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.

Files:

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

Responded

1
Developer 1
Rating
(137)
Projects
167
35%
Arbitration
11
91% / 0%
Overdue
0
Free
2
Developer 2
Rating
(23)
Projects
45
20%
Arbitration
24
29% / 42%
Overdue
12
27%
Working
3
Developer 3
Rating
(62)
Projects
140
46%
Arbitration
19
42% / 16%
Overdue
32
23%
Free
4
Developer 4
Rating
(3)
Projects
1
100%
Arbitration
1
0% / 0%
Overdue
0
Free
5
Developer 5
Rating
(249)
Projects
397
38%
Arbitration
82
41% / 20%
Overdue
69
17%
Loaded
6
Developer 6
Rating
(8)
Projects
10
40%
Arbitration
0
Overdue
0
Free
Similar orders
Looking for a developer to create an MT4 indicator and an EA / Robot. Indicator-based strategy consisting of several moving averages, PSAR Indicator and Pinescript indicator called Coral Trend Indicator by LazyBear (pinescript source code will be provided and will need converting to MT4 code - 34 lines of code). Strategy to be an intra-day trading period on 5-minute timeframe for the European session but “Trading”
Hey Greetings. Am in need of a developer with experience in Tradingview that have successfully developed a profitable strategy for tradingview . I willing to buy already made profitable strategy for tradingview. If you have one or had develop some . Kindly apply for the job and let discuss about the price and timeline. Thanks
Create Order Block Indictor same as the indicator i attached. 1. Buy and Sell order block with arrow 2. indicator must not repaint 3. indicator must have setting to manage order block. Order must appear in the same places as our order block indicator.... if you have workable send to me let test it
I have an EA which i got from a friend of mine and it is a fantastic tool i use to trade the markets. It's fully automatic opens, closes trades etc. My only issue is that to run strategy testing and optimizations MT4 is so frkn slow! MT5 is leaps and bounds better for testing so would like to literally convert this EA from MT4 installable exe to MT5 installable exe so i can run it on MT5. Obviously i do not have the
I need someone who have experience in building a stock trading robot? Specifically, I want to build a robot for trading in options from a foreign exchange. I think the first thing that has to be checked is the possibility to connect to the trading platform. I understand it is called FMR. Then we can start to discuss what the robot has to do exactly. basically, it has to search the table of options and look for
can you help me with a task i want an example script that basically uses python to interact with ninja trader so that it can gather / collect data from different workspaces. write a script for connection and fetching data from all the workspaces that account has
Hello, everyone here, I kinda need help of a professional programmer that can convert mt4 indicator into tradingview indicator, there are still more projects in the futures I will need him/her to complete for me, but this is the first ime and I will pay $20 for this project I need this really fast, I need to start working
Hello, I am kindly looking for a developer to help with the migration of an existing Expert Advisor from MQL4 to MQL5. The primary tasks required are: Code Migration: The current EA is based on MQL4 and needs to be rewritten for compatibility with MQL5. It is a straightforward mechanical limit order inventory management strategy (Grid), but it requires precise handling to ensure that its functionality remains
I am seeking an experienced and proficient MQL5 developer to collaborate on an exciting project involving the enhancement of an existing EA, specifically an elaborate version of xBest v3.47. The xBest v3.47 EA is publicly available and serves as the foundation for our project. The goal is to incorporate a series of compelling features into the existing EA, leveraging its grid/hedging strategy while introducing
Hello, I am looking for someone that can build me an EA preferably expanding on an existing code you probably know as the xBest Ea series. I have the source code and detailed list of everything that needs to be coded in ready to go. please let's discuss more better on my strategy

Project information

Budget
70 - 120 USD
VAT (21%): 14.7 - 25.2 USD
Total: 84.7 - 145.2 USD
For the developer
63 - 108 USD
Deadline
from 5 to 7 day(s)