Suggested solution snippet for "Invalid Stops" error

 
                         /// Parameters section
                         ...... 
                        input double paramStopLossPoints   = 20;
                        input double paramTakeProfitPoints = 40;

                         ...... 
                         void OnTick() {

                         ...... 

                        double OurLotSize  = 0.01;
                        string OurComment  = "GoldBond";
                        long OurMagicNumber = 1453535434253;
                        color bullColor = Green;
                        double brokerStopLevel = SymbolInfoInteger(Symbol(), SYMBOL_TRADE_FREEZE_LEVEL) * Point;
                        int acceptableSlippage = (Digits == 5)?10:3;
                        double ourStopLoss     = paramStopLossPoints   * Point;
                        double ourTakeProfit   = paramTakeProfitPoints * Point;
                        double longBreakoutPrice = High[1] + 15 * Point;
                        double entryPrice = MathMax(Ask + brokerStopLevel, longBreakoutPrice) + Point;
                        ordTicket = OrderSend(Symbol(), OP_BUYSTOP, OurLotSize
                                , entryPrice, acceptableSlippage
                                , MathMin(entryPrice - brokerStopLevel, Low [1] - ourStopLoss)
                                , MathMax(entryPrice + brokerStopLevel, High[1] + ourTakeProfit)
                                , OurComment, OurMagicNumber, 0, bullColor);

                         ...... 

                         }

 
sammcdj:


Check here

The checks a trading robot must pass before publication in the Market
The checks a trading robot must pass before publication in the Market
  • www.mql5.com
Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by developers in their technical indicators and trading robots. An also shows how to self-test a product before sending it to the Market.
 
sammcdj:


If you can post what is written in the Expert tab here, an easier solution can be found.

  
                        input double paramStopLossPoints   = 20;
                        input double paramTakeProfitPoints = 40;

                         ...... 
                         void OnTick() {

                         ...... 

                        double OurLotSize  = 0.01;
                        string OurComment  = "GoldBond";
                        long OurMagicNumber = 1453535434253;
                        color bullColor = Green;
                        double brokerStopLevel = SymbolInfoInteger(Symbol(), SYMBOL_TRADE_FREEZE_LEVEL) * Point;
                        int acceptableSlippage = (Digits == 5)?10:3;
                        double ourStopLoss     = paramStopLossPoints   * Point;
                        double ourTakeProfit   = paramTakeProfitPoints * Point;
                        double longBreakoutPrice = High[1] + 15 * Point;
                        double entryPrice = MathMax(Ask + brokerStopLevel, longBreakoutPrice) + Point;
                        ordTicket = OrderSend(Symbol(), OP_BUYSTOP, OurLotSize
                                , entryPrice, acceptableSlippage
                                , MathMin(entryPrice - brokerStopLevel, Low [1] - ourStopLoss)
                                , MathMax(entryPrice + brokerStopLevel, High[1] + ourTakeProfit)
                                , OurComment, OurMagicNumber, 0, bullColor);
                       Print(" Price " , entryPrice, " Slipage ", acceptableSlippage
                                , " Stop ",MathMin(entryPrice - brokerStopLevel, Low [1] - ourStopLoss)
                                ," TP ", MathMax(entryPrice + brokerStopLevel, High[1] + ourTakeProfit)
                       
                       }         

                         ...... 

                         }