FIX ERRORS ON MY CODE

指定

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
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
# 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}")
I need a trading bot, please i need this project urgently and when messaing me kindly send me samples of past works and dont forget i need the project to be done as soon as possible
If you have good Market structure indicators with buffer no repaint internal structure and external structure etc good market structure if you have then i already have ea you have to input into the indicator soy current ea opens position based on the market structure
*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
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
WORKING EA 35+ USD
I Need an existing proven profitable EA. EA should have at least 3 months track record of consistency. My budget is $35 and nothing more. If you do not have the working EA for that amount, please do not apply. I'm not paying a dime more. Again do not apply if you are not willing to take the above amount
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

项目信息

预算
30+ USD