Tarea técnica

HI

i want some one to make the following MQL5 code work for me. the code has errors.


#include <Trade\Trade.mqh> // Include the trade library


// Define input parameters

input double lotSize = 0.1;    // Lot size for trading

input int stopLoss = 50;       // Stop Loss in pips

input int takeProfit = 100;    // Take Profit in pips


//+------------------------------------------------------------------+

//| Expert initialization function                                   |

//+------------------------------------------------------------------+

int OnInit()

{

    // Subscribe to OnTrade() event

    EventSetMillisecondTimer(60);  // Set a timer to check conditions every 60 milliseconds

    return(INIT_SUCCEEDED);

}


//+------------------------------------------------------------------+

//| Expert deinitialization function                                 |

//+------------------------------------------------------------------+

void OnDeinit(const int reason)

{

    // Deinitialization function (if needed)

    EventKillTimer();  // Kill the timer when deinitializing

}


//+------------------------------------------------------------------+

//| Expert tick function                                             |

//+------------------------------------------------------------------+

void OnTick()

{

    // Nothing to do here for conditions check, as we use OnTrade()

}


//+------------------------------------------------------------------+

//| Expert trade event handler                                       |

//+------------------------------------------------------------------+

void OnTrade()

{

    // Calculate the open and close prices of the previous day

    double prevDayOpen = iOpen(Symbol(), PERIOD_D1, 1);

    double prevDayClose = iClose(Symbol(), PERIOD_D1, 1);


    // Check for Rule 1: Previous day was an uptrend

    if (prevDayClose > prevDayOpen)

    {

        // Check if the current open price is between the previous day's open and close prices

        double currentOpen = iOpen(Symbol(), PERIOD_D1, 0);

        if (currentOpen > prevDayOpen && currentOpen < prevDayClose)

        {

            // Buy if the price breaks above the previous day's close price

            double currentHigh = iHigh(Symbol(), PERIOD_D1, 0);

            if (currentHigh > prevDayClose)

            {

                // Place a Buy order

                double openPrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK);

                double stopLossPrice = openPrice - stopLoss * _Point;

                double takeProfitPrice = openPrice + takeProfit * _Point;


                int ticket = OrderSend(_Symbol, OP_BUY, lotSize, openPrice, 3, 0, 0, "", 0, clrNONE, 0, clrNONE);

                if (ticket > 0)

                {

                    // Order placed successfully - set Stop Loss and Take Profit

                    OrderSend(_Symbol, OP_SELL, lotSize, openPrice, 0, stopLossPrice, takeProfitPrice, "", 0, clrNONE, 0, clrNONE);

                }

            }

        }

    }


    // Check for Rule 2: Opposite of Rule 1

    if (prevDayClose < prevDayOpen)

    {

        // Check if the current open price is between the previous day's open and close prices

        double currentOpen = iOpen(Symbol(), PERIOD_D1, 0);

        if (currentOpen > prevDayOpen && currentOpen < prevDayClose)

        {

            // Sell if the price breaks below the previous day's close price

            double currentLow = iLow(Symbol(), PERIOD_D1, 0);

            if (currentLow < prevDayClose)

            {

                // Place a Sell order

                double openPrice = SymbolInfoDouble(_Symbol, SYMBOL_BID);

                double stopLossPrice = openPrice + stopLoss * _Point;

                double takeProfitPrice = openPrice - takeProfit * _Point;


                int ticket = OrderSend(_Symbol, OP_SELL, lotSize, openPrice, 3, 0, 0, "", 0, clrNONE, 0, clrNONE);

                if (ticket > 0)

                {

                    // Order placed successfully - set Stop Loss and Take Profit

                    OrderSend(_Symbol, OP_BUY, lotSize, openPrice, 0, stopLossPrice, takeProfitPrice, "", 0, clrNONE, 0, clrNONE);

                }

            }

        }

    }

}


Han respondido

1
Desarrollador 1
Evaluación
(237)
Proyectos
298
28%
Arbitraje
33
24% / 61%
Caducado
9
3%
Trabaja
2
Desarrollador 2
Evaluación
(139)
Proyectos
181
24%
Arbitraje
23
22% / 39%
Caducado
13
7%
Libre
3
Desarrollador 3
Evaluación
(321)
Proyectos
497
19%
Arbitraje
33
42% / 30%
Caducado
32
6%
Ocupado
4
Desarrollador 4
Evaluación
(43)
Proyectos
56
4%
Arbitraje
7
0% / 57%
Caducado
4
7%
Trabaja
5
Desarrollador 5
Evaluación
(194)
Proyectos
241
34%
Arbitraje
10
50% / 50%
Caducado
8
3%
Trabaja
Ha publicado: 1 artículo, 8 ejemplos
6
Desarrollador 6
Evaluación
(246)
Proyectos
253
30%
Arbitraje
0
Caducado
3
1%
Libre
Ha publicado: 2 ejemplos
7
Desarrollador 7
Evaluación
(268)
Proyectos
396
27%
Arbitraje
38
39% / 50%
Caducado
1
0%
Libre
8
Desarrollador 8
Evaluación
(151)
Proyectos
188
57%
Arbitraje
10
80% / 0%
Caducado
0
Libre
Ha publicado: 1 ejemplo
9
Desarrollador 9
Evaluación
(84)
Proyectos
162
43%
Arbitraje
3
67% / 0%
Caducado
5
3%
Trabaja
Ha publicado: 1 ejemplo
10
Desarrollador 10
Evaluación
(37)
Proyectos
59
27%
Arbitraje
26
19% / 54%
Caducado
10
17%
Trabaja
Ha publicado: 1 ejemplo
11
Desarrollador 11
Evaluación
(1156)
Proyectos
1462
63%
Arbitraje
21
57% / 10%
Caducado
43
3%
Libre
12
Desarrollador 12
Evaluación
(516)
Proyectos
784
63%
Arbitraje
33
27% / 45%
Caducado
23
3%
Libre
Ha publicado: 1 ejemplo
13
Desarrollador 13
Evaluación
(43)
Proyectos
66
12%
Arbitraje
12
58% / 42%
Caducado
1
2%
Libre
14
Desarrollador 14
Evaluación
(539)
Proyectos
619
33%
Arbitraje
35
37% / 49%
Caducado
11
2%
Ocupado
15
Desarrollador 15
Evaluación
(12)
Proyectos
25
4%
Arbitraje
1
0% / 0%
Caducado
7
28%
Libre
16
Desarrollador 16
Evaluación
(449)
Proyectos
475
69%
Arbitraje
6
67% / 0%
Caducado
2
0%
Trabaja
17
Desarrollador 17
Evaluación
(152)
Proyectos
228
80%
Arbitraje
22
27% / 50%
Caducado
11
5%
Libre
Ha publicado: 24 artículos, 1882 ejemplos
18
Desarrollador 18
Evaluación
(45)
Proyectos
76
20%
Arbitraje
7
0% / 86%
Caducado
14
18%
Libre
19
Desarrollador 19
Evaluación
(2)
Proyectos
2
0%
Arbitraje
1
0% / 0%
Caducado
2
100%
Libre
20
Desarrollador 20
Evaluación
(45)
Proyectos
46
24%
Arbitraje
34
9% / 85%
Caducado
10
22%
Libre
21
Desarrollador 21
Evaluación
(3)
Proyectos
2
50%
Arbitraje
2
0% / 100%
Caducado
0
Libre
22
Desarrollador 22
Evaluación
(15)
Proyectos
20
35%
Arbitraje
3
0% / 100%
Caducado
0
Libre
Ha publicado: 1 ejemplo
23
Desarrollador 23
Evaluación
(257)
Proyectos
341
58%
Arbitraje
7
14% / 71%
Caducado
9
3%
Libre
24
Desarrollador 24
Evaluación
(3)
Proyectos
1
0%
Arbitraje
5
0% / 100%
Caducado
0
Libre
25
Desarrollador 25
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Solicitudes similares
BencookFX EA 10000+ USD
THE STRATEAGY OF BECOOK FX IS LITERALLY A CODE WHICH IT DEAD TIME ZONE ON ICT AND RETAIL TRADER COMBINE WHICH IS A TEST FOR THOSE WHO WANT TO TRADE AND ACT LIKE
Scalping ea mt5 30 - 50 USD
PHẦN 1: TIẾNG ANH (For MQL5 Freelance) Title: I need a Pro Dev for Scalping EA: I provide STRICT Money Management, YOU provide the Strategy Description: I have a strict Capital & Risk Management Framework. The Entry Strategy is UP TO YOU (Must be "King Scalping" / Multi-Timeframe style). 1. STRATEGY (YOUR JOB) * Requirement: You decide the entry logic. It must be a High Probability and High Volume scalping strategy
Hi, I’m searching for a developer who already has a high‑performance Gold EA that can beat the results shown in my screenshot. If you have such an EA, please reply with: - A brief description of how it works (grid, scalping, SMC, etc.) - Backtest results and the set files you used - Whether you’re willing to make minor tweaks so I can use it as my own If the performance looks good, we can discuss adjustments and next
Multi-Asset AI Trading Bot Details Proposals I want a single, cohesive AI bot that can log in to MetaTrader, Coinbase, Robinhood, and TradingView, scan live market data, and execute trades automatically in stocks, forex, and crypto. The core logic must support day-trading, swing-trading, and scalping modes that I can toggle on a schedule or by simple configuration. The workflow I picture is: • Real-time data
I need someone that is able to develop for me a MT5 EA that perform VERY WELL on XAUUSD. Every strategy is accepted. By applying, please send me screenshot of results since 2018
Hello developers, I'm looking for existing, proven EAs (MQL5) that work flawlessly on MT5. Requirements: Demo version available for testing Backtest results + screenshots Verified trade history from 2018-2025 Budget is negotiable If you've got an EA that fits, hit me up
cần người tạo EA y thay đổi hình ảnh gửi đầy đủ tính năng như hình giá cả có thể tăng thêm khối lượng mong muốn viết giống hình không khác ROBOT HƠI NHIỀU TÍNH NĂNG MỌI NGƯỜI CÓ THỂ ĐƯA GIÁ THAM KHẢO
Need a HFT scalping EA 30 - 100 USD
Require the development of a high-speed HFT, fully automated trading Expert Advisor (EA) for MetaTrader 5 , optimized for live trading on both Deriv and Exness . The EA must be designed for fast execution, low latency, and reliability on real-money accounts , with full compatibility across broker-specific contract specifications, tick sizes, tick values, pricing formats, and volume rules. It should automatically
1. Background & MQL5 Journey: ¿Cuéntame un poco sobre tu background en trading algorítmico y qué te emociona de crear EAs de alto rendimiento? 2. Experience: ¿Cuáles son 2-3 EAs destacados que has creado (mercados, Sharpe, PF, señales/backtests)? 3. Institutional Results: ¿Puedes lograr Sharpe ≥3.0, PF >2.5, <10% DD en XAUUSD? ¿Qué te da confianza? 4. Demo EA: ¿Tienes una señal de EA top (MQL5/Myfxbook) con 100+
Here's the TradeStation ELD files that i want to convert to tradingview pine script (unprotected so you can see codes for indicators and systems/strategies) - let me know what you think it would cost? thanks i will be looking for great developer that will bid it for it and get started

Información sobre el proyecto

Presupuesto
30+ USD