8 ERROR ON THE CODE FOR MY EA

Specifiche

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);

      }

   }

}


Con risposta

1
Sviluppatore 1
Valutazioni
(43)
Progetti
66
12%
Arbitraggio
12
58% / 42%
In ritardo
1
2%
Gratuito
2
Sviluppatore 2
Valutazioni
(15)
Progetti
20
35%
Arbitraggio
3
0% / 100%
In ritardo
0
Gratuito
Pubblicati: 1 codice
3
Sviluppatore 3
Valutazioni
(85)
Progetti
167
44%
Arbitraggio
3
67% / 0%
In ritardo
5
3%
In elaborazione
Pubblicati: 1 codice
4
Sviluppatore 4
Valutazioni
(15)
Progetti
17
29%
Arbitraggio
0
In ritardo
1
6%
Gratuito
5
Sviluppatore 5
Valutazioni
(546)
Progetti
629
33%
Arbitraggio
38
39% / 50%
In ritardo
11
2%
Caricato
6
Sviluppatore 6
Valutazioni
(54)
Progetti
102
23%
Arbitraggio
12
25% / 17%
In ritardo
13
13%
Gratuito
7
Sviluppatore 7
Valutazioni
(465)
Progetti
485
75%
Arbitraggio
6
67% / 17%
In ritardo
0
In elaborazione
8
Sviluppatore 8
Valutazioni
(31)
Progetti
41
20%
Arbitraggio
9
11% / 89%
In ritardo
5
12%
Gratuito
9
Sviluppatore 9
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
10
Sviluppatore 10
Valutazioni
(574)
Progetti
945
47%
Arbitraggio
309
58% / 27%
In ritardo
125
13%
Gratuito
11
Sviluppatore 11
Valutazioni
(87)
Progetti
121
68%
Arbitraggio
5
80% / 0%
In ritardo
12
10%
Gratuito
12
Sviluppatore 12
Valutazioni
(7)
Progetti
6
0%
Arbitraggio
5
0% / 100%
In ritardo
1
17%
Gratuito
13
Sviluppatore 13
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
Ordini simili
I want a modification on my ea . A spread filter or slipage filter such that when the market price is less than 50 point away from the pend order , then ea check the spread if less than the set filter spread. If spread is more than the set spread, the ea will delete the pend order . Secondly , if the broker price is moved or sliped the pending order from the original price it was set by the tolerable slipage distance
I want this indicator on my mt5 account and mt4 account because I want use this brilliant reversal indicator on my Android device each an every time when I enter on my mt5 account
1. Objective Create an MT5 automation script (or set of scripts) that fully automates my strategy optimization workflow, including: • Batch optimization runs • Automatic filtering of results • Automatic forward testing • Exporting and organizing results into structured files/folders The goal is to reduce manual work and allow one‑click execution of the entire pipeline. 2. Platform & Environment • MetaTrader 5 •
Would it be possible to connect Futures prop firm with Rithmic or Tradeovate platform to Ninjatrader automated trading ? If anyone can do this for me I will be happy to get started with the person right away
hello great developer I want to modify my NT8 indicator to change its arrow printing logic so that arrows appear on the first candled dot, not after the series. no repaint and no back painting. all in real time. This will help me get timely signals. Scope of work - Modify NT8 indicator logic to print arrows on the first candled dot. - Ensure arrow print matches 90%+ accuracy compared to the current functionality. -
I have a open source Tradingview indicator that I want it to be converted to Ninja Trader8. I have attached it. Please let me know, if you can do it and for how muc
I need help in modifying an amibroker AFL indicator the indicator already works but I need per symbol static variable isolation, parameters persistence per symbol after restart, non declining trailing stop logic, parameter auto restore when switching symbols and a global reset function for static variables. For better understanding As discussed, this is the official offer for restructuring my RAD Chandelier stop loss
Hi, I have a clear MT5 EA wrapper project with locked TSCEA, requiring enhanced execution logic (“pending OR better market” order handling). I can share detailed spec. Please let me know your availability and quote range. Thanks, Tom Pike ------------------------------------------------------------------------------------------------------------------------------ Title: MT5 Wrapper EA – “Limit Order OR Better
ICT_OneTrade_2R 100 - 200 USD
🔥 ICT_OneTrade_2R Precision. Discipline. Consistency. ICT_OneTrade_2R is a professional Expert Advisor designed for traders who value structured execution and controlled risk. This system is built around a fixed Risk-to-Reward ratio of 1:2 (RR 2.0) — meaning every trade is planned with precision: Risk 1 → Target 2. No randomness. No overtrading. Just one high-quality trade per session. ⚙️ Key Features ✔ Fixed RR 1:2
Hi , I have some indicators that I want set up on my TV chart and want to create one chart for some and another chart for some others. Plus I want to set up the brackets orders so I can trade from the chart. I have these set up somewhat but need it cleaned up and the way I want them. how much would something like this cost to do? I'm in California and would like you to show me so I can learn to do this when I want to

Informazioni sul progetto

Budget
30 - 40 USD
Scadenze
da 1 a 31 giorno(i)