I HAVE THE CODE ALREADY, BUT IT DOES NOT WORK, CAN YOU MAKE A FEW CHANGES FOR THE EXECUTION FOR THIS EA PLEASE.

Tarea técnica

// Input Parameters
input int TradeExecutionHour = 10; // Trade execution hour (server time)
input bool ManualLotSize = true; // Enable manual lot size adjustment
input bool RiskAllocation = true; // Enable percentage-based risk allocation
input double RiskPercentage = 2.0; // Percentage of risk per trade
input int CandleRangeCondition = 100; // Minimum candle range condition in points
input string Symbols = {"GER30.fin", "EURUSD", "GBPUSD"}; // Symbols to trade

// Global Variables
int ticketBuy, ticketSell;
double entryPointBuy, entryPointSell, stopLossBuy, stopLossSell, takeProfitBuy, takeProfitSell;
bool breakevenBuy = false, breakevenSell = false;

void OnTick()
{
    // Check trade execution time
    if (TimeHour(TimeCurrent()) == TradeExecutionHour)
    {
        // Check candle range condition
        if (CheckCandleRangeCondition())
        {
            // Calculate entry points
            CalculateEntryPoints();

            // Calculate lot size
            double lotSize = CalculateLotSize();

            // Place buy stop order
            ticketBuy = OrderSend(Symbol(), OP_BUYSTOP, lotSize, entryPointBuy, 2 * Point, stopLossBuy, takeProfitBuy);

            // Place sell stop order
            ticketSell = OrderSend(Symbol(), OP_SELLSTOP, lotSize, entryPointSell, 2 * Point, stopLossSell, takeProfitSell);
        }
    }

    // Check breakeven condition
    if (breakevenBuy && breakevenSell)
    {
        if (CheckBreakevenCondition())
        {
            // Move stop loss to breakeven
            MoveStopLossToBreakeven();
        }
    }
}

bool CheckCandleRangeCondition()
{
    double range = 0;
    for (int i = 0; i < 5; i++)
    {
        range += High[i] - Low[i];
    }
    range /= 5;
  
    return range >= CandleRangeCondition * Point;
}

void CalculateEntryPoints()
{
    double highestHigh = High[1];
    double lowestLow = Low[1];
  
    for (int i = 1; i <= 5; i++)
    {
        if (High[i] > highestHigh)
            highestHigh = High[i];
        if (Low[i] < lowestLow)
            lowestLow = Low[i];
    }
  
    entryPointBuy = highestHigh + 2 * Point;
    entryPointSell = lowestLow - 2 * Point;
    stopLossBuy = lowestLow - 2 * Point;
    stopLossSell = highestHigh + 2 * Point;
    takeProfitBuy = entryPointBuy + 3 * (entryPointBuy - stopLossBuy);
    takeProfitSell = entryPointSell - 3 * (stopLossSell - entryPointSell);
}

double CalculateLotSize()
{
    double lotSize = 0;
  
    if (ManualLotSize)
    {
        // Adjust the lot size manually for each trade
        // Add your own logic here
        lotSize = 0.01;
    }
    else if (RiskAllocation)
    {
        // Calculate lot size based on risk percentage
        double accountBalance = AccountBalance();
        double riskAmount = accountBalance * RiskPercentage / 100.0;
        double stopLossDistance = MathMax(stopLossBuy - entryPointBuy, entryPointSell - stopLossSell);
        lotSize = riskAmount / stopLossDistance;
    }
  
    return lotSize;
}

bool CheckBreakevenCondition()
{
    // Check if the price has reached 1 to 1 ratio
    // Add your own logic here
  
    return false;
}

void MoveStopLossToBreakeven()
{
    // Move stop loss to breakeven
    // Add your own logic here
}

Han respondido

1
Desarrollador 1
Evaluación
(1)
Proyectos
1
0%
Arbitraje
3
33% / 67%
Caducado
0
Libre
2
Desarrollador 2
Evaluación
(89)
Proyectos
112
24%
Arbitraje
11
45% / 18%
Caducado
8
7%
Trabaja
3
Desarrollador 3
Evaluación
(355)
Proyectos
484
51%
Arbitraje
24
54% / 25%
Caducado
5
1%
Trabajando
4
Desarrollador 4
Evaluación
(63)
Proyectos
68
25%
Arbitraje
12
42% / 42%
Caducado
4
6%
Libre
5
Desarrollador 5
Evaluación
(2441)
Proyectos
3076
66%
Arbitraje
77
48% / 14%
Caducado
340
11%
Libre
6
Desarrollador 6
Evaluación
(248)
Proyectos
444
34%
Arbitraje
56
36% / 38%
Caducado
163
37%
Trabajando
7
Desarrollador 7
Evaluación
(11)
Proyectos
16
25%
Arbitraje
0
Caducado
1
6%
Libre
8
Desarrollador 8
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
9
Desarrollador 9
Evaluación
(37)
Proyectos
59
27%
Arbitraje
25
20% / 52%
Caducado
10
17%
Trabaja
10
Desarrollador 10
Evaluación
(63)
Proyectos
194
73%
Arbitraje
4
100% / 0%
Caducado
1
1%
Libre
11
Desarrollador 11
Evaluación
(10)
Proyectos
16
25%
Arbitraje
3
67% / 33%
Caducado
1
6%
Trabaja
12
Desarrollador 12
Evaluación
(11)
Proyectos
11
0%
Arbitraje
4
25% / 50%
Caducado
2
18%
Libre
13
Desarrollador 13
Evaluación
(72)
Proyectos
80
10%
Arbitraje
36
8% / 53%
Caducado
6
8%
Trabaja
14
Desarrollador 14
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
15
Desarrollador 15
Evaluación
(568)
Proyectos
641
41%
Arbitraje
21
57% / 29%
Caducado
47
7%
Trabaja
16
Desarrollador 16
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
17
Desarrollador 17
Evaluación
(58)
Proyectos
66
6%
Arbitraje
27
19% / 37%
Caducado
4
6%
Trabajando
Solicitudes similares
I need to fix the alerts of my SMC Order Blocks indicator, which is a custom indicator created for me some time ago. This custom indicator already has several types of alerts built-in, but I need to fix specific ones while keeping the other existing alerts unchanged, as those do not have any errors. The alert is for a specific Order Blocks pattern. This indicator graphically provides a zigzag, and from there, CHoCH
Mobile robot 50 - 100 USD
I want a profitable scalping EA robot for mt5 and mobile phones (licence key should be provided).the video link attached below indicates how the EA robot should operate it.it analyses the market before taking trades and it trades candle to candle .also coding samples are provided on the video .it should be applicable to all timeframes.it should trade indices(Nas100,US30,S&p500,GER30,)
Martingale EA for MT5 30 - 100 USD
Criteria: Only one trade at a time. Cannot open another trade if one is running Trade on EURUSD only, once job is completed I will be happy to schedule more for other pairs You choose entry strategy and criteria win rate must be above 50% in long term backtest of EURUSD Every trade has got TP and SL Trades to last about a day, few trades a week, at least 10 pips gain per trade, so that it can be launched on normal
I have a indicator, mql file. The signals are seen below on a EURNZD H1 chart. Very important to get accurate entries. The signal to trade is the first tic after the the indicator signal paints. I've tried to demonstrate that below. Other than that the EA will have a lot size escalation, an on-screen pip counter, a button to stop taking new trades, SL/TP, and magic number. I would like the indicator to be within the
I would like to create an EA based on the Shved Supply and Demand indicator. you can find the Shved Supply and Demand v1.7 indicator in the following link https://www.mql5.com/en/code/29395 NB: Checks the trading robot must pass before publication in the Market ( https://www.mql5.com/en/articles/2555 ) MQ5 file to be provided
I want grate robot for making profits that know when to start a good trade and close a trade and must be active all time to avoid lost of money
Hi Guys, I am looking to someone that can generate an indicator for MT4 as explained below. Basically I would need that the indicator point out the price that will close my position in stop out/margin call. The indicator should pick automatically the level of trade out for the broker (which can be different from a broker to another broker) It should write (ideally on the bottom on the left) the following information
Mbeje fx 50+ USD
I like to own my robot that why I want to build my own.i like to be a best to every robot ever in the life to be have more money
I need an MT5 EA that can do the following: I have to give the EA a price in advance, when the price is reached the EA has to automatically place a buy stop or sell stop order 0.5 pips below or above the price. Is this possible
Good day, I want someone to help me create a universal news filter with on/off switch, with start and end settings, and drawdown control with magic number of EAs, etc. Thanks

Información sobre el proyecto

Presupuesto
30 - 50 USD
IVA (21%): 6.3 - 10.5 USD
Total: 36.3 - 60.5 USD
Para el ejecutor
27 - 45 USD