Test Report Errors (Invalid Stops) on Expert Advisor upload for MQL5 : NEED HELP WITH CORRECTING ERROR CODE

Lavoro terminato

Tempo di esecuzione 20 secondi
Feedback del cliente
Great guy. Thanks a lot man
Feedback del dipendente
Thanks for the fair business.

Specifiche

Hi All,


I am in the process of uploading an expert advisor to the MQL5 Market place.


However, it comes up with this error code below during the Test Report:

ERROR CODE FROM TEST REPORT:

test on EURUSD,H1 (netting strategy tester report 104 total trades test on XAUUSD,D1 (netting) 2021.02.17 01:05:00 failed instant sell 1 XAUUSD at 1792.65 sl: 1792.95 tp: 1792.15 [Invalid stops] 2021.03.30 01:05:00 failed instant sell 1 XAUUSD at 1712.68 sl: 1712.98 tp: 1712.18 [Invalid stops] 2021.05.03 01:05:00 failed instant sell 1 XAUUSD at 1766.81 sl: 1767.11 tp: 1766.31 [Invalid stops] 2021.07.22 01:05:00 failed instant sell 1 XAUUSD at 1803.83 sl: 1804.13 tp: 1803.33 [Invalid stops] 2021.08.06 01:05:00 failed instant sell 1 XAUUSD at 1804.65 sl: 1804.95 tp: 1804.15 [Invalid stops] there are no trading operations

SECTIONS OF MY SCRIPT WHICH MAY BE CAUSING ISSUES:

void Trailing(string symb){ int TrailingStep = 0; double sl = 0; if ( PositionsTotal() > 0 ) { for (int i = PositionsTotal() - 1 ; i >= 0 ; i--) { if (!o_position.SelectByIndex(i)) {break;} if (o_position.Magic() == MagicNumber ) { if (o_position.PositionType() == POSITION_TYPE_BUY){ double price = SymbolInfoDouble(symb,SYMBOL_BID); if (price - o_position.PriceOpen() <= 0) {continue;} if(price-o_position.PriceOpen()>=TrailingStart*point) { if(o_position.StopLoss()<price-TrailingStop*point-TrailingStep*point || (o_position.StopLoss() < o_position.PriceOpen() && o_position.StopLoss()<price-TrailingStop*point)) { o_trade.PositionModify(o_position.Ticket(),price-TrailingStop*point,o_position.TakeProfit()); } } } else if (o_position.PositionType() == POSITION_TYPE_SELL){ double price = SymbolInfoDouble(symb,SYMBOL_ASK); if (price - o_position.PriceOpen() >= 0) {continue;} if((o_position.PriceOpen()-price)>TrailingStart*point) { if((o_position.StopLoss()>price+TrailingStop*point+TrailingStep*point) || (o_position.StopLoss()==0) || (o_position.StopLoss()>o_position.PriceOpen() && o_position.StopLoss()>price+TrailingStop*point)) { o_trade.PositionModify(o_position.Ticket(),price+TrailingStop*point,o_position.TakeProfit()); } } } } } } } double getLot(int _points){ string _symbol = _Symbol; double _risk_percent = LotSize; if (LotType == FIXED){return LotSize;} double minlot = SymbolInfoDouble(_symbol,SYMBOL_VOLUME_MIN); double maxlot = SymbolInfoDouble(_symbol,SYMBOL_VOLUME_MAX); double steplot = SymbolInfoDouble(_symbol, SYMBOL_VOLUME_STEP); double money_risk = NormalizeDouble(AccountInfoDouble(ACCOUNT_EQUITY)*_risk_percent/100,2); double calc_point_cost = NormalizeDouble(money_risk/_points,2); double lot_point_cost=SymbolInfoDouble(_symbol, SYMBOL_TRADE_TICK_VALUE_LOSS); while(!MathIsValidNumber(lot_point_cost) || lot_point_cost==0){ lot_point_cost=SymbolInfoDouble(_symbol, SYMBOL_TRADE_TICK_VALUE_LOSS); } double lot = calc_point_cost/lot_point_cost; if (lot<=minlot) {lot = minlot;} else if (lot>maxlot) {lot=maxlot;} else if (lot>minlot && lot<maxlot){ int k = int ((lot-minlot)/steplot); lot = NormalizeDouble(minlot+k*steplot,2); } return (lot); } int getNumberOfTrades(string symb){ int count = 0; if ( PositionsTotal() > 0 ) { for (int i = PositionsTotal() - 1 ; i >= 0 ; i--) { if (!o_position.SelectByIndex(i)) {break;} if (o_position.Magic() == MagicNumber && o_position.Symbol() == symb) { count++; } } } return(count); } void CloseReversal(ENUM_POSITION_TYPE type) { if ( PositionsTotal() > 0 ) { for (int i = PositionsTotal() - 1 ; i >= 0 ; i--) { if (!o_position.SelectByIndex(i)) {break;} if (o_position.Magic() == MagicNumber && o_position.Symbol() == _Symbol && type == o_position.PositionType()) { o_trade.PositionClose(o_position.Ticket()); } } } } double NormalizeLots(double Lots){ string symb = _Symbol; double minlot = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MIN); double maxlot = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MAX); double steplot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP); double lots = MathFloor(Lots / steplot) * steplot; if (lots < minlot){return minlot;} if (lots > maxlot){return maxlot;} return lots; } //+------------------------------------------------------------------+ //| Check for close position conditions | //+------------------------------------------------------------------+ bool IsFillingTypeAllowed(string symbol, int filll_type) { int filling = (int)SymbolInfoInteger(symbol, SYMBOL_FILLING_MODE); return ((filling && filll_type) == filll_type); } //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit(void) { if (!o_symbol.Name(Symbol())) return(INIT_FAILED); // sets symbol name o_trade.SetExpertMagicNumber(MagicNumber); if (IsFillingTypeAllowed(o_symbol.Name(),SYMBOL_FILLING_FOK)) { o_trade.SetTypeFilling(ORDER_FILLING_FOK); } else if (IsFillingTypeAllowed(o_symbol.Name(),SYMBOL_FILLING_IOC)){ o_trade.SetTypeFilling(SYMBOL_FILLING_IOC); } else { o_trade.SetTypeFilling(ORDER_FILLING_RETURN); } o_trade.SetDeviationInPoints(Slippage);


Can someone help me with these error as I am new to coding.PLEASE NO TIME WASTERS, ONLY EXPERIENCED CODERS!!!


Con risposta

1
Sviluppatore 1
Valutazioni
(75)
Progetti
93
34%
Arbitraggio
8
88% / 0%
In ritardo
0
In elaborazione
2
Sviluppatore 2
Valutazioni
(172)
Progetti
221
57%
Arbitraggio
7
29% / 29%
In ritardo
7
3%
In elaborazione
3
Sviluppatore 3
Valutazioni
(7)
Progetti
11
9%
Arbitraggio
1
0% / 100%
In ritardo
0
Gratuito
4
Sviluppatore 4
Valutazioni
(8)
Progetti
11
18%
Arbitraggio
6
50% / 17%
In ritardo
1
9%
In elaborazione
5
Sviluppatore 5
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
6
Sviluppatore 6
Valutazioni
(2)
Progetti
3
0%
Arbitraggio
0
In ritardo
0
Gratuito
7
Sviluppatore 7
Valutazioni
(185)
Progetti
190
27%
Arbitraggio
0
In ritardo
3
2%
Gratuito
8
Sviluppatore 8
Valutazioni
(52)
Progetti
96
24%
Arbitraggio
9
22% / 22%
In ritardo
12
13%
In elaborazione
9
Sviluppatore 9
Valutazioni
(66)
Progetti
143
34%
Arbitraggio
11
9% / 55%
In ritardo
26
18%
In elaborazione
Ordini simili
I have ex4 file that I want recreating into new indicator with source code If possible I want it to be non repaint so the signal do non redraw pls and thank you
Requirements All features of indicators, plus enter into trades (buy, sell) TP and SL according to the indicator [TP1 and TP2] Can make MT5 from MT4 indicator? Add trailing stop loss trading hours trading days Max spread Possibility of Multiple charts through one window Daily profit Target [yes/no]
hello... saya menginginkan EA GRID?AVERAGING dengan kondisi : > bisa meletakan sell&buy Limit pada nilai tertentu > bisa meletakkan sell&buy stop pada nilai tertentu > bisa melakukan order sell/buy limit/stop (sesuai setting) berdasarkan Nilai RSI > bisa membatasi jumlah order > ada fungsi TP dan SL > rangkuman hasil kerja EA selama mingguan terimakasih, semoga bisa bekerjasama dengan baik
I already have the EA completed. I just need to add 2 params and fix the feature (GV) to make sure that no order is missed for any reason. Maybe GV is not enough and need to add another feature
Need to create ea to trade in indian market by placing orders to Indian market platform through API form mqlHere's a basic outline of what script should include: Define Heikin Ashi candle pattern: Convert regular candles to Heikin Ashi candles. Order Execution: Execute orders on the open of the second candle after the signal is generated. Buy Call: When a buy call is generated, initiate a call option order. Set
I want the trade to trigger anytime it sees the opportunity on all time frames, sl tp should be automated and all trades should be trigger anytime on cpi news and etc
Добрый день. Мне нужно создать сигнального бота. У меня есть индикатор на Trading View, который выделяет точку интереса - спрос/предложение. (но я в нем не уверен, подойдет ли он для робота, возможно такой индикатор нужно будет написать). Нужно чтоб все зоны были экстримальные, то есть, если произойдет пробитие зоны то менялся тренд. Как я торгую? Индикатор выделяет зону. Мне нужно увидеть подтверждение в пределах
I need a trading bot 30 - 40 USD
I'm in need of a trading bot, based on 3 mt4 indicators, which are semafor alert, reversals and bluever.I want the signals produced by the indicators to be automated and run on mt5 platform, trade anything including synthetic indices and works on any time frame
Hi Dear Expert Developer, I want to make a Indicator as Candle pattern as below; 1.Inverted Hammer (Must as per My Drawing) with notification ( only H1,H4,DAY,WEEK time frame) if match with my drawing pattern 2.Hanging Man ( Must as per Drawing) with notification ( Only H1,H4, Day, Week time frame ) if match with my drawing pattern Example, I will apply this indicator on EURUSD H1 time frame and I have open only H1
I need someone to help me convert my tradingview pinescript to mt4, I only got $20 for this and I am gonna be giving you more works ahead, Also I will be paying with cryptocurrency cause my PayPal os not working here, Don't know why

Informazioni sul progetto

Budget
30+ USD
Per lo sviluppatore
27 USD