Specifiche

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

                }

            }

        }

    }

}


Con risposta

1
Sviluppatore 1
Valutazioni
(237)
Progetti
298
28%
Arbitraggio
33
24% / 61%
In ritardo
9
3%
In elaborazione
2
Sviluppatore 2
Valutazioni
(139)
Progetti
181
24%
Arbitraggio
23
22% / 39%
In ritardo
13
7%
Gratuito
3
Sviluppatore 3
Valutazioni
(321)
Progetti
497
19%
Arbitraggio
33
42% / 30%
In ritardo
32
6%
Occupato
4
Sviluppatore 4
Valutazioni
(43)
Progetti
56
4%
Arbitraggio
7
0% / 57%
In ritardo
4
7%
In elaborazione
5
Sviluppatore 5
Valutazioni
(194)
Progetti
241
34%
Arbitraggio
10
50% / 50%
In ritardo
8
3%
In elaborazione
Pubblicati: 1 articolo, 8 codici
6
Sviluppatore 6
Valutazioni
(246)
Progetti
253
30%
Arbitraggio
0
In ritardo
3
1%
Gratuito
Pubblicati: 2 codici
7
Sviluppatore 7
Valutazioni
(268)
Progetti
396
27%
Arbitraggio
38
39% / 50%
In ritardo
1
0%
Gratuito
8
Sviluppatore 8
Valutazioni
(151)
Progetti
188
57%
Arbitraggio
10
80% / 0%
In ritardo
0
Gratuito
Pubblicati: 1 codice
9
Sviluppatore 9
Valutazioni
(84)
Progetti
162
43%
Arbitraggio
3
67% / 0%
In ritardo
5
3%
In elaborazione
Pubblicati: 1 codice
10
Sviluppatore 10
Valutazioni
(37)
Progetti
59
27%
Arbitraggio
26
19% / 54%
In ritardo
10
17%
In elaborazione
Pubblicati: 1 codice
11
Sviluppatore 11
Valutazioni
(1156)
Progetti
1462
63%
Arbitraggio
21
57% / 10%
In ritardo
43
3%
Gratuito
12
Sviluppatore 12
Valutazioni
(516)
Progetti
784
63%
Arbitraggio
33
27% / 45%
In ritardo
23
3%
Gratuito
Pubblicati: 1 codice
13
Sviluppatore 13
Valutazioni
(43)
Progetti
66
12%
Arbitraggio
12
58% / 42%
In ritardo
1
2%
Gratuito
14
Sviluppatore 14
Valutazioni
(539)
Progetti
619
33%
Arbitraggio
35
37% / 49%
In ritardo
11
2%
Occupato
15
Sviluppatore 15
Valutazioni
(12)
Progetti
25
4%
Arbitraggio
1
0% / 0%
In ritardo
7
28%
Gratuito
16
Sviluppatore 16
Valutazioni
(449)
Progetti
475
69%
Arbitraggio
6
67% / 0%
In ritardo
2
0%
In elaborazione
17
Sviluppatore 17
Valutazioni
(152)
Progetti
228
80%
Arbitraggio
22
27% / 50%
In ritardo
11
5%
Gratuito
Pubblicati: 24 articoli, 1882 codici
18
Sviluppatore 18
Valutazioni
(45)
Progetti
76
20%
Arbitraggio
7
0% / 86%
In ritardo
14
18%
Gratuito
19
Sviluppatore 19
Valutazioni
(2)
Progetti
2
0%
Arbitraggio
1
0% / 0%
In ritardo
2
100%
Gratuito
20
Sviluppatore 20
Valutazioni
(45)
Progetti
46
24%
Arbitraggio
34
9% / 85%
In ritardo
10
22%
Gratuito
21
Sviluppatore 21
Valutazioni
(3)
Progetti
2
50%
Arbitraggio
2
0% / 100%
In ritardo
0
Gratuito
22
Sviluppatore 22
Valutazioni
(15)
Progetti
20
35%
Arbitraggio
3
0% / 100%
In ritardo
0
Gratuito
Pubblicati: 1 codice
23
Sviluppatore 23
Valutazioni
(257)
Progetti
341
58%
Arbitraggio
7
14% / 71%
In ritardo
9
3%
Gratuito
24
Sviluppatore 24
Valutazioni
(3)
Progetti
1
0%
Arbitraggio
5
0% / 100%
In ritardo
0
Gratuito
25
Sviluppatore 25
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
Ordini simili
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

Informazioni sul progetto

Budget
30+ USD