Termos de Referência

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

                }

            }

        }

    }

}


Respondido

1
Desenvolvedor 1
Classificação
(237)
Projetos
298
28%
Arbitragem
33
24% / 61%
Expirado
9
3%
Trabalhando
2
Desenvolvedor 2
Classificação
(139)
Projetos
181
24%
Arbitragem
23
22% / 39%
Expirado
13
7%
Livre
3
Desenvolvedor 3
Classificação
(321)
Projetos
497
19%
Arbitragem
33
42% / 30%
Expirado
32
6%
Ocupado
4
Desenvolvedor 4
Classificação
(43)
Projetos
56
4%
Arbitragem
7
0% / 57%
Expirado
4
7%
Trabalhando
5
Desenvolvedor 5
Classificação
(194)
Projetos
241
34%
Arbitragem
10
50% / 50%
Expirado
8
3%
Trabalhando
Publicou: 1 artigo, 8 códigos
6
Desenvolvedor 6
Classificação
(246)
Projetos
253
30%
Arbitragem
0
Expirado
3
1%
Livre
Publicou: 2 códigos
7
Desenvolvedor 7
Classificação
(268)
Projetos
396
27%
Arbitragem
38
39% / 50%
Expirado
1
0%
Livre
8
Desenvolvedor 8
Classificação
(151)
Projetos
188
57%
Arbitragem
10
80% / 0%
Expirado
0
Livre
Publicou: 1 código
9
Desenvolvedor 9
Classificação
(84)
Projetos
162
43%
Arbitragem
3
67% / 0%
Expirado
5
3%
Trabalhando
Publicou: 1 código
10
Desenvolvedor 10
Classificação
(37)
Projetos
59
27%
Arbitragem
26
19% / 54%
Expirado
10
17%
Trabalhando
Publicou: 1 código
11
Desenvolvedor 11
Classificação
(1156)
Projetos
1462
63%
Arbitragem
21
57% / 10%
Expirado
43
3%
Livre
12
Desenvolvedor 12
Classificação
(516)
Projetos
784
63%
Arbitragem
33
27% / 45%
Expirado
23
3%
Livre
Publicou: 1 código
13
Desenvolvedor 13
Classificação
(43)
Projetos
66
12%
Arbitragem
12
58% / 42%
Expirado
1
2%
Livre
14
Desenvolvedor 14
Classificação
(539)
Projetos
619
33%
Arbitragem
35
37% / 49%
Expirado
11
2%
Ocupado
15
Desenvolvedor 15
Classificação
(12)
Projetos
25
4%
Arbitragem
1
0% / 0%
Expirado
7
28%
Livre
16
Desenvolvedor 16
Classificação
(449)
Projetos
475
69%
Arbitragem
6
67% / 0%
Expirado
2
0%
Trabalhando
17
Desenvolvedor 17
Classificação
(152)
Projetos
228
80%
Arbitragem
22
27% / 50%
Expirado
11
5%
Livre
Publicou: 24 artigos, 1882 códigos
18
Desenvolvedor 18
Classificação
(45)
Projetos
76
20%
Arbitragem
7
0% / 86%
Expirado
14
18%
Livre
19
Desenvolvedor 19
Classificação
(2)
Projetos
2
0%
Arbitragem
1
0% / 0%
Expirado
2
100%
Livre
20
Desenvolvedor 20
Classificação
(45)
Projetos
46
24%
Arbitragem
34
9% / 85%
Expirado
10
22%
Livre
21
Desenvolvedor 21
Classificação
(3)
Projetos
2
50%
Arbitragem
2
0% / 100%
Expirado
0
Livre
22
Desenvolvedor 22
Classificação
(15)
Projetos
20
35%
Arbitragem
3
0% / 100%
Expirado
0
Livre
Publicou: 1 código
23
Desenvolvedor 23
Classificação
(257)
Projetos
341
58%
Arbitragem
7
14% / 71%
Expirado
9
3%
Livre
24
Desenvolvedor 24
Classificação
(3)
Projetos
1
0%
Arbitragem
5
0% / 100%
Expirado
0
Livre
25
Desenvolvedor 25
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
Pedidos semelhantes
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
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

Informações sobre o projeto

Orçamento
30+ USD