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%
Loaded
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
7
0% / 57%
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%
Working
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
Martingale EA 50 - 300 USD
i want to develop martingale base ea with some risk managemnet i will provide the trade ac id password need to study the strategy then i need competle flexible risk management that can be changed and set accorddingly when it required. ac number -13145 pass- View@1234 server- ambitious capital
Me encuentro en busca de un desarrollador MT4 para crear un EA totalmente basado en reglas enfocadas en Propfirms (Específicamente en The5ers) para operar el activo EURUSD. Cuento con un documento detallado con reglas de contexto, eventos, ejecución y gestión operativa. Necesito código limpio, sin margintale, sin grid; con control de reducción orientado a abrir y cerrar posiciones durante el horario de la sesión de
I'm looking for an experience developer that can help develop an EA based Strategy below into 1 EA itself no issues if used martingale & fix lot . Symbol : XAUUSD 1m-5m-15m i will explain to the developer more datils before doing the EA. i will send the indicator and the set point. 1- indicator extreme 2- stochastic Oscillator 3- stochastic indicator good luck
Below is the same information written as a continuous, professional text , clear and suitable for a requirements description field. This project consists of adjusting an existing Expert Advisor for MetaTrader 5, written in MQL5. The original EA structure, logic, and trading methodology must be fully preserved, with no rewriting, simplification, or replacement of the strategy. The only required functional change is to
//+------------------------------------------------------------------+ //| MT5 Forex Scalping EA | //| Trend Pullback Scalper | //+------------------------------------------------------------------+ #property strict #include <Trade/Trade.mqh> CTrade trade; // ===== INPUTS ===== input double RiskPercent = 0.5; input int EMAFast = 20; input int EMASlow = 50; input int RSIPeriod
I'm seeking an experienced MQL5 developer to create a robust Expert Advisor (EA) that integrates 4 powerful strategies into a single, cohesive system. The EA will trade XAUUSD exclusively and adhere to strict risk management principles, avoiding grid and martingale techniques. *Strategy Overview* The EA will incorporate the following strategies, each with its own unique approach: 1. *High Timeframe Trend Reversal*
Nestalink.EA 30 - 100000 USD
//+------------------------------------------------------------------+ //| Prop Firm Challenge EA – Fully Automated (MT5) | //+------------------------------------------------------------------+ #property strict #include <Trade/Trade.mqh> CTrade trade; // ================= INPUTS ================= input double RiskPerTradePct = 0.5; // 0.5% risk (prop firm safe) input double MaxDailyLossPct = 2.0; // Daily loss limit
I have developed a cloud-based AI copier that automatically replicates analyzed signals from any linked channel directly to your platform. Streamline your workflow with precision automation and real-time execution. Boost your efficiency and never miss a critical trade or update again. Reach out now to integrate this powerful tool
Here are the ThinkScript codes from ThinkorSwim in a Text (.txt) file- I placed a hashmark (#) by the name of each indicator or system with the code underneath - let me know if you have any questions as you convert these into TradingView - thanks i will be looking for graet developer to build for this project
Automated Trading BOT 50 - 75 USD
🔹 Project: Auto Execution Bot for XAUUSD 🔹 Platform: TradingView + Broker (MT5/Exness) 🔹 Script Language: TradingView Pine Script v5 + webhook/API integration 🔹 Strategy: Price action based entry/exit logic 🔹 Requirements: • Auto execute trades based on price action signals • Stop loss / Take profit logic • Session filters, risk management • Alerts with webhooks to broker bridge • Backtesting + live

Project information

Budget
30+ USD