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

Auftrag beendet

Ausführungszeit 20 Sekunden
Bewertung des Kunden
Great guy. Thanks a lot man
Bewertung des Entwicklers
Thanks for the fair business.

Spezifikation

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


Bewerbungen

1
Entwickler 1
Bewertung
(70)
Projekte
86
33%
Schlichtung
7
86% / 0%
Frist nicht eingehalten
0
Überlastet
2
Entwickler 2
Bewertung
(167)
Projekte
215
57%
Schlichtung
8
25% / 25%
Frist nicht eingehalten
7
3%
Arbeitet
3
Entwickler 3
Bewertung
(4)
Projekte
7
14%
Schlichtung
1
0% / 100%
Frist nicht eingehalten
0
Frei
4
Entwickler 4
Bewertung
(7)
Projekte
11
18%
Schlichtung
6
50% / 0%
Frist nicht eingehalten
1
9%
Arbeitet
5
Entwickler 5
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
6
Entwickler 6
Bewertung
(2)
Projekte
3
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
7
Entwickler 7
Bewertung
(184)
Projekte
188
27%
Schlichtung
0
Frist nicht eingehalten
3
2%
Frei
8
Entwickler 8
Bewertung
(52)
Projekte
96
24%
Schlichtung
9
22% / 22%
Frist nicht eingehalten
12
13%
Frei
9
Entwickler 9
Bewertung
(66)
Projekte
143
34%
Schlichtung
11
9% / 55%
Frist nicht eingehalten
26
18%
Arbeitet
Ähnliche Aufträge
Hello, I need a custom made strategy that can be turned into a bot. The strategy needs to make at least 10-20% return per month. The strategy needs to have very very low max and relative drawdown of max 2-4% and also a drawdown limiter function. The bot/strategy should be able to pass prop firm challenges and trade on the live funded account. The strategy needs to be automated into a bot (EA) and have the ability to
"I'm seeking a skilled coder to assist in developing my custom Ninjatrader 8 strategy, ensuring flawless functionality without errors. Your expertise is essential for this project. Please contact me to discuss further details and proceed."
I'm only seeking experienced developers who have successfully completed projects similar to this. I require someone to develop a copy-trading system that can execute trades on clients' mt4/mt5 upon my posting on platforms like Telegram or spreadsheets . Additionally, I need a feature for tracking and recording the trading signals that I send. I'll provide further details and examples during our discussion
DJANGO EA 30 - 1000 USD
I need smart, professional, and fast programmer for doing this project quickly, that have experience in EA with minimum 500 projects finish, and have good review and reputation from their client Share your link review, if you not qualified, dont apply! I will bidding the programmer from experience, review, reputation, price, and days working My EA using Moving Average, Average True Range, and using consecutives
I need smart, professional, and fast programmer for doing this project quickly, that have experience in EA with minimum 500 projects finish, and have good review and reputation from their client Share your link review, if you not qualified, dont apply! I will bidding the programmer from experience, review, reputation, price, and days working My EA using Moving Average, Average True Range, and using consecutives
I am looking for a coder to code my custom Ninjatrader 8 strategy to make it work perfectly your professioalism is needed in the project Kindly cotact me now and let Proceed
I am looking for a coder to help me code my custom Ninjatrader 8 strategy and make it work perfectly without any error, your expertise is highly needed in this job kindly reach out to me and let proceed
I need a professional or expert who is a trader and also know about coding that can quote a profitable strategy and code the strategy for me in MT4 with my specification, If you are capable of doing this I will be glad to share my requirement with you to get started
I am looking for a developer to code my custom Ninjatrader 8 strategy and make it work perfectly, your expertise is highly needed for this project kindly reach out and let's proceed
Hello I am looking for a professional in building a stock trading robot and make it work perfectly Specifically, I want to build a robot for trading in options from the IOF your expertise is highly needed in this project Kindly reach out and let proceed

Projektdetails

Budget
30+ USD
Für die Entwickler
27 USD