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
(249)
Progetti
312
28%
Arbitraggio
33
27% / 64%
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
(325)
Progetti
505
19%
Arbitraggio
32
44% / 31%
In ritardo
34
7%
Caricato
4
Sviluppatore 4
Valutazioni
(44)
Progetti
58
3%
Arbitraggio
7
0% / 57%
In ritardo
5
9%
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
(252)
Progetti
258
30%
Arbitraggio
0
In ritardo
3
1%
Gratuito
Pubblicati: 2 codici
7
Sviluppatore 7
Valutazioni
(271)
Progetti
400
27%
Arbitraggio
39
41% / 49%
In ritardo
1
0%
Gratuito
8
Sviluppatore 8
Valutazioni
(154)
Progetti
192
58%
Arbitraggio
10
80% / 0%
In ritardo
0
In elaborazione
Pubblicati: 1 codice
9
Sviluppatore 9
Valutazioni
(85)
Progetti
168
44%
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
(527)
Progetti
799
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
(548)
Progetti
632
33%
Arbitraggio
39
38% / 49%
In ritardo
11
2%
Caricato
15
Sviluppatore 15
Valutazioni
(12)
Progetti
25
4%
Arbitraggio
1
0% / 0%
In ritardo
7
28%
Gratuito
16
Sviluppatore 16
Valutazioni
(449)
Progetti
477
69%
Arbitraggio
6
67% / 0%
In ritardo
2
0%
Gratuito
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
Phahla fx boto 30+ USD
99.99% signal accuracy 10-15 trades distribution all currency trade and meta AI assistance on loss[advice] stop and start robot cyber security firewall protection activation code: 20060605TLP20 Please create a trading bot with any logo with the name elevation
Refine signal trigger execution . Optimize live chart performance . Ensure stable and clean code structure : Stable and clean code is important . Otherwise its a mess . Apply with as much accurate structure you foresee
I am looking to purchase a fully developed and proven Expert Advisor (EA) for XAUUSD. This must be an existing EA with a minimum of 12 months verified live trading history on a real account. I am not interested in new development or demo-only systems. Requirements: • Verified live track record (Myfxbook, MQL5 signal, or broker statement) • Consistent profitability with controlled drawdown • Designed for XAUUSD •
RED DEVIL AI 30+ USD
50 EMA > 200 EMA → Uptrend confirmed Price pulls back to touch or cross below 50 EMA RSI > 50 ATR(14) > 20-period ATR average (volatility expanding) Current candle closes bullish ➡ Enter BUY at candle close50 EMA < 200 EMA → Downtrend Price pulls back to touch or cross above 50 EMA RSI < 50 ATR filter confirms volatility Current candle closes bearish ➡ Enter SELL at candle closeATR(14) Take Profit: 2.5 × ATR(14) This
This post is subject to developers response . Edit the post as you like . May be with me you can make a come back . So , , , Shift calculations . More to the calculation then you can comprehend is known . What else comes to your mind
This first robot I'm needing to order a robot that will help me with my trading and make it most efficient Help me with my margins my signals or anything I need to do associated to my trading or classroom
Here is an example of Requirements Specification for the development of the MACD Sample Expert Advisor, which is available in the MetaTrader 5 standard package. 1. The idea of the trading system is as follows: market entries are performed when MACD's main and signal lines intersect in the current trend direction. 2. Trend is determined based on the Exponential Moving Average with the specified period
I’m looking for a trading bot where I can use a balance of £1000 to make regular entries making £20-£40 per entry. obviously, I want to have minimum loss with a lot more profit being made
I’m hiring an experienced MQL5 developer to finish and fix an existing project (NOT building from scratch). I have: An existing MT5 EA (.mq5 + .ex5) that is based on my TradingView logic A TradingView indicator version used for signals/alerts The EA works but has logic/consistency issues and needs improvements + cleanup Goal Make the EA reliable and consistent: Ensure entries/exits match the intended logic Fix
I have a High-Frequency Trading EA and I need a full conversion and optimization for MT5. The goal is to ensure stable execution and reliable performance on real accounts (IC Markets Raw and similar ECN brokers). I need an experienced and reputable MQL5 developer to: Convert the existing strategy to MT5 with full fidelity to the original trading logic (entries, SL, breakeven, trailing, pending orders). Optimize the

Informazioni sul progetto

Budget
30+ USD