FIX ERRORS ON MY CODE

指定

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

                }

            }

        }

    }

}


反馈

1
开发者 1
等级
(237)
项目
298
28%
仲裁
33
24% / 61%
逾期
9
3%
工作中
2
开发者 2
等级
(139)
项目
181
24%
仲裁
23
22% / 39%
逾期
13
7%
空闲
3
开发者 3
等级
(321)
项目
497
19%
仲裁
33
42% / 30%
逾期
32
6%
繁忙
4
开发者 4
等级
(43)
项目
56
4%
仲裁
7
0% / 57%
逾期
4
7%
工作中
5
开发者 5
等级
(194)
项目
241
34%
仲裁
10
50% / 50%
逾期
8
3%
工作中
发布者: 1 文章, 8 代码
6
开发者 6
等级
(246)
项目
253
30%
仲裁
0
逾期
3
1%
空闲
发布者: 2 代码
7
开发者 7
等级
(268)
项目
396
27%
仲裁
38
39% / 50%
逾期
1
0%
空闲
8
开发者 8
等级
(151)
项目
188
57%
仲裁
10
80% / 0%
逾期
0
空闲
发布者: 1 代码
9
开发者 9
等级
(84)
项目
162
43%
仲裁
3
67% / 0%
逾期
5
3%
工作中
发布者: 1 代码
10
开发者 10
等级
(37)
项目
59
27%
仲裁
26
19% / 54%
逾期
10
17%
工作中
发布者: 1 代码
11
开发者 11
等级
(1156)
项目
1462
63%
仲裁
21
57% / 10%
逾期
43
3%
空闲
12
开发者 12
等级
(516)
项目
784
63%
仲裁
33
27% / 45%
逾期
23
3%
空闲
发布者: 1 代码
13
开发者 13
等级
(43)
项目
66
12%
仲裁
12
58% / 42%
逾期
1
2%
空闲
14
开发者 14
等级
(539)
项目
619
33%
仲裁
35
37% / 49%
逾期
11
2%
繁忙
15
开发者 15
等级
(12)
项目
25
4%
仲裁
1
0% / 0%
逾期
7
28%
空闲
16
开发者 16
等级
(449)
项目
475
69%
仲裁
6
67% / 0%
逾期
2
0%
工作中
17
开发者 17
等级
(152)
项目
228
80%
仲裁
22
27% / 50%
逾期
11
5%
空闲
发布者: 24 文章, 1882 代码
18
开发者 18
等级
(45)
项目
76
20%
仲裁
7
0% / 86%
逾期
14
18%
空闲
19
开发者 19
等级
(2)
项目
2
0%
仲裁
1
0% / 0%
逾期
2
100%
空闲
20
开发者 20
等级
(45)
项目
46
24%
仲裁
34
9% / 85%
逾期
10
22%
空闲
21
开发者 21
等级
(3)
项目
2
50%
仲裁
2
0% / 100%
逾期
0
空闲
22
开发者 22
等级
(15)
项目
20
35%
仲裁
3
0% / 100%
逾期
0
空闲
发布者: 1 代码
23
开发者 23
等级
(257)
项目
341
58%
仲裁
7
14% / 71%
逾期
9
3%
空闲
24
开发者 24
等级
(3)
项目
1
0%
仲裁
5
0% / 100%
逾期
0
空闲
25
开发者 25
等级
项目
0
0%
仲裁
0
逾期
0
空闲
相似订单
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
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
Looking for an experienced MQL4/MQL5 developer. Task: EX4 → MQ4 recovery Modify EA logic Convert MQ4 → MQ5 (fully working) Must understand MT4 vs MT5 differences and deliver clean, tested code. This is a paid job, with possible follow-up work if things go well. DM me with your experience and examples of similar work
This EA uses the inbuilt indicators to execute trades. It follows the simple rules of buy signal and sell signal.It will be independent of each other. The same rule follows for each
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
Project Overview I am looking for an experienced MT5 (MQL5) developer to modify an existing Account Protection EA and, if required, extend it with custom logic. This is NOT a strategy or trading EA . The EA is purely for risk management, drawdown protection, alerts, and trading lock , suitable for prop-firm and managed accounts . Core Requirements 1. Alerts & Monitoring Alert on trade entry and trade exit Alert when
I’m looking for an experienced MQL5 developer to build TWO MT5 custom indicators that detect multi-condition M30 trade setups and send Telegram alerts before trade execution . This project requires strict close-based logic , multi-indicator buffer processing , and non-repainting behavior . HIGH-LEVEL REQUIREMENTS Indicators must evaluate signals from M30 only All conditions are checked only after candle close Logic
1. The idea of the trading system is as follows : market entries are performed when MACD's main and signal lines intersect in the current trend direction . 2. Trend is determined based on the Exponential Moving Average with the specified period (InpMATrendPeriod). If the current EMA value is greater than the previous one, the trend is seen as growing (ema_current > ema_previous). Alternatively, if current EMA is
Tôi muốn EA siêu lợi nhuận, giá cả không thành vấn đề, chỉ cần bạn có thể chứng minh được, và gửi tôi bản demo để tôi kiểm tra bạn hãy chứng minh bản thân mình trước. EA cần backtest 1 năm hoạt động ổn định

项目信息

预算
30+ USD