Simple Martingale Based EA

MQL4 전문가

작업 종료됨

실행 시간 7 일
고객의 피드백
Amazing Service
피고용인의 피드백
Thanks a lot!

명시

This is a simple Martingale based EA with RSI indicator used as buy/sell order conditions

Mandatory Inputs:

extern double TakeProfit = 120.0; // self explanatory for first order, for martingale orders it will adjust TP of all orders of the same type (buy / sell) to one, for example if an order opened at 100, 2nd opens at 105, the both of their tps will be at the same point, if an order is manually closed, it will adjust existing order tps accordingly.

extern double StopLoss = 1000.0; // self explanatory for each order it has its own stoploss

extern double InitialLots = 0.03;

extern double MartingaleFactor = 2; // Self explanatory - previous lot size will be multiplied to the next lotsize, so if initial lot is 0.03, 2nd order will be multiplied to 0.03, and 3rd will be multiplied to the 2nd order and so on

extern int MagicNumberBuy = 1986; // self explanatory

extern int MagicNumberSell = 5591; // self explanatory

extern int StartHour = 3; // self explanatory - ea will start working

extern int EndHour = 23; // // self explanatory - ea will stop working

extern double RSI_Period = 14; // self explanatory - variable rsi period setting

extern double RSI_Upper = 60.0; // ea will place sell order if rsi goes above this point -- only first order will follow this rule, martingale orders will be placed according to PointsAfterDistance has reached

extern double RSI_Lower = 30.0; // ea will place buy order if rsi goes below this point -- only first order will follow this rule, martingale orders will be placed according to PointsAfterDistance

extern int MaxTrades = 3; // Maximum number of trades per type (buy/sell) for martingale, when this number has reached it will not place any more orders until closed orders either hit tp or in case of one or more orders hit sl and then number of existing orders changes so it will place orders upto this limit.

extern int PointsAfterDistance = 400; // After the initial order is placed, if the price is going away from tp and this distance has reached, the martingale order will open. this martingale order will not open if the market has gone away from the tp and then coming back, all subsequent orders will have minimum PointsAfterDistance between them, it could be more, but not less than this. If this distance has reached, the order will wait for the new bar to open even if the distance has increased. The ea will make sure all orders follow relevant magic sell/buy numbers and their original type it should not interfere or be interrupted by any other ea's magic numbers All subsequent martingale order should follow the original order type, for example if original order is buy, the 2nd and subsequent orders should be buy and same for sell orders. BarTrade = true/false - if true it will place order only in the first minute of bar and if false, it will place order at any point when conditions are met (for example if placed on 1hr chart and conditions are met it will place order between 07:00:00 - 07:00:59)


Overview and Explanation:

This Expert Advisor is to be designed to trade based on an RSI under/oversold with an integrated Martingale Strategy. The key features include dynamic adjustment of Take Profit (TP) levels, flexible trade placement rules, and strict adherence to the original order's direction (buy/sell). Below is a brief summary of the functionality, followed by clarifications of each parameter.

Summary of the EA Functionality:

  • Initial Trade Conditions: The EA places an initial buy or sell order based on the Relative Strength Index (RSI) indicator's thresholds. It monitors the RSI level against user-defined upper and lower limits.

  • Martingale Strategy: If the price moves against the initial trade by a specified distance ( PointsAfterDistance ), the EA places additional trades in the same direction as the initial trade, increasing the lot size by a multiplier ( MartingaleFactor ).

  • Dynamic TP Adjustment: When a new Martingale order is placed, the EA adjusts the TP for all open orders of the same type (buy or sell) to a unified TP level. This level is recalculated based on the latest order's price.

  • Order Management: The EA continues placing Martingale orders until the maximum number of trades ( MaxTrades ) is reached. It only opens new orders if the market conditions meet the specified criteria, and orders are placed within the allowed trading hours.

  • Bar Trading Mode: The EA can be configured to place orders only at the beginning of a new bar or immediately when conditions are met, depending on the BarTrade setting.

Clarifications of EA Parameters:

  1. TakeProfit (TP):

    • First Order: The TP for the first order is placed based on this value.
    • Martingale Orders: When subsequent Martingale orders are placed, the EA adjusts the TP of all open orders of the same type to a single, unified TP level. This ensures that all trades close simultaneously if the price reaches this level. If an order is manually closed, the EA will recalculate and adjust the TP for the remaining orders accordingly.
  2. StopLoss (SL):

    • Each order has its own SL based on the StopLoss value provided. The SL does not change after the order is placed and is independent for each trade.
  3. InitialLots:

    • This parameter defines the lot size for the initial trade. Subsequent Martingale orders will increase the lot size based on the MartingaleFactor .
  4. MartingaleFactor:

    • The lot size of each Martingale order is multiplied by this factor relative to the previous order. For example, if InitialLots is 0.03 and MartingaleFactor is 2, the lot size progression will be 0.03, 0.06, 0.12, etc.
  5. MagicNumberBuy & MagicNumberSell:

    • These are identifiers to differentiate buy and sell orders placed by the EA. The EA ensures that it only manages orders with these magic numbers and does not interfere with other EAs or manual trades.
  6. StartHour & EndHour:

    • The EA will only place trades between these hours. This ensures that the EA operates within a defined trading window.
  7. RSI_Period, RSI_Upper, RSI_Lower:

    • The EA uses the RSI indicator with the specified period to determine the initial trade. If the RSI crosses above the RSI_Upper , a sell order is placed. If it crosses below the RSI_Lower , a buy order is placed. Martingale orders do not rely on the RSI but are based on price movement away from the initial order's TP.
  8. MaxTrades:

    • Limits the maximum number of trades (buy or sell) the EA will open in a Martingale series. Once this limit is reached, the EA will not place any more orders until one or more existing orders are closed, either by hitting the TP or SL.
  9. PointsAfterDistance:

    • Defines the minimum distance (in points) from the initial order’s TP where a Martingale order will be triggered. The EA waits for a new bar to open before placing the Martingale order, ensuring that trades are not clustered too closely.
  10. BarTrade (true/false):

  • true: The EA will only place orders in the first minute of a new bar (e.g., between 07:00:00 and 07:00:59 on an H1 chart).
  • false: The EA will place orders immediately when the conditions are met, regardless of the time within the current bar.

Additional Considerations:

  • Manual Order Closures: If an order is manually closed, the EA will recalculate the TP for the remaining open orders to ensure they are aligned with the latest market conditions.
  • Trade Type Consistency: Martingale orders will always follow the direction of the initial trade. For example, if the first order is a buy, all subsequent Martingale orders will also be buys, and the same applies to sell orders.

NOTES:

Ideally the code needs to be less than 400 lines no mored than 500 lines, this is an experimental ea and any comments in the code would be appreciated. 

The code will be tested on real market as well as demo. I have made a code through AI which works fine except it just stops sometimes and doesn't work. I would rather pay someone to code the above for me than just use AI to generate the code as there's always something wrong with AI generated codes. 

응답함

1
개발자 1
등급
(360)
프로젝트
432
54%
중재
20
55% / 15%
기한 초과
29
7%
작업중
2
개발자 2
등급
(22)
프로젝트
21
10%
중재
4
25% / 75%
기한 초과
0
무료
3
개발자 3
등급
(104)
프로젝트
168
24%
중재
23
9% / 78%
기한 초과
16
10%
작업중
4
개발자 4
등급
(2)
프로젝트
2
0%
중재
1
0% / 100%
기한 초과
0
무료
5
개발자 5
등급
(60)
프로젝트
87
29%
중재
24
13% / 58%
기한 초과
7
8%
작업중
6
개발자 6
등급
(50)
프로젝트
64
20%
중재
11
27% / 55%
기한 초과
5
8%
무료
7
개발자 7
등급
(45)
프로젝트
91
13%
중재
34
26% / 59%
기한 초과
37
41%
무료
8
개발자 8
등급
(144)
프로젝트
186
41%
중재
24
58% / 21%
기한 초과
13
7%
무료
9
개발자 9
등급
(2)
프로젝트
2
50%
중재
0
기한 초과
1
50%
무료
10
개발자 10
등급
(102)
프로젝트
105
60%
중재
0
기한 초과
0
무료
11
개발자 11
등급
(162)
프로젝트
287
34%
중재
18
22% / 61%
기한 초과
42
15%
작업중
12
개발자 12
등급
(11)
프로젝트
18
28%
중재
4
50% / 50%
기한 초과
1
6%
무료
13
개발자 13
등급
(77)
프로젝트
243
74%
중재
7
100% / 0%
기한 초과
1
0%
무료
게재됨: 1 기고글
14
개발자 14
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
15
개발자 15
등급
(43)
프로젝트
73
23%
중재
11
9% / 55%
기한 초과
18
25%
무료
게재됨: 1 코드
16
개발자 16
등급
(271)
프로젝트
553
50%
중재
57
40% / 37%
기한 초과
227
41%
작업중
17
개발자 17
등급
(296)
프로젝트
475
40%
중재
105
40% / 24%
기한 초과
80
17%
바쁜
게재됨: 2 코드
18
개발자 18
등급
프로젝트
0
0%
중재
1
0% / 100%
기한 초과
0
무료
19
개발자 19
등급
프로젝트
1
0%
중재
4
0% / 50%
기한 초과
0
작업중
비슷한 주문
This is yakubu Jnr trading bots I create the trading robots to help my self and others traders to be successful please you can join my live trading bots or subscribe to my trading robots
Nyasco 90+ USD
Fast trading bot for starters less losses which leads to bigger profits made for thousands of people making billions of dollars .be the best trader for your self all the way
Nyasco 30+ USD
Faster robot with less losses which can be used for a long term earning money every day creating a bot for more than thousands of people to earn billions of money
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
Apply with a screen of your work . Symbol Specific Logic . Live Chart Optimization Check the Core logic . [back tests as well] Change points to pips . Create buffer for the zone
I will pay 3000+ USD (negotiable) for an EA for existing MT5 that generates a minimum of 15-20% or higher a month consistently (provide source code after final deal) Looking for a highly profitable EA Please send demo version directly subject (Buying profitable EA Budget up to $ 3000 USD), past results and optimal settings so I can test, if it performs in a strategy tester i will also need option to forward test it
EA fx 30+ USD
Hello, I need an already developed EA similar to the one trading XAUUSD, with consistent entries and good risk management. Before we proceed, I would like to verify its performance. Please provide a live or demo account login along with the investor (read-only) password so I can monitor the trading results. I am looking for stable performance, controlled drawdown, and consistent profit on gold (XAUUSD). Once I
The strategy records the highest and lowest prices within a specified duration (default 15 minutes) after the New York market opens, forming the opening range. Post-Formation Breakout: When the price breaks above or below the opening range after its formation, it may indicate the direction of the day’s price movement. Trend Confirmation: The strategy uses two EMAs (default 20-period and 50-period) as trend filters to
Tengo una estrategia basada en divergencia para el oro sobre todo en tf m1 Basado en divergencia con stoch .. confirmando la entrada con ciertos parameteos de entrada Es mejor conversarlo para dar mejor los detalles Cuando entrar, porque o todas las divergencias se debe tomar para entrar en compras o ventas He adjuntado un ejemplo La confrmacion más exacta es el cruce de esos parámetros de stoch edebajo de level de

프로젝트 정보

예산
70+ USD
기한
에서 3  5 일