指定

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
評価
(253)
プロジェクト
316
29%
仲裁
34
26% / 65%
期限切れ
10
3%
2
開発者 2
評価
(139)
プロジェクト
181
24%
仲裁
23
22% / 39%
期限切れ
13
7%
3
開発者 3
評価
(328)
プロジェクト
511
19%
仲裁
33
45% / 30%
期限切れ
34
7%
取り込み中
4
開発者 4
評価
(44)
プロジェクト
58
3%
仲裁
6
0% / 67%
期限切れ
5
9%
5
開発者 5
評価
(194)
プロジェクト
241
34%
仲裁
11
45% / 45%
期限切れ
8
3%
仕事中
パブリッシュした人: 1 article, 8 codes
6
開発者 6
評価
(257)
プロジェクト
263
30%
仲裁
0
期限切れ
3
1%
パブリッシュした人: 2 codes
7
開発者 7
評価
(273)
プロジェクト
402
27%
仲裁
40
40% / 50%
期限切れ
1
0%
8
開発者 8
評価
(156)
プロジェクト
197
59%
仲裁
10
80% / 0%
期限切れ
0
パブリッシュした人: 1 code
9
開発者 9
評価
(85)
プロジェクト
169
44%
仲裁
3
67% / 0%
期限切れ
5
3%
仕事中
パブリッシュした人: 1 code
10
開発者 10
評価
(37)
プロジェクト
59
27%
仲裁
26
19% / 54%
期限切れ
10
17%
仕事中
パブリッシュした人: 1 code
11
開発者 11
評価
(1156)
プロジェクト
1462
63%
仲裁
21
57% / 10%
期限切れ
43
3%
12
開発者 12
評価
(541)
プロジェクト
818
62%
仲裁
33
27% / 45%
期限切れ
23
3%
パブリッシュした人: 1 code
13
開発者 13
評価
(43)
プロジェクト
66
12%
仲裁
12
58% / 42%
期限切れ
1
2%
14
開発者 14
評価
(566)
プロジェクト
655
33%
仲裁
41
41% / 46%
期限切れ
11
2%
多忙
15
開発者 15
評価
(12)
プロジェクト
25
4%
仲裁
1
0% / 0%
期限切れ
7
28%
16
開発者 16
評価
(450)
プロジェクト
477
69%
仲裁
6
67% / 0%
期限切れ
2
0%
17
開発者 17
評価
(152)
プロジェクト
228
80%
仲裁
22
27% / 50%
期限切れ
11
5%
パブリッシュした人: 24 articles, 1882 codes
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 code
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
類似した注文
Experience steady growth with this sophisticated, indicator-free scalping EA, specifically engineered to nurture small accounts starting at just 50 USD. This expert advisor is built on the foundations of pure price action, intentionally avoiding high-risk methods like martingale or grid systems. To preserve the high-performance logic of the original strategy, it is provided in its authentic form, bypassing the
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
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
I have an existing TradingView Pine Script. I will provide the Pine Script source code after agreement. Goal: Convert the logic into MT5 (MQL5) and build an EA. Phase 1: Create MT5 indicator that matches TradingView signals (M15 only) Phase 2: Build EA with strict execution rules: max 4 trades total one trade per symbol gold lot limit (max 0.02 total) reversal logic (close then open opposite) no re-entry after manual
Requirements 1.Robot for Entry and Exit rules as per my indicators. 2.Back testing which can work on all time frames. 3.A system which i can modify later on as well according to my studies
I have been working on an EA that is based on Ichimoku cloud and SMC internal blocks for stop loss. ENTRY BUGS: 1. I have entries issues with the chenkou and price action. It is entering trades when chenkou is poking through the kumo. This shouldn't happen. There should be a candle close with chenkou above kumo or below. 2. Another entry issue with other criteria for tenkan and price action also these entries are
Looking for experience profitable manual traders that will be willing to trade my live mt5 account for profit share. Requirements Must have at least 6 months of profitable months. Min 10 percent monthly Send me investor credentials for mt5 or mt4 account. Can be trading Any instruments. Must reply with mt5 credentials or will disregard
Title: Advanced Manual Hedge EA with Multiplier & Multiple Trade Support Project Requirements: I need a professional Expert Advisor (EA) for XAUUSD and Forex to manage manual trades with the following logic: Lot Multiplier: The EA must automatically detect my manual trade size. There should be a "Multiplier" input (e.g., 3.0). If I open 1.0 lot Buy, the EA must auto-place a 3.0 lot Sell Stop at the set Gap
I am looking for an experienced MQL5 developer to complete the optimization and structural refinement of an existing MT5 Expert Advisor (source code ~2.5MB). Phase 1 (audit and baseline testing) has already been completed. The remaining work focuses on correcting core system behavior without changing the strategy. Key issues identified: • Scenario gate logic is not correctly structured at the entry decision level •

プロジェクト情報

予算
30+ USD