Specification

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);

                }

            }

        }

    }

}


Responded

1
Developer 1
Rating
(237)
Projects
298
28%
Arbitration
33
24% / 61%
Overdue
9
3%
Working
2
Developer 2
Rating
(139)
Projects
181
24%
Arbitration
23
22% / 39%
Overdue
13
7%
Free
3
Developer 3
Rating
(321)
Projects
497
19%
Arbitration
33
42% / 30%
Overdue
32
6%
Busy
4
Developer 4
Rating
(43)
Projects
56
4%
Arbitration
6
0% / 67%
Overdue
4
7%
Working
5
Developer 5
Rating
(194)
Projects
241
34%
Arbitration
10
50% / 50%
Overdue
8
3%
Working
Published: 1 article, 8 codes
6
Developer 6
Rating
(246)
Projects
253
30%
Arbitration
0
Overdue
3
1%
Free
Published: 2 codes
7
Developer 7
Rating
(268)
Projects
396
27%
Arbitration
38
39% / 50%
Overdue
1
0%
Free
8
Developer 8
Rating
(151)
Projects
188
57%
Arbitration
10
80% / 0%
Overdue
0
Free
Published: 1 code
9
Developer 9
Rating
(84)
Projects
162
43%
Arbitration
3
67% / 0%
Overdue
5
3%
Working
Published: 1 code
10
Developer 10
Rating
(37)
Projects
59
27%
Arbitration
26
19% / 54%
Overdue
10
17%
Working
Published: 1 code
11
Developer 11
Rating
(1156)
Projects
1462
63%
Arbitration
21
57% / 10%
Overdue
43
3%
Free
12
Developer 12
Rating
(516)
Projects
784
63%
Arbitration
33
27% / 45%
Overdue
23
3%
Free
Published: 1 code
13
Developer 13
Rating
(43)
Projects
66
12%
Arbitration
12
58% / 42%
Overdue
1
2%
Free
14
Developer 14
Rating
(539)
Projects
619
33%
Arbitration
35
37% / 49%
Overdue
11
2%
Busy
15
Developer 15
Rating
(12)
Projects
25
4%
Arbitration
1
0% / 0%
Overdue
7
28%
Free
16
Developer 16
Rating
(449)
Projects
475
69%
Arbitration
6
67% / 0%
Overdue
2
0%
Working
17
Developer 17
Rating
(152)
Projects
228
80%
Arbitration
22
27% / 50%
Overdue
11
5%
Free
Published: 24 articles, 1882 codes
18
Developer 18
Rating
(45)
Projects
76
20%
Arbitration
7
0% / 86%
Overdue
14
18%
Free
19
Developer 19
Rating
(2)
Projects
2
0%
Arbitration
1
0% / 0%
Overdue
2
100%
Free
20
Developer 20
Rating
(45)
Projects
46
24%
Arbitration
34
9% / 85%
Overdue
10
22%
Free
21
Developer 21
Rating
(3)
Projects
2
50%
Arbitration
2
0% / 100%
Overdue
0
Free
22
Developer 22
Rating
(15)
Projects
20
35%
Arbitration
3
0% / 100%
Overdue
0
Free
Published: 1 code
23
Developer 23
Rating
(257)
Projects
341
58%
Arbitration
7
14% / 71%
Overdue
9
3%
Free
24
Developer 24
Rating
(3)
Projects
1
0%
Arbitration
5
0% / 100%
Overdue
0
Free
25
Developer 25
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
Similar orders
I would like to create an MQL5 Expert Advisor based on my own custom indicators . I already own the full MQL5 source codes of all indicators . The EA skeleton / core structure must be exactly the same as shown in the attached image . All strategies and all indicators must be integrated under that predefined structure . I am looking for a highly experienced MQL5 developer , with full availability , capable of working
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
I have an expert advisor (MQL5) that works professionally on all timeframes. This is a test on a 5-minute timeframe, from $10,000 to $614,195.70, from the beginning of 2025 to the beginning of 2026 on the Dow Jones
1441 30+ USD
444fwefwefw jlklklklklklklklklkeaNRFNEWM EWQJEWQIOREJEWQKLFDNMKLFD.MDW/LFDK.MEWFDLK;EMFWEKLMFWELKFREWNMFNDM,VSDV/S.DAFLMWEO;RWEJRPWOEJWE09PUJR9O EJ WKEWMK F FMKDSMKF SDEWJWJ [Q\ /QLDKNQNDQPIUHQD.Q,DMASDOAIFDA,M DFA AAS,KFDJNLOFD NOIFDJNFDAS NKNLOASJOFIKJD ASOIJFISFNKSNF SFSNOIWWQJ-0I[PKEM DAI-0IK-0DQMDQ NDACAI-0 I- EKQ;LDN0912KDMMOIKM Cdjoiasd f09wilf d qkdfokawsd-09fdkdadsomfasdlkkf-0 q[pkkd-0]q2kda\fld
Signal Logic - Swing points detected correctly (Fractals or N-bar) - BOS triggers only on bar close beyond swing level (+ optional min break distance) - FVG zones detected correctly (3-candle gap) and stored with clear boundaries - FVG invalidation works as configured (full fill / partial fill / timeout) Entry & Execution - Entry only after BOS (if enabled) and on return to active FVG zone - Bar-close confirmation
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

Project information

Budget
30+ USD