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

Termos de Referência

// 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
}

Respondido

1
Desenvolvedor 1
Classificação
(1)
Projetos
1
0%
Arbitragem
2
50% / 50%
Expirado
0
Livre
2
Desenvolvedor 2
Classificação
(104)
Projetos
127
24%
Arbitragem
23
30% / 52%
Expirado
8
6%
Trabalhando
3
Desenvolvedor 3
Classificação
(434)
Projetos
638
53%
Arbitragem
32
59% / 22%
Expirado
6
1%
Trabalhando
4
Desenvolvedor 4
Classificação
(64)
Projetos
68
25%
Arbitragem
12
42% / 42%
Expirado
4
6%
Livre
5
Desenvolvedor 5
Classificação
(2671)
Projetos
3405
68%
Arbitragem
77
48% / 14%
Expirado
342
10%
Livre
Publicou: 1 código
6
Desenvolvedor 6
Classificação
(318)
Projetos
565
35%
Arbitragem
81
31% / 44%
Expirado
204
36%
Livre
7
Desenvolvedor 7
Classificação
(11)
Projetos
16
25%
Arbitragem
1
0% / 100%
Expirado
1
6%
Livre
8
Desenvolvedor 8
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
9
Desenvolvedor 9
Classificação
(37)
Projetos
59
27%
Arbitragem
26
19% / 54%
Expirado
10
17%
Trabalhando
Publicou: 1 código
10
Desenvolvedor 10
Classificação
(77)
Projetos
245
74%
Arbitragem
7
100% / 0%
Expirado
1
0%
Livre
Publicou: 1 artigo
11
Desenvolvedor 11
Classificação
(11)
Projetos
18
28%
Arbitragem
4
50% / 50%
Expirado
1
6%
Livre
12
Desenvolvedor 12
Classificação
(11)
Projetos
11
0%
Arbitragem
5
20% / 60%
Expirado
2
18%
Livre
13
Desenvolvedor 13
Classificação
(72)
Projetos
80
10%
Arbitragem
38
8% / 58%
Expirado
6
8%
Livre
14
Desenvolvedor 14
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
15
Desenvolvedor 15
Classificação
(568)
Projetos
641
41%
Arbitragem
25
48% / 36%
Expirado
46
7%
Trabalhando
16
Desenvolvedor 16
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
17
Desenvolvedor 17
Classificação
(75)
Projetos
80
6%
Arbitragem
46
11% / 54%
Expirado
7
9%
Trabalhando
Pedidos semelhantes
I have an existing MT5 Expert Advisor for XAUUSD M5. This is NOT a new robot from zero. I need modification and professional review of an existing MQL5 EA. Main goals: 1. Buy entries: Buy trades are currently too rare. The Buy ADX filter was very strict at 45. I am testing 40 now. I need you to review the Buy entry filters and improve Buy entry quality without making entries random or weak. 2. Sell entries: Sell
I am looking for an experienced MQL5 developer to build a professional MetaTrader 5 (MT5) Expert Advisor (EA) for swing trading. Trading Pairs EUR/USD USD/JPY Timeframes Daily (D1) for trend identification. H4 for trade entries. Strategy The EA should: Detect Daily market structure (HH, HL, LH, LL) using confirmed swing highs and lows (not relying solely on ZigZag). Use DMI/ADX for trend confirmation. Open trades
Hello, I want an EA which does martingale and has hedge feature. You may be confused by what this mean entirely so reach out to me so we can talk in depth as what I have said here is very vague for someone to clearly understand. I am not paying a single dollar over $30, so don't apply if you don't agree with that. Thank you for taking your time to read this
أحتاج إلى مستشار خبير لمنصة MetaTrader 5 (MT5) مصمم كآلة حالة محدودة (FSM). يجب أن ينفذ أوامر السوق فقط بناءً على مستويات أسعار يحددها المستخدم. يجب ألا يستخدم أي مؤشرات أو تحليل فني أو أوامر معلقة أو ذكاء اصطناعي أو قرارات تداول تلقائية. يجب أن ينفذ المستشار الخبير ببساطة تسلسلًا محددًا مسبقًا لمستويات الأسعار كما يحددها المستخدم تمامًا، مع إدارة دقيقة للحالة، ودورة نشطة واحدة في كل مرة، ومعالجة الفجوات السعرية،
Message me please for the investor login. You will replicate the ea and I shall tell u some things about it, I am not paying over $100. You should have great skills. The EA can handle any market and shall not blow the account
TPO 30+ USD
Develop an MT5 EA that continuously follows market direction using one active market position and one opposite trailing pending stop order. EA must be able to work with manual trading, any MT5 indicators, Strategy Tester, Live Account, all VPS and Demo Account. EA able to trade forex, XAUUSD, Indices and Cryptocurrencies
Part 1: Project setup Input settings (risk, stop loss, take profit, EMA periods) Indicator initialization Trade management framework Part 2: Trading logic EMA crossover detection Buy/Sell entry rules One-trade-per-symbol check Part 3: Risk management Automatic lot size calculation Stop-loss and take-profit placement Trade execution and error handling Part 4: Final touches On-screen information Optimization
I am looking for an experienced MQL4 or MQL5 developer to build a high-frequency (HFT) latency arbitrage Expert Advisor for cryptocurrency trading between LMAX and IC Markets. I need someone who understands low-latency execution, price feeds, slippage, spreads, and fast order execution. The basic idea is that LMAX acts as the leading price feed while IC Markets is the execution broker. The EA should constantly
Can you Build a custom NinjaTrader 8 ChartStyle or BarsType called Optimized Footprint Bars. This project is urgent and i need someone that's wiiling to do his project with me kinldy bid for this. Thanks
Hello, I am reopening this project with a fully updated and clarified specification. I am looking for a high‑level MQL5 developer who can deliver a clean, stable, and professional Phase 1 version of my: Institutional‑Grade Multi‑Currency MT5 EA (A2SR + SMC + Smart Recovery + Smart Grid + Liquidity + Volatility + Safety Filters) This EA is not a simple indicator conversion or a basic strategy. It is a structured

Informações sobre o projeto

Orçamento
30 - 50 USD