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
(258)
Progetti
322
30%
Arbitraggio
34
26% / 65%
In ritardo
10
3%
In elaborazione
2
Sviluppatore 2
Valutazioni
(139)
Progetti
181
24%
Arbitraggio
23
22% / 39%
In ritardo
13
7%
Gratuito
3
Sviluppatore 3
Valutazioni
(328)
Progetti
513
19%
Arbitraggio
34
44% / 32%
In ritardo
34
7%
Caricato
4
Sviluppatore 4
Valutazioni
(44)
Progetti
58
3%
Arbitraggio
6
0% / 67%
In ritardo
5
9%
Gratuito
5
Sviluppatore 5
Valutazioni
(195)
Progetti
242
34%
Arbitraggio
11
45% / 45%
In ritardo
8
3%
Gratuito
Pubblicati: 1 articolo, 8 codici
6
Sviluppatore 6
Valutazioni
(258)
Progetti
265
29%
Arbitraggio
0
In ritardo
3
1%
Gratuito
Pubblicati: 2 codici
7
Sviluppatore 7
Valutazioni
(274)
Progetti
403
28%
Arbitraggio
40
40% / 50%
In ritardo
1
0%
Gratuito
8
Sviluppatore 8
Valutazioni
(156)
Progetti
198
59%
Arbitraggio
10
80% / 0%
In ritardo
0
In elaborazione
Pubblicati: 1 codice
9
Sviluppatore 9
Valutazioni
(85)
Progetti
174
44%
Arbitraggio
3
100% / 0%
In ritardo
5
3%
Gratuito
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
(543)
Progetti
824
62%
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
(580)
Progetti
671
32%
Arbitraggio
42
45% / 45%
In ritardo
12
2%
Caricato
15
Sviluppatore 15
Valutazioni
(12)
Progetti
25
4%
Arbitraggio
1
0% / 0%
In ritardo
7
28%
Gratuito
16
Sviluppatore 16
Valutazioni
(453)
Progetti
479
70%
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
ART 1: NUMBER OF TRADES ALLOWED IN ONE DIRECTION: Maximum number of trades in one direction = ------------------------------ ------------------------------ ------------------------------ -------------- par PART 2 PARTIAL CLOSURE OF STOPLOSS: Total STOPLOSS =------ Pips 1a: Percentage of Stoploss =--% 1b Percentage of Lot size =--% 2a: Percentage oe of Lot size =--% f Stoploss =--% 2b
“} Final Trading Logic Requirements 1. Confirmation Timeframe The main confirmation timeframe must be M15. The indicator may show a Pending Setup during the active 15-minute candle, but the setup is not valid for entry yet. A valid trading signal must be confirmed only after the M15 candle closes. If the setup appears during the candle but disappears in the final seconds before candle close, no confirmed signal
MT5 Expert Advisor (EA) Acquisition Request – Proven XAUUSD Martingale / Grid EA I am looking to purchase a fully developed, actively traded, and proven MT5 Expert Advisor for XAUUSD (Gold) that uses Martingale, Grid, Averaging, Recovery, or Hybrid Recovery techniques. Mandatory Verification Requirement To be considered, please provide: - MT5 Investor Password (Read-Only Access) for verification - Account Number /
Looking to buy profitable MT4/MT5 Expert Advisors (EAs). Requirements: • Fully automated • 6+ months backtest • 100+ trades • No martingale or grid systems Send: • Backtest report • Max drawdown • Markets traded • Brief strategy summary Only original EAs developed by you. Long-term collaboration available
I am looking for an experienced MQL5 developer to create a custom indicator for MetaTrader 5. The project requirements and indicator logic will be shared privately with the selected candidate to protect the concept and implementation details. Requirements: Strong experience with MQL5 indicator development. Ability to create clean, efficient, and well-structured code. Experience with custom buffers, chart objects
Live chart [ expert is not executing trades on xauusd ] , Deleting Existing Parameter not in use , Live Chart Adjustments Only , No Need to Change anything else , expert will be live testing Throughout
Prepare expert for xauusd live chart [ expert is not executing trades on xauusd ] . Deletion and cleaning code . Trailing Stop Rule to follow the given method . Live Chart Only
SNIPER X AI 30 - 120 USD
I need help in building a Robot SNIPER X AI — FINAL BUILD Trading System Type AI Scalping + Sniper Entry Expert Advisor Platforms MetaTrader 4 MetaTrader 5 Supported Brokers � exness.com � justmarkets.com � deriv.com Universal MT4/MT5 broker support FINAL CORE FEATURES ✅ AI Scalping Engine ✅ Sniper Entries ✅ Auto Buy/Sell ✅ EMA Trend Detection ✅ RSI Momentum Filter ✅ Smart Stop Loss ✅ Dynamic Take Profit ✅ Trailing
//+------------------------------------------------------------------+ //| $10 Smart Scalping Bot for MT5 | //| EURGBP + AUDUSD + XAGUSD Optimized | //+------------------------------------------------------------------+ #property strict #include <Trade/Trade.mqh> CTrade trade; //========================= INPUTS ================================== input double LotSize = 0.01; input int FastEMA = 20; input int SlowEMA =
Am looking for Professional programmer who can build below analysis bot as specified below. The indicators will be provided. 🔷 1. CORE ARCHITECTURE OF YOUR EA Your EA has 3 modes: ✅ Mode 1: Indicator 1 Strategy (9-Signal Engine) ✅ Mode 2: Indicator 2 Strategy (Multi-indicator confluence) ✅ Mode 3: Hybrid Mode (Indicator 1 filters Indicator 2) 🔷 2. PAIR SELECTION LOGIC EA will NOT auto-scan market (based on your

Informazioni sul progetto

Budget
30+ USD