명시

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
등급
(249)
프로젝트
313
28%
중재
33
27% / 64%
기한 초과
10
3%
무료
2
개발자 2
등급
(139)
프로젝트
181
24%
중재
23
22% / 39%
기한 초과
13
7%
무료
3
개발자 3
등급
(325)
프로젝트
505
19%
중재
32
44% / 31%
기한 초과
34
7%
로드됨
4
개발자 4
등급
(44)
프로젝트
58
3%
중재
7
0% / 57%
기한 초과
5
9%
작업중
5
개발자 5
등급
(194)
프로젝트
241
34%
중재
10
50% / 50%
기한 초과
8
3%
작업중
게재됨: 1 기고글, 8 코드
6
개발자 6
등급
(252)
프로젝트
258
30%
중재
0
기한 초과
3
1%
무료
게재됨: 2 코드
7
개발자 7
등급
(271)
프로젝트
400
27%
중재
39
41% / 49%
기한 초과
1
0%
무료
8
개발자 8
등급
(154)
프로젝트
192
58%
중재
10
80% / 0%
기한 초과
0
작업중
게재됨: 1 코드
9
개발자 9
등급
(85)
프로젝트
168
44%
중재
3
67% / 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
등급
(527)
프로젝트
799
63%
중재
33
27% / 45%
기한 초과
23
3%
무료
게재됨: 1 코드
13
개발자 13
등급
(43)
프로젝트
66
12%
중재
12
58% / 42%
기한 초과
1
2%
무료
14
개발자 14
등급
(548)
프로젝트
632
33%
중재
39
38% / 49%
기한 초과
11
2%
로드됨
15
개발자 15
등급
(12)
프로젝트
25
4%
중재
1
0% / 0%
기한 초과
7
28%
무료
16
개발자 16
등급
(449)
프로젝트
477
69%
중재
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
무료
비슷한 주문
I am looking to purchase a proven scalping Expert Advisor with verified live account performance. Requirements: • Minimum 6 months live trading history • Proven profitability with controlled drawdown • Scalping strategy with Buy and Sell trades • Works on XAUUSD (Gold), MT5 preferred • Includes Stop Loss and Take Profit • Suitable for small accounts ($100) • Reasonable one time price Please share live performance
Trade Copier from MT4/ MT5 to MT4/ MT5 (local) , i am looking for some local copier where i can copy trade from meta trader 4 to meta trader 5 or meta trader 5 to meta trader 4 , looking for fast execution
I. YÊU CẦU DỰ ÁN Tôi đang tìm cách phát triển một hệ thống giao dịch tự động (Expert Advisor) được xây dựng trên nền tảng Smart Money Concepts (SMC), tích hợp Trí tuệ Nhân tạo (AI) và có cơ chế quản lý vốn tiên tiến. EA (Expert Advisor) phải được tối ưu hóa cho cả thị trường biến động mạnh như Vàng (XAUUSD) cũng như các thị trường ổn định, có xu hướng như EURUSD. Nó phải thân thiện với người mới bắt đầu nhưng cũng đủ
The indicator a bit inverted. But it doesn’t matter to me as long as the winrate make sense for investment. For brief details regarding the indicator. What should have been a sell, i inverted it into buy with sl and tp swapped(only change the name of sl and tp for visualisation , but the code still on right tp and sl) . And in script ive inverted the signal command code. But the trouble is the tp and sl cant be
Tuyển dụng chuyên gia MQL4 để tối ưu hóa và hoàn thiện hệ thống giao dịch tự động (EA) I. Tổng quan Tôi đang tìm kiếm một nhà phát triển MQL4 giàu kinh nghiệm để tinh chỉnh, tối ưu hóa và hoàn thiện một Expert Advisor (EA) được thiết kế riêng cho nền tảng MetaTrader 4 (MT4). Logic cốt lõi đã được phát triển; mục tiêu chính là nâng cao hiệu suất và đảm bảo tính ổn định sẵn sàng cho môi trường sản xuất. II. Yêu cầu kỹ
The EA should only set TP and SL( Both Optional, We can set one at the time or no one at the same time or both active at the same time) 1. We active trade ourself , But in The EA this should ask if what the the TP and SL in form of USD we need. We'll put the Exact Required profit and or loss. This EA should calculate and set the tps and Sls itself to all the trades, and when we change the USD profit from info meter
Pro EA 30+ USD
Hi, I want to build a trading robot specifically for passing a prop firm challenge. The EA should focus on strict risk management, low drawdown, and consistency suitable for prop firm rules. My current budget for this project is $30. Please let me know what is achievable within this budget and the strategy you recommend
Indicator Simple Moving Averages and Exponential Moving Average BUY SIGNALS SMA 7 High Crosses Above 20 EMA= LIME color Buy Signal at the low of next candle. SMA 7 High Crosses above 40 EMA= BLUE color Buy Signal at low of next candle. SMA 7 High Crossed above 200 EMA= YELLOW Color buy signal at the low of next candle. SELL SIGNALS SMA 7 Low Crosses below 20 Ema= LIME color Sell Signal at the high of next candle. SMA
I trade manually on M1 chart (XAUUSD) with fractals and alligator. When there is a price break on fractal (or some fractals that form a price level) or a price level created by multiple candles spikes, I enter 2 trades (0.02 lots), and 2 trades (0.04 lots). If I go in profit (5/10€), I close in profit. But if I go in loss with DD, at this point starts the management: every price level (important level) created by
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

프로젝트 정보

예산
30+ USD