8 ERROR ON THE CODE FOR MY EA

Spécifications

GOOD DAY

I have created a robot using mql5 however though i have 8 errors and i tried everythin i can do but still failing.


Please advise on what to do, i am will to add more if someone can solve my issue.


PLEASE FIND THE CODE BELOW.


p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Helvetica Neue'; color: #000000} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Helvetica Neue'; color: #000000; min-height: 12.0px}

#include <Trade\Trade.mqh>


input int length = 22;

input float mult = 3.0;

input bool showLabels = true;

input bool useClose = true;

input bool highlightState = true;


input double lotSize = 0.1; // Lot size for trading

input double stopLoss = 50; // Stop loss distance in points

input double trailingStop = 0.3; // Trailing stop percentage


//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void OnStart()

{

   CTrade trade;

   

   int totalBars = Bars;

   double atr[];

   double longStop[];

   double shortStop[];

   int dir[];

   bool buySignal[];

   bool sellSignal[];


   ArraySetAsSeries(atr, true);

   ArraySetAsSeries(longStop, true);

   ArraySetAsSeries(shortStop, true);

   ArraySetAsSeries(dir, true);

   ArraySetAsSeries(buySignal, true);

   ArraySetAsSeries(sellSignal, true);


   for (int i = length; i < totalBars; i++)

   {

      atr[i] = mult * iATR(_Symbol, _Period, length, i);


      double highRange = useClose ? iHigh(NULL, _Period, i) : iHighest(NULL, _Period, MODE_HIGH, length, i);

      double lowRange = useClose ? iLow(NULL, _Period, i) : iLowest(NULL, _Period, MODE_LOW, length, i);

      

      longStop[i] = highRange - atr[i];

      longStop[i] = MathMax(longStop[i], longStop[i - 1]);


      shortStop[i] = lowRange + atr[i];

      shortStop[i] = MathMin(shortStop[i], shortStop[i - 1]);


      dir[i] = iClose(NULL, _Period, i) > shortStop[i - 1] ? 1 : iClose(NULL, _Period, i) < longStop[i - 1] ? -1 : dir[i - 1];


      buySignal[i] = dir[i] == 1 && dir[i - 1] == -1;

      sellSignal[i] = dir[i] == -1 && dir[i - 1] == 1;


      if (buySignal[i])

      {

         double entryPrice = iOpen(NULL, _Period, i + 1);

         double stopLossPrice = entryPrice - stopLoss * Point;

         double takeProfitPrice = entryPrice + trailingStop * entryPrice * Point;

         trade.Buy(_Symbol, lotSize, entryPrice, stopLossPrice, takeProfitPrice, 0, "Buy Signal", 0, clrNONE);

      }

      else if (sellSignal[i])

      {

         double entryPrice = iOpen(NULL, _Period, i + 1);

         double stopLossPrice = entryPrice + stopLoss * Point;

         double takeProfitPrice = entryPrice - trailingStop * entryPrice * Point;

         trade.Sell(_Symbol, lotSize, entryPrice, stopLossPrice, takeProfitPrice, 0, "Sell Signal", 0, clrNONE);

      }

   }

}


Répondu

1
Développeur 1
Évaluation
(43)
Projets
66
12%
Arbitrage
12
58% / 42%
En retard
1
2%
Gratuit
2
Développeur 2
Évaluation
(15)
Projets
20
35%
Arbitrage
3
0% / 100%
En retard
0
Gratuit
Publié : 1 code
3
Développeur 3
Évaluation
(84)
Projets
162
43%
Arbitrage
3
67% / 0%
En retard
5
3%
Travail
Publié : 1 code
4
Développeur 4
Évaluation
(15)
Projets
17
29%
Arbitrage
0
En retard
1
6%
Gratuit
5
Développeur 5
Évaluation
(539)
Projets
618
33%
Arbitrage
35
37% / 49%
En retard
10
2%
Occupé
6
Développeur 6
Évaluation
(54)
Projets
102
23%
Arbitrage
12
25% / 17%
En retard
13
13%
Gratuit
7
Développeur 7
Évaluation
(460)
Projets
481
75%
Arbitrage
5
80% / 0%
En retard
0
Gratuit
8
Développeur 8
Évaluation
(31)
Projets
41
20%
Arbitrage
9
11% / 89%
En retard
5
12%
Gratuit
9
Développeur 9
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
10
Développeur 10
Évaluation
(574)
Projets
945
47%
Arbitrage
309
58% / 27%
En retard
125
13%
Gratuit
11
Développeur 11
Évaluation
(86)
Projets
118
69%
Arbitrage
5
80% / 0%
En retard
11
9%
Travail
12
Développeur 12
Évaluation
(7)
Projets
6
0%
Arbitrage
5
0% / 100%
En retard
1
17%
Gratuit
13
Développeur 13
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
Commandes similaires
I want to develop and EA first to use for back testing, then to use for trading. This will be done on the 15 min timeframe. The EA must Identify sessions highs and lows with specific timings (Asian, London, NY), Place three EMA and ensure that the 50, 100 and 200 exponential moving averages are in order to give directional bias Sell bias = 50 below the 100, which is below the 200 Buy bias = 50 above the 100, which is
Need a HFT scalping EA 30 - 100 USD
Require the development of a high-speed HFT, fully automated trading Expert Advisor (EA) for MetaTrader 5 , optimized for live trading on both Deriv and Exness . The EA must be designed for fast execution, low latency, and reliability on real-money accounts , with full compatibility across broker-specific contract specifications, tick sizes, tick values, pricing formats, and volume rules. It should automatically
Looking for an experienced MQL4/MQL5 developer. Task: EX4 → MQ4 recovery Modify EA logic Convert MQ4 → MQ5 (fully working) Must understand MT4 vs MT5 differences and deliver clean, tested code. This is a paid job, with possible follow-up work if things go well. DM me with your experience and examples of similar work
This EA uses the inbuilt indicators to execute trades. It follows the simple rules of buy signal and sell signal.It will be independent of each other. The same rule follows for each
Mt5 Scalper Ea 100+ USD
Hi i want to make Mt5 scalping ea which works on xauusd and highly profitable who have strategy please dm me and with demo version of ea so i can test and see how it works before buying it
1. Background & MQL5 Journey: ¿Cuéntame un poco sobre tu background en trading algorítmico y qué te emociona de crear EAs de alto rendimiento? 2. Experience: ¿Cuáles son 2-3 EAs destacados que has creado (mercados, Sharpe, PF, señales/backtests)? 3. Institutional Results: ¿Puedes lograr Sharpe ≥3.0, PF >2.5, <10% DD en XAUUSD? ¿Qué te da confianza? 4. Demo EA: ¿Tienes una señal de EA top (MQL5/Myfxbook) con 100+
Here's the TradeStation ELD files that i want to convert to tradingview pine script (unprotected so you can see codes for indicators and systems/strategies) - let me know what you think it would cost? thanks i will be looking for great developer that will bid it for it and get started
Project Overview I am looking for an experienced MT5 (MQL5) developer to modify an existing Account Protection EA and, if required, extend it with custom logic. This is NOT a strategy or trading EA . The EA is purely for risk management, drawdown protection, alerts, and trading lock , suitable for prop-firm and managed accounts . Core Requirements 1. Alerts & Monitoring Alert on trade entry and trade exit Alert when
Need a pro dev to create an MT4 Expert Advisor ("Monitor EA") acting as execution firewall & auto-recovery controller for multiple EAs on XAUUSD (M1). How it works: Runs on blank chart; controls EAs via chart/template actions Closes/reopens charts to manage trades (EAs aren't editable) Targets IC Markets/VT Markets ECN Raw Source code handed over on completion Key Features:* XAUUSD (Gold) focus M1 timeframe
We're looking for a highly professional MQL5 developer to create FX Apex, an advanced scalping EA optimized for small accounts ($50+), 1:30 leverage, IC Markets broker, and ready for demo/live trading. Key Features:_ Scalps XAU/USD & major pairs (M1-M15), option to add more Adaptive TP/SL based on volatility, trend, ATR, momentum Dynamic trailing, breakeven, partial close functionality Configurable risk per trade

Informations sur le projet

Budget
30 - 40 USD
Délais
de 1 à 31 jour(s)