명시

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

                }

            }

        }

    }

}


응답함

1
개발자 1
등급
(263)
프로젝트
329
29%
중재
36
25% / 64%
기한 초과
10
3%
작업중
2
개발자 2
등급
(139)
프로젝트
181
24%
중재
23
22% / 39%
기한 초과
13
7%
무료
3
개발자 3
등급
(328)
프로젝트
513
19%
중재
35
43% / 31%
기한 초과
34
7%
로드됨
4
개발자 4
등급
(44)
프로젝트
60
5%
중재
6
0% / 67%
기한 초과
5
8%
무료
5
개발자 5
등급
(195)
프로젝트
242
34%
중재
11
45% / 45%
기한 초과
8
3%
무료
게재됨: 1 기고글, 8 코드
6
개발자 6
등급
(258)
프로젝트
266
29%
중재
0
기한 초과
3
1%
작업중
게재됨: 2 코드
7
개발자 7
등급
(274)
프로젝트
403
28%
중재
40
40% / 50%
기한 초과
1
0%
무료
8
개발자 8
등급
(160)
프로젝트
203
60%
중재
10
80% / 0%
기한 초과
0
작업중
게재됨: 1 코드
9
개발자 9
등급
(85)
프로젝트
174
44%
중재
3
100% / 0%
기한 초과
5
3%
무료
게재됨: 1 코드
10
개발자 10
등급
(37)
프로젝트
59
27%
중재
26
19% / 54%
기한 초과
10
17%
작업중
게재됨: 1 코드
11
개발자 11
등급
(1156)
프로젝트
1462
63%
중재
21
57% / 10%
기한 초과
43
3%
무료
12
개발자 12
등급
(548)
프로젝트
833
62%
중재
33
27% / 45%
기한 초과
24
3%
무료
게재됨: 1 코드
13
개발자 13
등급
(43)
프로젝트
66
12%
중재
12
58% / 42%
기한 초과
1
2%
무료
14
개발자 14
등급
(610)
프로젝트
708
33%
중재
45
44% / 42%
기한 초과
14
2%
로드됨
15
개발자 15
등급
(12)
프로젝트
25
4%
중재
1
0% / 0%
기한 초과
7
28%
무료
16
개발자 16
등급
(459)
프로젝트
486
70%
중재
6
67% / 0%
기한 초과
2
0%
작업중
17
개발자 17
등급
(152)
프로젝트
228
80%
중재
22
27% / 50%
기한 초과
11
5%
무료
게재됨: 24 기고글, 1882 코드
18
개발자 18
등급
(45)
프로젝트
76
20%
중재
7
0% / 86%
기한 초과
14
18%
무료
19
개발자 19
등급
(2)
프로젝트
2
0%
중재
1
0% / 0%
기한 초과
2
100%
무료
20
개발자 20
등급
(45)
프로젝트
46
24%
중재
34
9% / 85%
기한 초과
10
22%
무료
21
개발자 21
등급
(3)
프로젝트
2
50%
중재
2
0% / 100%
기한 초과
0
무료
22
개발자 22
등급
(15)
프로젝트
20
35%
중재
3
0% / 100%
기한 초과
0
무료
게재됨: 1 코드
23
개발자 23
등급
(257)
프로젝트
341
58%
중재
7
14% / 71%
기한 초과
9
3%
무료
24
개발자 24
등급
(3)
프로젝트
1
0%
중재
5
0% / 100%
기한 초과
0
무료
25
개발자 25
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
비슷한 주문
Master mind 30+ USD
Start ↓ Detect Trend (H4) ↓ Confirm Structure (H1) ↓ Wait for Pullback ↓ Check Indicators ↓ Calculate Confidence Score ↓ Score ≥ 80? ├── No → Wait └── Yes ↓ Calculate Lot Size ↓ Place Order ↓ Set Stop Loss ↓ Set Take Profit ↓ Manage Trade ↓ Move to Break-even ↓ Trail Stop ↓ Close Trade. IF Price > EMA200 (H4) AND EMA50 > EMA200 (H4) AND ADX > 25 AND RSI between 55 and 70 AND MACD Main > Signal AND Bullish engulfing
*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.*
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
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
Looking for an MT5 Expert Advisor developer with: Minimum 1 year of verified activity on the MetaTrader Market Positive, real user reviews Ability to build EAs without Bollinger Bands Fully configurable parameters (risk, filters, SL/TP, trading hours) Free test version available before any payment Clear communication and ongoing support If you meet these requirements, please send your MQL5 profile or portfolio
I want to create a EA based on an existing EA. I want to create a COPY of same EA. This is a Grid based EA and do averaging when market goes against it. While doing Averaging it keeps on taking trades and booking profits
Akram boushaba 30 - 500 USD
مرحبا كيف حالكم انا اكرم مهتم بالتداول احاول ان اصمم برنامج روبوت قادر على التداول من تلقاء نفسه من يمكنه ان يساعدني او يعلمني كيف استطيع فهل ذلك وسأكون ممتناً له وشكرا لكم
Looking for someone who is experienced in creating MT5 EA from scratch to go over 7 public youtube videos (total duration about 5 hours) and extract the strategy code taught in the videos to make a MT5 .mq5 source code file. Full code is explained in the 7 videos so it's just a matter of going over the videos and extracting the relevant parts that relate to the source code and compiling it into a working EA. The
EA Crafter 500+ USD
Act as a professional Quantitative Developer and Risk Manager. I want to build a systematic trading strategy rulebook that prioritizes capital preservation and statistical edge over raw performance. Please generate a structured trading strategy using the following framework: 1. ASSET CLASS & TIMEFRAME: - Asset: [e.g., Apple (AAPL), Bitcoin (BTC), or EUR/USD] - Timeframe: [e.g., 5-minute, 1-hour, Daily] 2. CORE

프로젝트 정보

예산
30+ USD