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
(263)
Projetos
329
29%
Arbitragem
36
25% / 64%
Expirado
10
3%
Trabalhando
2
Desenvolvedor 2
Classificação
(139)
Projetos
181
24%
Arbitragem
23
22% / 39%
Expirado
13
7%
Livre
3
Desenvolvedor 3
Classificação
(328)
Projetos
513
19%
Arbitragem
35
43% / 31%
Expirado
34
7%
Carregado
4
Desenvolvedor 4
Classificação
(44)
Projetos
60
5%
Arbitragem
6
0% / 67%
Expirado
5
8%
Livre
5
Desenvolvedor 5
Classificação
(195)
Projetos
242
34%
Arbitragem
11
45% / 45%
Expirado
8
3%
Livre
Publicou: 1 artigo, 8 códigos
6
Desenvolvedor 6
Classificação
(258)
Projetos
266
29%
Arbitragem
0
Expirado
3
1%
Trabalhando
Publicou: 2 códigos
7
Desenvolvedor 7
Classificação
(274)
Projetos
403
28%
Arbitragem
40
40% / 50%
Expirado
1
0%
Livre
8
Desenvolvedor 8
Classificação
(160)
Projetos
203
60%
Arbitragem
10
80% / 0%
Expirado
0
Livre
Publicou: 1 código
9
Desenvolvedor 9
Classificação
(85)
Projetos
174
44%
Arbitragem
3
100% / 0%
Expirado
5
3%
Livre
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
(548)
Projetos
833
62%
Arbitragem
33
27% / 45%
Expirado
24
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
(610)
Projetos
708
33%
Arbitragem
45
44% / 42%
Expirado
14
2%
Carregado
15
Desenvolvedor 15
Classificação
(12)
Projetos
25
4%
Arbitragem
1
0% / 0%
Expirado
7
28%
Livre
16
Desenvolvedor 16
Classificação
(459)
Projetos
486
70%
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
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
*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
QUIERO CONSEGUIR EL CODIGO FUENTE DE ESTE INDICADOR QUE ME GUSTA MUCHO TAMBIEN TIENE EL NOMBRE DE ET BANDS O ENTRY EXIT TIMING . no se los componentes pero estas son las imagenes. que mejor lo describen
Poptavka ZN 35 - 40 USD
Požadavky: platforma MetaTrader 5, jazyk MQL5; předání úplného a čitelného zdrojového kódu .mq5 a všech potřebných .mqh souborů; zákazů knihoven, DLL, vzdálených serverů a externí licenční kontroly; zákaz martingale, gridu, navyšování pozice po ztrátě a obchodování bez stop-lossu; výpočet velikosti pozice podle procenta rizika a skutečné měny účtu; nastavitelné maximální denní riziko a celkové čerpání; ochrana proti
I am looking to convert my existing TradingView Pine Script (v5) strategy into an MQL5 Expert Advisor (EA) for MetaTrader 5. Strategy Details: Asset: Gold (XAUUSD) Timeframe: 15-minute Strategy Logic: The strategy is based on a breakout concept. Anchor Candle: The base calculation starts from the Specified Candle Entry Window: The EA should only look for entries As Per Indicator Risk Management: The strategy
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
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)
MultiPair_PriceAction 30 - 200 USD
OANDA market watch clock and symbols (.sim) Multipair able so i can choose at least 6 of those more volatile forex pairs. Price Action setups instead of relay on lag indicators. But rsi for confirmation. Spread protection, position management, magic number editor, hours trading. Volatility protection Trailing Stop, Stop losses, take profit. Percentage and ATR scale instead of dollars or lot sizes. Funds management

Informações sobre o projeto

Orçamento
30+ USD