Requested Modifications for MT5 EA

MQL5 エキスパート

仕事が完了した

実行時間26 日
依頼者からのフィードバック
Trabajo perfecto. el desarrollador fue muy paciente y realizó todos los cambios necesarios para que el proyecto saliese correctamente
開発者からのフィードバック
Excelente cliente, respetuoso y que sabe lo que quiere, espero seguir trabajando con el en el futuro

指定

I have an Expert Advisor (EA) already operating on MetaTrader 5, and I would like you to implement some specific modifications. Below, I describe how the EA currently works, followed by the exact instructions that need to be implemented to achieve the desired behavior.


1. Current Functionality of the EA (HARD10 Base)

  • The EA opens a buy or sell trade on initialization, depending on the parameter OperarEnVenta ( true = sell, false = buy).

  • The trade opens with a LoteInicial (initial lot size), and SL/TP values in pips, all defined via inputs.

  • If the trade closes by Stop Loss (SL):

    • The lot size is multiplied by MultiplicadorLotes for the next trade.

    • A counter of consecutive SLs is incremented.

    • If the maximum number of consecutive SLs ( MaximosSLseguidos ) is reached, the EA stops trading.

  • If the trade closes by Take Profit (TP):

    • The lot size resets to the initial value.

    • The SL counter resets.

    • If DetenerTrasTP = true , the EA stops trading.

  • If the trade is closed manually:

    • The lot size and counters reset as well.

  • The EA uses a MagicNumber to filter only its own trades.

  • All this logic runs independently on each chart/symbol where the EA is attached.


2. Requested Modifications

a) Activation by Hour and Minute

I want the EA to remain inactive for opening new trades until a user-defined hour and minute is reached. However, it must still detect closed trades before that time in order to maintain synchronized logic across symbols.

Inputs to add:

input bool ActivarHoraDeInicio = true; input int HoraActivacion = 9; input int MinutoActivacion = 30;

  • If ActivarHoraDeInicio = true , the EA must wait until the specified time to begin opening trades.

  • Before activation, it must still:

    • Monitor closed trades,

    • Update the SL counter,

    • And adjust lot size or SL/TP values accordingly.

  • If the EA is loaded after that time, it should activate immediately.

b) SL/TP Expansion After Consecutive Losses 

I would like a feature that increases the SL and TP size after a specified number of consecutive losing trades.

Inputs to add:

input bool ActivarSLTPExpandido = true; input int SLsAntesDeExpandir = 5; input double FactorSLTPExpandido = 1.5; // Example: multiplies SL and TP by 1.5

  • If ActivarSLTPExpandido = true and the EA accumulates SLsAntesDeExpandir or more consecutive losses:

    • The next trade must use an SL and TP multiplied by FactorSLTPExpandido .

  • If a TP is reached or the trade is closed manually:

    • The lot size, SL, and TP return to normal values.

c) Shared State Across Multiple Charts

Currently, if the EA is attached to two different charts (e.g., EURUSD and XAUUSD), each instance operates independently. I want to change that.

Objective: All instances of the EA (even on different symbols) must share the same progression logic and multiplier.

Example:

  • On the EURUSD chart, the EA has executed 3 consecutive SLs, increasing the lot size.

  • On the XAUUSD chart, the EA is waiting for its scheduled activation time.

  • Once the EA activates on XAUUSD, it should:

    • Detect that previous SLs occurred in another symbol,

    • And resume the logic using the correct lot size and SL/TP multiplier.

Technical notes:

  • You can use global variables, files, or any clean and robust method to share this state.

  • It’s essential that each EA instance knows the current global progression state before executing any trade.


3. General Requirements

  • Deliver clean, efficient code that compiles without errors.

  • Final delivery must include the .mq5 source file.

  • If any request is not feasible exactly as described, I’m open to your technical suggestions.






ファイル:

MQ5
HARD10.mq5
5.8 Kb

応答済み

1
開発者 1
評価
(2)
プロジェクト
0
0%
仲裁
2
0% / 50%
期限切れ
0
2
開発者 2
評価
(429)
プロジェクト
628
54%
仲裁
30
53% / 23%
期限切れ
6
1%
取り込み中
3
開発者 3
評価
(1)
プロジェクト
2
0%
仲裁
1
0% / 100%
期限切れ
0
パブリッシュした人: 2 codes
4
開発者 4
評価
(44)
プロジェクト
53
38%
仲裁
8
13% / 38%
期限切れ
8
15%
仕事中

プロジェクト情報

予算
30 - 100 USD