Tarea técnica

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

                }

            }

        }

    }

}


Han respondido

1
Desarrollador 1
Evaluación
(263)
Proyectos
329
29%
Arbitraje
36
25% / 64%
Caducado
10
3%
Trabaja
2
Desarrollador 2
Evaluación
(139)
Proyectos
181
24%
Arbitraje
23
22% / 39%
Caducado
13
7%
Libre
3
Desarrollador 3
Evaluación
(328)
Proyectos
513
19%
Arbitraje
35
43% / 31%
Caducado
34
7%
Trabajando
4
Desarrollador 4
Evaluación
(44)
Proyectos
60
5%
Arbitraje
6
0% / 67%
Caducado
5
8%
Libre
5
Desarrollador 5
Evaluación
(195)
Proyectos
242
34%
Arbitraje
11
45% / 45%
Caducado
8
3%
Libre
Ha publicado: 1 artículo, 8 ejemplos
6
Desarrollador 6
Evaluación
(258)
Proyectos
266
29%
Arbitraje
0
Caducado
3
1%
Trabaja
Ha publicado: 2 ejemplos
7
Desarrollador 7
Evaluación
(274)
Proyectos
403
28%
Arbitraje
40
40% / 50%
Caducado
1
0%
Libre
8
Desarrollador 8
Evaluación
(160)
Proyectos
203
60%
Arbitraje
10
80% / 0%
Caducado
0
Libre
Ha publicado: 1 ejemplo
9
Desarrollador 9
Evaluación
(85)
Proyectos
174
44%
Arbitraje
3
100% / 0%
Caducado
5
3%
Libre
Ha publicado: 1 ejemplo
10
Desarrollador 10
Evaluación
(37)
Proyectos
59
27%
Arbitraje
26
19% / 54%
Caducado
10
17%
Trabaja
Ha publicado: 1 ejemplo
11
Desarrollador 11
Evaluación
(1156)
Proyectos
1462
63%
Arbitraje
21
57% / 10%
Caducado
43
3%
Libre
12
Desarrollador 12
Evaluación
(548)
Proyectos
833
62%
Arbitraje
33
27% / 45%
Caducado
24
3%
Libre
Ha publicado: 1 ejemplo
13
Desarrollador 13
Evaluación
(43)
Proyectos
66
12%
Arbitraje
12
58% / 42%
Caducado
1
2%
Libre
14
Desarrollador 14
Evaluación
(610)
Proyectos
708
33%
Arbitraje
45
44% / 42%
Caducado
14
2%
Trabajando
15
Desarrollador 15
Evaluación
(12)
Proyectos
25
4%
Arbitraje
1
0% / 0%
Caducado
7
28%
Libre
16
Desarrollador 16
Evaluación
(459)
Proyectos
486
70%
Arbitraje
6
67% / 0%
Caducado
2
0%
Trabaja
17
Desarrollador 17
Evaluación
(152)
Proyectos
228
80%
Arbitraje
22
27% / 50%
Caducado
11
5%
Libre
Ha publicado: 24 artículos, 1882 ejemplos
18
Desarrollador 18
Evaluación
(45)
Proyectos
76
20%
Arbitraje
7
0% / 86%
Caducado
14
18%
Libre
19
Desarrollador 19
Evaluación
(2)
Proyectos
2
0%
Arbitraje
1
0% / 0%
Caducado
2
100%
Libre
20
Desarrollador 20
Evaluación
(45)
Proyectos
46
24%
Arbitraje
34
9% / 85%
Caducado
10
22%
Libre
21
Desarrollador 21
Evaluación
(3)
Proyectos
2
50%
Arbitraje
2
0% / 100%
Caducado
0
Libre
22
Desarrollador 22
Evaluación
(15)
Proyectos
20
35%
Arbitraje
3
0% / 100%
Caducado
0
Libre
Ha publicado: 1 ejemplo
23
Desarrollador 23
Evaluación
(257)
Proyectos
341
58%
Arbitraje
7
14% / 71%
Caducado
9
3%
Libre
24
Desarrollador 24
Evaluación
(3)
Proyectos
1
0%
Arbitraje
5
0% / 100%
Caducado
0
Libre
25
Desarrollador 25
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Solicitudes similares
A robot 50+ USD
HIGH-FREQUENCY M5/M15 CONCURRENT ENTRY SNIPER import time class HighFrequencySniper: def __init__(self): self.target_profit = 25.00 # Targeted Delta Move self.max_execution_time = 3600 # 1 Hour Sandbox (Seconds) self.lot_allocation = "CALIBRATED_TO_RISK" def execute_hft_scan(self, current_price, m5_rsi, m15_order_block): print(f"[SCANNING] Current Kernel Metric: ${current_price:.2f
# HIGH-FREQUENCY M5/M15 CONCURRENT ENTRY SNIPER import time class HighFrequencySniper: def __init__(self): self.target_profit = 25.00 # Targeted Delta Move self.max_execution_time = 3600 # 1 Hour Sandbox (Seconds) self.lot_allocation = "CALIBRATED_TO_RISK" def execute_hft_scan(self, current_price, m5_rsi, m15_order_block): print(f"[SCANNING] Current Kernel Metric: ${current_price:.2f}")
I need a trading bot, please i need this project urgently and when messaing me kindly send me samples of past works and dont forget i need the project to be done as soon as possible
If you have good Market structure indicators with buffer no repaint internal structure and external structure etc good market structure if you have then i already have ea you have to input into the indicator soy current ea opens position based on the market structure
*Need an MQL5 EA for MT5 to trade gold and forex automatically. Must include Stop Loss, Take Profit, and basic risk management. Budget is $30 to $50. Looking for clean, stable code that works on VPS.*
Hello Developers, I am looking for an experienced MQL5 developer to complete the development of a custom MetaTrader 5 Expert Advisor (EA) based on my proprietary trading strategy. I already have a partially developed EA that includes the required custom indicators and part of the trading logic. The project can either be completed by modifying the existing EA or, if more appropriate, by rebuilding it from scratch
Description: I need an experienced MQL5 developer to build a professional MT5 Expert Advisor for XAU/USD based on my trading strategy. I require the full .mq5 source code and the compiled file. Trading Logic: Timeframes: H4 to determine overall direction, H1 for supply and demand zones, M15 for trade entries. Buy conditions: H4 trend is bullish, price reaches a valid H1 demand zone, liquidity sweep occurs below the
WORKING EA 35+ USD
I Need an existing proven profitable EA. EA should have at least 3 months track record of consistency. My budget is $35 and nothing more. If you do not have the working EA for that amount, please do not apply. I'm not paying a dime more. Again do not apply if you are not willing to take the above amount
Standby Description . Prop Firm Environment . ( Monitor Execution and Handling Environment Changes as Required ) . Technical Issues . Delete extra lines of code (Clean Code , Folder) . Asset related translation , no need for Logic Alteration
Only Technical Issues . Familiarization to Different Symbols . [Again Technical Assistance Only] . Deleting extra lines of code , Not Required Folders (Clean Code) . No Need for Logic Alteration (Strictly)

Información sobre el proyecto

Presupuesto
30+ USD