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

Job finished

Execution time 20 seconds
Feedback from customer
Great guy. Thanks a lot man
Feedback from employee
Thanks for the fair business.

Specification

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!!!


Responded

1
Developer 1
Rating
(69)
Projects
85
32%
Arbitration
7
86% / 0%
Overdue
0
Busy
2
Developer 2
Rating
(167)
Projects
215
57%
Arbitration
8
25% / 25%
Overdue
7
3%
Working
3
Developer 3
Rating
(3)
Projects
6
17%
Arbitration
1
0% / 100%
Overdue
0
Working
4
Developer 4
Rating
(7)
Projects
11
18%
Arbitration
6
50% / 0%
Overdue
1
9%
Working
5
Developer 5
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
6
Developer 6
Rating
(2)
Projects
3
0%
Arbitration
0
Overdue
0
Free
7
Developer 7
Rating
(184)
Projects
188
27%
Arbitration
0
Overdue
3
2%
Free
8
Developer 8
Rating
(52)
Projects
96
24%
Arbitration
9
22% / 22%
Overdue
12
13%
Free
9
Developer 9
Rating
(66)
Projects
143
34%
Arbitration
11
9% / 55%
Overdue
26
18%
Working
Similar orders
I am looking for a skilled developer to code my custom Ninjatrader 8 strategy and make it works perfectly. Your expertise is highly needed in this project Kindly reach out to me and let proceed to the project without any further delay thanks
I want a bot developer deriv He has experience and I want a profitable robot, the profit is higher than the loss Or I want someone to sue with me. I have a profitable robot, but I want another robot or to improve another robot I have
i want close on reserve signal, auto lots, time fiter , TP SL TS ETC. I GET PAID ON THE 12TH, SO I WOULD LIKE A DEMO UNTIL 12/05/24 TO TEST IM WILL TOO PAY 60 USD FOR THE LONG WAIT
ICT, SMC, PAMETNI NOVAC KONCEPTI, PAMETNI NOVAC, koncept pametnog novca, podrška i otpor, analiza trenda, radnja cijena, tržišna struktura, blokovi naloga, BOS/CHoCH, blokovi razbijača , pomak momentuma, zona ponude i potražnje/blokovi naloga , jaka neravnoteža, HH/LL/HL/LH, jaz fer vrijednosti, FVG, Zone premije i popusta , Fibonacci retracement, OTE, Likvidnost na strani kupnje, Likvidnost na strani prodaje
The future of the traders be a good traders and patient and humble person faithful loyalty to your job and last be a professional traders and helping a dream of us how to trade and etc,,,,,,,,,,,,,,,,,🤑
Trend killer 30 - 200 USD
I Will thanks for allowing me to create and that's good for me and u thanks u very muchand I Will make a good job to work and no to scheme people
100% Automated Trading Forex Robot powered by AI (Artificial intelligence) PLUG AND PLAY NB 100% Automated Trading Forex Robot powered by AI (Artificial intelligence) PLUG AND PLAY THE ROBOT MUST ANALYSIS ITSELF AND GIVE ACCURATE SIGNALS AND EXECUTE TRADES WITH THE HELP OF AI ( ARTIFICIAL INTELLIGENCE) FOR ALL THE KING PRO ROBOT VPN SHOULD BE RENTED FROM THE MAIN ORIGINAL COPY AND THERE SHOULD BE AN OPTION FOR THEM
I have a script i will like to convert into Ninjatrader 8. I have the source codes ready, you may contact me if it is some thing you can do. I will love it to work almost the same the pine script source code provided here is the source codes attached to this offer
I am looking for a developer who can convert my Pine script code to MQ5 code. The code is for a trading strategy that I would like to use on the MetaTrader 5 platform. The code needs to be converted accurately and efficiently, with all of the original functionality preserved. The developer should have experience with both Pine script and MQ5, and should be able to provide a high-quality conversion in a timely manner
I want to create a dashboard that would show all currency pairs using my currency strength indicator, ADX, and my support and resistance indicator.I want to the job done as soon as possible

Project information

Budget
30+ USD
For the developer
27 USD