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
(253)
Progetti
316
29%
Arbitraggio
34
26% / 65%
In ritardo
10
3%
Gratuito
2
Sviluppatore 2
Valutazioni
(139)
Progetti
181
24%
Arbitraggio
23
22% / 39%
In ritardo
13
7%
Gratuito
3
Sviluppatore 3
Valutazioni
(328)
Progetti
511
19%
Arbitraggio
33
45% / 30%
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
(194)
Progetti
241
34%
Arbitraggio
11
45% / 45%
In ritardo
8
3%
In elaborazione
Pubblicati: 1 articolo, 8 codici
6
Sviluppatore 6
Valutazioni
(256)
Progetti
263
30%
Arbitraggio
0
In ritardo
3
1%
Gratuito
Pubblicati: 2 codici
7
Sviluppatore 7
Valutazioni
(273)
Progetti
402
27%
Arbitraggio
40
40% / 50%
In ritardo
1
0%
Gratuito
8
Sviluppatore 8
Valutazioni
(156)
Progetti
197
59%
Arbitraggio
10
80% / 0%
In ritardo
0
Gratuito
Pubblicati: 1 codice
9
Sviluppatore 9
Valutazioni
(85)
Progetti
169
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
(541)
Progetti
818
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
(566)
Progetti
655
33%
Arbitraggio
41
41% / 46%
In ritardo
11
2%
Occupato
15
Sviluppatore 15
Valutazioni
(12)
Progetti
25
4%
Arbitraggio
1
0% / 0%
In ritardo
7
28%
Gratuito
16
Sviluppatore 16
Valutazioni
(450)
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
I am looking for a highly skilled and professional developer to create a custom Buy/Sell indicator for MT5. The indicator must be fully non-repainting on the chart and must include separate Buy and Sell buffers for possible future EA integration. What I need is not a noisy indicator that produces frequent random signals. I want the exact opposite: the indicator should be highly selective, with few but strong signals
I am currently manual testing an additional indicator but, I have a few(3) paid(licensed) indicators that I use to trade with. I use one as a primary signal and the other 2 as confluence for entries. I want to backtest them together in order to have an auto/semi-auto data backed system. Would you be able to assist with this? Im am planning on fully engaging this project in 1-2 weeks from now. My indicators are on
OFFICIAL MQL5 SOFTWARE REQUIREMENTS SPECIFICATION (SRS) Project Name: "Quantum-Shield 2.0" Institutional EA Platform: MetaTrader 5 (MT5) Execution Logic: Fully Automated Instrument: GER40 (DAX) Timeframe: 10 Minutes 1. ARCHITECTURAL MANDATE The Expert Advisor must be a monolithic, high-performance C++ based MQL5 application. No DLLs, no external python bridges. The logic must be entirely self-contained. 2. SIGNAL
Hi All, I am looking for an EA which I have attached the video of. It places a buy stop and sell stop with 250 pips above and below current price for every minute with SL as 300 pips and TP as 500 pips. If any of of them triggers in the minute other will be cancelled, it will not place any pending orders till either of SL or TP is hit and places new set of pending orders the very next minute of SL or TP hit minute
Okay so basically this is a repair job of a strategy I hired a guy to do that doesn't quite workas I intended it to but is very close. So should be fairly simple to fix . I have enclosed a video file. Its important to understand that the take profit and stop loss were added by the guy who coded it but arent central to the strategy. The main thing is that the system must reference the prior bar and sell when the ow is
Specification I need a mt5 Expert advisor EA to manage intraday trades with strict risk management. The EA must -Handle between 5 to 8 clean trades a day max altogether throughout all 3 sessions. no big news trading times and no overnight trades -Use 1 % on forex pairs and up to 2% on XAUUSD risk per trade - Automatically calculate lot size based on stop loss -use fixed RR ratio [1:2] For forex pairs
Buy and sell indicator 30 - 200 USD
} Hello, I am looking for a highly skilled and professional developer to create a powerful custom trading indicator for MetaTrader. The indicator must display Buy and Sell signals directly on the chart in a clean and professional way (for example, dots or arrows). The signals must be non-repainting, meaning once a signal appears it must never change or disappear after the candle closes. I want the indicator to be
I trade ES futures on the Ninja trader platform. I recently came across an indicator and wanted to check with you if you can build a similar indicator that works on Orenko or Ninja renko charts, and also combines support and resistance untouched. Below is the indicator, which will tell you market chop and to avoid. I want to include a support and
The Expert Advisor (EA) must work with any custom indicator that provides Buy and Sell signals through buffers. The EA should read signals from the indicator and execute trades according to the defined rules. The EA must be universal and able to work with different indicators as long as they provide signal buffers. I will share the rest of the details with you shortly
I need a highly accurate spike MT5 detector for boom and crash which can be used to catch big spikes. Demo versions will be required. The indicator should not repaint and have high win rate. It should work as shown in the links below https://vt.tiktok.com/ZSHgMePGh/ https://vt.tiktok.com/ZSHg6STkB/ https://vt.tiktok.com/ZSHg62YJ4/ https://vt.tiktok.com/ZSHgjoEML/

Informazioni sul progetto

Budget
30+ USD