I HAVE THE CODE ALREADY, BUT IT DOES NOT WORK, CAN YOU MAKE A FEW CHANGES FOR THE EXECUTION FOR THIS EA PLEASE.

İş Gereklilikleri

// Input Parameters
input int TradeExecutionHour = 10; // Trade execution hour (server time)
input bool ManualLotSize = true; // Enable manual lot size adjustment
input bool RiskAllocation = true; // Enable percentage-based risk allocation
input double RiskPercentage = 2.0; // Percentage of risk per trade
input int CandleRangeCondition = 100; // Minimum candle range condition in points
input string Symbols = {"GER30.fin", "EURUSD", "GBPUSD"}; // Symbols to trade

// Global Variables
int ticketBuy, ticketSell;
double entryPointBuy, entryPointSell, stopLossBuy, stopLossSell, takeProfitBuy, takeProfitSell;
bool breakevenBuy = false, breakevenSell = false;

void OnTick()
{
    // Check trade execution time
    if (TimeHour(TimeCurrent()) == TradeExecutionHour)
    {
        // Check candle range condition
        if (CheckCandleRangeCondition())
        {
            // Calculate entry points
            CalculateEntryPoints();

            // Calculate lot size
            double lotSize = CalculateLotSize();

            // Place buy stop order
            ticketBuy = OrderSend(Symbol(), OP_BUYSTOP, lotSize, entryPointBuy, 2 * Point, stopLossBuy, takeProfitBuy);

            // Place sell stop order
            ticketSell = OrderSend(Symbol(), OP_SELLSTOP, lotSize, entryPointSell, 2 * Point, stopLossSell, takeProfitSell);
        }
    }

    // Check breakeven condition
    if (breakevenBuy && breakevenSell)
    {
        if (CheckBreakevenCondition())
        {
            // Move stop loss to breakeven
            MoveStopLossToBreakeven();
        }
    }
}

bool CheckCandleRangeCondition()
{
    double range = 0;
    for (int i = 0; i < 5; i++)
    {
        range += High[i] - Low[i];
    }
    range /= 5;
  
    return range >= CandleRangeCondition * Point;
}

void CalculateEntryPoints()
{
    double highestHigh = High[1];
    double lowestLow = Low[1];
  
    for (int i = 1; i <= 5; i++)
    {
        if (High[i] > highestHigh)
            highestHigh = High[i];
        if (Low[i] < lowestLow)
            lowestLow = Low[i];
    }
  
    entryPointBuy = highestHigh + 2 * Point;
    entryPointSell = lowestLow - 2 * Point;
    stopLossBuy = lowestLow - 2 * Point;
    stopLossSell = highestHigh + 2 * Point;
    takeProfitBuy = entryPointBuy + 3 * (entryPointBuy - stopLossBuy);
    takeProfitSell = entryPointSell - 3 * (stopLossSell - entryPointSell);
}

double CalculateLotSize()
{
    double lotSize = 0;
  
    if (ManualLotSize)
    {
        // Adjust the lot size manually for each trade
        // Add your own logic here
        lotSize = 0.01;
    }
    else if (RiskAllocation)
    {
        // Calculate lot size based on risk percentage
        double accountBalance = AccountBalance();
        double riskAmount = accountBalance * RiskPercentage / 100.0;
        double stopLossDistance = MathMax(stopLossBuy - entryPointBuy, entryPointSell - stopLossSell);
        lotSize = riskAmount / stopLossDistance;
    }
  
    return lotSize;
}

bool CheckBreakevenCondition()
{
    // Check if the price has reached 1 to 1 ratio
    // Add your own logic here
  
    return false;
}

void MoveStopLossToBreakeven()
{
    // Move stop loss to breakeven
    // Add your own logic here
}

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(1)
Projeler
1
0%
Arabuluculuk
3
33% / 67%
Süresi dolmuş
0
Serbest
2
Geliştirici 2
Derecelendirme
(89)
Projeler
112
24%
Arabuluculuk
11
45% / 18%
Süresi dolmuş
8
7%
Çalışıyor
3
Geliştirici 3
Derecelendirme
(355)
Projeler
484
51%
Arabuluculuk
24
54% / 25%
Süresi dolmuş
5
1%
Yüklendi
4
Geliştirici 4
Derecelendirme
(63)
Projeler
68
25%
Arabuluculuk
12
42% / 42%
Süresi dolmuş
4
6%
Serbest
5
Geliştirici 5
Derecelendirme
(2441)
Projeler
3076
66%
Arabuluculuk
77
48% / 14%
Süresi dolmuş
340
11%
Serbest
6
Geliştirici 6
Derecelendirme
(248)
Projeler
444
34%
Arabuluculuk
56
36% / 38%
Süresi dolmuş
163
37%
Yüklendi
7
Geliştirici 7
Derecelendirme
(11)
Projeler
16
25%
Arabuluculuk
0
Süresi dolmuş
1
6%
Serbest
8
Geliştirici 8
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
9
Geliştirici 9
Derecelendirme
(37)
Projeler
59
27%
Arabuluculuk
25
20% / 52%
Süresi dolmuş
10
17%
Çalışıyor
10
Geliştirici 10
Derecelendirme
(63)
Projeler
194
73%
Arabuluculuk
4
100% / 0%
Süresi dolmuş
1
1%
Serbest
11
Geliştirici 11
Derecelendirme
(10)
Projeler
16
25%
Arabuluculuk
3
67% / 33%
Süresi dolmuş
1
6%
Çalışıyor
12
Geliştirici 12
Derecelendirme
(11)
Projeler
11
0%
Arabuluculuk
4
25% / 50%
Süresi dolmuş
2
18%
Serbest
13
Geliştirici 13
Derecelendirme
(72)
Projeler
80
10%
Arabuluculuk
36
8% / 53%
Süresi dolmuş
6
8%
Çalışıyor
14
Geliştirici 14
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
15
Geliştirici 15
Derecelendirme
(568)
Projeler
641
41%
Arabuluculuk
21
57% / 29%
Süresi dolmuş
47
7%
Çalışıyor
16
Geliştirici 16
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
17
Geliştirici 17
Derecelendirme
(58)
Projeler
66
6%
Arabuluculuk
27
19% / 37%
Süresi dolmuş
4
6%
Yüklendi
Benzer siparişler
I need to fix the alerts of my SMC Order Blocks indicator, which is a custom indicator created for me some time ago. This custom indicator already has several types of alerts built-in, but I need to fix specific ones while keeping the other existing alerts unchanged, as those do not have any errors. The alert is for a specific Order Blocks pattern. This indicator graphically provides a zigzag, and from there, CHoCH
Mobile robot 50 - 100 USD
I want a profitable scalping EA robot for mt5 and mobile phones (licence key should be provided).the video link attached below indicates how the EA robot should operate it.it analyses the market before taking trades and it trades candle to candle .also coding samples are provided on the video .it should be applicable to all timeframes.it should trade indices(Nas100,US30,S&p500,GER30,)
Martingale EA for MT5 30 - 100 USD
Criteria: Only one trade at a time. Cannot open another trade if one is running Trade on EURUSD only, once job is completed I will be happy to schedule more for other pairs You choose entry strategy and criteria win rate must be above 50% in long term backtest of EURUSD Every trade has got TP and SL Trades to last about a day, few trades a week, at least 10 pips gain per trade, so that it can be launched on normal
I have a indicator, mql file. The signals are seen below on a EURNZD H1 chart. Very important to get accurate entries. The signal to trade is the first tic after the the indicator signal paints. I've tried to demonstrate that below. Other than that the EA will have a lot size escalation, an on-screen pip counter, a button to stop taking new trades, SL/TP, and magic number. I would like the indicator to be within the
I would like to create an EA based on the Shved Supply and Demand indicator. you can find the Shved Supply and Demand v1.7 indicator in the following link https://www.mql5.com/en/code/29395 NB: Checks the trading robot must pass before publication in the Market ( https://www.mql5.com/en/articles/2555 ) MQ5 file to be provided
I want grate robot for making profits that know when to start a good trade and close a trade and must be active all time to avoid lost of money
Hi Guys, I am looking to someone that can generate an indicator for MT4 as explained below. Basically I would need that the indicator point out the price that will close my position in stop out/margin call. The indicator should pick automatically the level of trade out for the broker (which can be different from a broker to another broker) It should write (ideally on the bottom on the left) the following information
Mbeje fx 50+ USD
I like to own my robot that why I want to build my own.i like to be a best to every robot ever in the life to be have more money
I need an MT5 EA that can do the following: I have to give the EA a price in advance, when the price is reached the EA has to automatically place a buy stop or sell stop order 0.5 pips below or above the price. Is this possible
Good day, I want someone to help me create a universal news filter with on/off switch, with start and end settings, and drawdown control with magic number of EAs, etc. Thanks

Proje bilgisi

Bütçe
30 - 50 USD
KDV (21%): 6.3 - 10.5 USD
Toplam: 36.3 - 60.5 USD
Geliştirici için
27 - 45 USD