Develop MT5 EA - entry based on previous bar and use Martingale (Source Code in MT5 must be provided as part of acceptance)

MQL5 Experts

Job finished

Execution time 14 days

Specification

Develop MT5 EA - entry based on previous bar and when direction is wrong, place Martingale Trades. (Source Code in MT5 must be provided as part of acceptance)

 

I have a trading strategy that I would like to be coded into a MT5 EA.  The worker will take the requirements and translate them into the language of the MT5 and test it.

 

Extensive Experience with coding for MT5 EA (involving Martingale, Trailing stop loss, Checking Free Margin and Margin Used etc) is required. Please post previous experience with mql5.

=============================

Set File Paramters List

1.      EA_ShortName  (alphanumeric 7 characters) – Default “WFCZ”

2.      MagicNo  (Numeric 6 digits) – default “3467”

3.      MaxSpread in points (2 digits) – default 20

4.      MaxSlippage in points (2 digits) – default 5

5.      StopNewInitialTrade = Yes/No (Boolean) – default NO

6.      BarWait = 0, 1, 2, … (integer – 1 digit) – Default 3

7.      PriceNotToLong  / PriceNotToShort   (numeric – 999999.99999)

8.      AsianSessionTP / LondonSessionTP / USSessionTP  in points (4 digits - 9999)

a.      ATR(UserATRPeriod integer 2 digits) x ATRFactor (99.9999)

9.      InitTradeTrailingStopMode – (Boolean) Can be On or Off to decide whether to use Trailing Stop for initial trade

10.  InitTradeTrailingDistancePnts; InitTradeTrailingStepPnts  (5 digits – 99999 (i.e. up to thousand pips))

11.  MartgTradeTrailingStopMode - Can be On or Off to decide whether to use Trailing Stop for Martingale trade

12.  MartgTrailingDistancePnts; MartgTrailingStepPnts (5 digits – 99999  (i.e. up to thousand pips))

13.  MartgLotSize1 (99.99 lots) , PipsFromPrevTrade1 (5 digits 99999), MartgTP1 (4 digits - 9999), 

14.  MartgLotSize2, PipsFromPrevTrade2, MartgTP2

15.  …,  MartgLotSize10, PipsFromPrevTrade10, MartgTP10

16.  MartgMaxLevel (integer – 1 digit) = 0 (disable Martingale), 1, 2, 3, …  10

17.  MinFreeMargin / MaxMarginUsed – (8 digits - 999,999.99)

 


Initialization / Start:

1.      Check the previous trades / recognize where EA left off (What Martingale level next) because the system could be stopped by user,  scheduled maintenance, or system crashed etc. – store the NxtMartgLvl in variables and to check/compare against these just before placing new orders later

2.      Check all of EA’s own trades have TP properly set (i.e. sometimes server is busy or disconnected before TP is modified or user/trader changed set file TP) – if TP is different from set file – modify the tp depending on whether it’s initial trade or martingale trade

3.      Check all of EA’s own trades have TrailingStop properly set

4.      Calculate MarginLoadOfSymbol (see money management)

 

Requirements

1.      Control by  MagicNo + Symbol()  (i.e. diff. chart symbols can have same magic number)

a.      but diff timeframe of same chart symbol must use/set diff. magic number) because EA doesn’t store/check timeframe

2.      MaxSpread & MaxSlippage

a.      MaxSpread can be a fixed points or as percentage of quote

b.     MaxSlippage - not to trade only if adverse slippage, continue to trade if favorable slippage

3.      After trade, get the actual price executed from broker server to calculate TP (because executed price may be different for the ordersend price due to slippage, etc.)

4.      After modifying TP, read from server and compare to make sure the TP is modified (sometimes server is busy / disconnected and loss the TP)

5.      After trade, populate Comment field:  EA_ShortName+”/”+MagicNo+”/”+YMDD+”/”+HHMMSS + InitTrade (0 is initial trade) or Martingale Level (1, 2, 3, etc.)

a.      Y is last digit of year (e.g. “8” for 2018)

b.     M is 1-9, A (Oct), B (Nov), C (Dec)

6.      InitTradeTrailingStopMode – Can be On or Off to decide whether to use Trailing Stop for initial trade

7.      MartgTradeTrailingStopMode – Can be on or off to decide whether to use Trailing Stop for Martingale Trades

 

Entry of Initial Trade (i.e. NOT martingale trade) –

1.      If NOT StopNewInitialTrade then execute the below code

2.      Check if within EA Operating hours – 2 time bands (see below)

3.      BarWait – number of bars to wait before initial trade entry (0 bar and up; 0 means don’t wait) – barwait is only for initial trade and is not applicable to martingale trades

a.      After exit, wait for barwait no. of bars and if immediate bar is positive/bullish then initialtrade is buy; if immediate bar is negative/bearish then initial trade is sell

4.      Place Long Order (OrderSend) only if Current Price is < PriceNotToLong  and  Place short order only if  Current Price is > PriceNotToShort

5.      Check if satisfies Max Spread & Max Slippage

6.      If TrailingStopInitTradeMode is Off then use TP as follows

7.      AsianSessionTP ; LondonSessionTP; USSessionTP each can be set as fixed points for TP or as percent of ATR(UserATRPeriod) x ATRFactor

8.      If InitTradeTrailingStopMode is on – InitTradeTrailingDistancePnts; InitTradeTrailingStepPnts

9.      Trailing Stop for Initial Trade Only takes effect after the moving above entry price (i.e. trailingstop will only kick in to take profit when price retrace); for loss below entry price, using martingale

 

Martingale trades

1.      Martingale – For each Martingale levels user can define/input MartgLotSize, PipsFromPrevTrade, MartgTP

2.      If MartgMaxLevel > 0 and Current Martg Count <10 and Abs (Current Price – Last Order Executed) > PipsFromPrevTrade then place new martg order

3.      MartgTrailingStopMode – Can be On or Off to decide whether to use Trailing Stop for Martingale trade

4.      Trailing Stop – MartgTrailingDistancePnts; MartgTrailingStepPnts

 

EA Operating Hours (Op. Hr. Start / End for Monday to Friday; 2 sections per day; format of 00:00 to 24:00)

1.      Start Hours and Ending Hours (for Monday to Friday) – no trade if not within trading hours (00:00 to 24:00)

1.      MonOpHrStart1 ; MonOpHrEnd1 ; MonOpHrStart2 ; MonOpHrEnd2

2.      TueOpHrStart1 ; TueOpHrEnd1 ; TueOpHrStart2 ; TueOpHrEnd2

3.      WedOpHrStart1 ; WedOpHrEnd1 ; WedOpHrStart2 ; WedOpHrEnd2

4.      ThuOpHrStart1 …

5.      FriOpHrStart1 …

6.      Only trade if CurrentTime is within EA Operating hours– that is:

a.      If DayOfWeek is Monday and CurrentTime Is within (MonOpHrStart1 and MonOpHrEnd1) or (MonOpHrStart1 and MonOpHrEnd2) then execute trade

b.      If DayOfWeek is Tuesday and CurrentTime is within (TueOpStart1 …

 

Money Management

1.      Before placing the order (OrderSend) check what would be the Free Margin had the trade taken place, if it’s less than the user parameter (MinFreeMargin) then don’t place order

2.      Before placing the order, check what would be the “margin used” had the trade taken place, if margin used is more than user parameter (MaxMarginUsed) then don’t pace order

a.      Because MaxMarginUsed is a proxy of positions open and level of risk in the event of highly volatile market

3.     MaxMarginUsed is affected by MarginLoadOfSymbol – MarginLoadOfSymbol is calculated by EA – to calculate, simply adding initial trade Lot, plus M1 Lot, M2 Lot, M3 Lot  (from set file) upto MaxLevel – this calculation is done at EA Initialization/start Stage


Responded

1
Developer 1
Rating
(414)
Projects
670
33%
Arbitration
60
17% / 32%
Overdue
113
17%
Working
2
Developer 2
Rating
(73)
Projects
257
53%
Arbitration
16
50% / 38%
Overdue
83
32%
Free
3
Developer 3
Rating
(94)
Projects
148
59%
Arbitration
16
38% / 13%
Overdue
25
17%
Free
Published: 1 code
4
Developer 4
Rating
(49)
Projects
134
27%
Arbitration
62
13% / 53%
Overdue
58
43%
Free
Published: 304 articles, 1 code
5
Developer 5
Rating
(1)
Projects
1
0%
Arbitration
1
0% / 100%
Overdue
0
Free
Similar orders
Criei um Robô para a venda alta precisão que automatiza a estratégia de correção média de Larry Williams. Possui filtros de tendência seletiva, controle de lote por risco percentual e execução rápida. Compatível com contas Hedge e Netting. Configuração simples e otimizada para mercados de alta volatilidade. *55(16) 993786056
SMC ORDER BLOCK 30 - 60 USD
I want already build FULLY AUTOMATED order block MT5 XAUUSD HTF H4 ENTRY LTF M15 - Show result on live account. m15 ob entry in the direction of h4 ob bias the developper to provide source code in the end
I need an MT5 Expert Advisor built as a high-precision volumizer for Forex. Its core purpose is to generate controlled trading volume for rebates, while still maintaining low-risk account growth. I am not looking for aggressive profit chasing. I am looking for a stable, intelligent EA that can produce volume in a disciplined way without damaging the account. The ideal system should trade major currency pairs, avoid
1. IF price forms: - Higher highs + higher lows → TREND = BUY - Lower highs + lower lows → TREND = SELL ELSE → NO TRADE 2. IF: - Trend = BUY - Price retraces to support zone - Bullish engulfing candle forms - TDI green crosses above red (optional) THEN: - Execute BUY 3. IF: - Trend = SELL - Price retraces to resistance - Bearish engulfing forms - TDI confirms THEN: - Execute SELL 4. Risk per trade = 1% of account Lot
I need a high frequency trading robot for gold in one or 5 minute timeframe the robot should have spread filter where it should only open trades below a set spread should have news filter to allow trading during fundal news or not the robot should have input in number of minutes to close all open trades and remove pending orders before fundamental news as part of news filter. It should also have the number of minutes
Hello! I want to programm EA that uses volume profile indicator, but I am not sure if this is possible. Only experienced programmers please, I will not select a programmer who did only few jobs. Before starting I need to make sure you understand everything and that this is for sure technically possible
Hello, I am looking for a professional trading system including: 1- Trading Bot (Expert Advisor): - Good profit performance - High security and strong risk management - Works efficiently during high market volatility (news and strong movements) - Works on all pairs (Forex + Gold) 2- Signal Indicator: - Provides clear Buy and Sell signals - Includes Take Profit and Stop Loss - No repaint (signals must not change or
Hi, I’m looking for a top-tier, profit-optimized EA that has the potential to scale trading returns significantly. My goal is to maximize growth over time. Can you help develop a bespoke EA that could potentially scale to high six or seven figures
Max amount grid 30+ USD
max amount grid step for magic number do keep deleting .only when it is in negative floating .but when it is profit allow to go over the max and replays to grid step

Project information

Budget
50 - 120 USD
Deadline
from 5 to 10 day(s)