validation issues

 

any help?

i get this message during validation


when i run the same code in my mt4, it places the trades without errors errors

 


is there any issues with my code?

   bool tradeManager(string orderType, double orderEntry, double orderSL) // manages trades and orders
  {
   bool result = false;
   double tickSize = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE);
   orderEntry = round(orderEntry/ tickSize) * tickSize;
   orderSL = round(orderSL/ tickSize) * tickSize;


         double max_volume=SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_LIMIT);
         double current_lots=getAllVolume();

         if(orderType=="buy")
           {
            double buyOrderTP = orderEntry + ((orderEntry-orderSL)*rr);
            buyOrderTP = round(buyOrderTP / tickSize) * tickSize;

            double buyLot = NormalizeDouble(CalcPositionSize(riskPer, commissionLot, orderSL, orderEntry), 2);

            if(max_volume>0 && max_volume-current_lots-buyLot<=0)
               return false;

            if(!CheckMoneyForTrade(_Symbol, buyLot, OP_BUY))
               return false;

            if(!CheckStopLoss_Takeprofit(ORDER_TYPE_BUY_STOP, orderEntry, orderSL, buyOrderTP))
               return false;

            result = OrderSend(_Symbol, OP_BUYSTOP, buyLot, orderEntry, 0, orderSL, buyOrderTP, "FVG");
           }

         if(orderType=="sell")
           {
            double sellOrderTP = orderEntry - ((orderSL-orderEntry)*rr);
            sellOrderTP = round(sellOrderTP / tickSize) * tickSize;

            double sellLot = NormalizeDouble(CalcPositionSize(riskPer, commissionLot, orderSL, orderEntry), 2);

            if(max_volume>0 && max_volume-current_lots-sellLot<=0)
               return false;

            if(!CheckMoneyForTrade(_Symbol, sellLot, OP_SELL))
               return false;

            if(!CheckStopLoss_Takeprofit(ORDER_TYPE_SELL_STOP, orderEntry, orderSL, sellOrderTP))
               return false;

            result = OrderSend(_Symbol, OP_SELLSTOP, sellLot, orderEntry, 0, orderSL, sellOrderTP, "FVG");
           }
   return result;
  }
//-------------------------------------------------------------------------------------------------------------------------------------
bool CheckStopLoss_Takeprofit(ENUM_ORDER_TYPE type, double open, double StopLoss, double TakeProfit)
  {
   int stops_level=(int)SymbolInfoInteger(_Symbol,SYMBOL_TRADE_STOPS_LEVEL);
   int freezeLevel = (int)SymbolInfoInteger(_Symbol, SYMBOL_TRADE_FREEZE_LEVEL);
//---
   bool SL_check=false,TP_check=false, freezeCheck=false;
   RefreshRates();

   switch(type)
     {
      case  ORDER_TYPE_BUY_STOP:
        {
         SL_check=(open-StopLoss>stops_level*_Point);
         TP_check=(TakeProfit-open>stops_level*_Point);
         freezeCheck = ((open-Ask)>freezeLevel*_Point);

         return(SL_check&&TP_check&&freezeCheck);
        }

      case  ORDER_TYPE_SELL_STOP:
        {
         SL_check=(StopLoss-open>stops_level*_Point);
         TP_check=(open-TakeProfit>stops_level*_Point);
         freezeCheck = ((Bid-open)>freezeLevel*_Point);

         return(TP_check&&SL_check&&freezeCheck);
        }
      break;
     }

   return false;
  }
 

The "error 130" was discussed many times -

Forum on trading, automated trading systems and testing trading strategies

Product Validation Error

Fernando Carreiro, 2023.04.22 15:52

Please do a search before you post. Error 130 has been discussed hundreds of times — https://www.mql5.com/en/search#!keyword=error%20130&module=mql5_module_forum

You should also read the Market Rules and follow-up on the links provided:

V. Product Testing

  1. Products offered through the Market service are subject to automatic pre-testing. The necessary requirements are described in the articles "The checks a trading robot must pass before publication in the Market" and "Tips for an effective product presentation on the Market".

...

Rules of Using the Market Service
Rules of Using the Market Service
  • www.mql5.com
General Provisions and Conditions of Use service Market
 
            double sellOrderTP = orderEntry - ((orderSL-orderEntry)*rr);

You buy at the Ask and sell at the Bid. Pending Buy Stop orders become market orders when hit by the Ask.

  1. Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid / OrderClosePrice reaches it. Using Ask±n, makes your SL shorter and your TP longer, by the spread. Don't you want the specified amount used in either direction?

  2. Your sell order's TP/SL (or Buy Stop's/Buy Limit's entry) will be triggered when the Ask / OrderClosePrice reaches it. To trigger close at a specific Bid price, add the average spread.
              MODE_SPREAD (Paul) - MQL4 programming forum - Page 3 #25

  3. The charts show Bid prices only. Turn on the Ask line to see how big the spread is (Tools → Options (control+O) → charts → Show ask line.)

    Most brokers with variable spreads widen considerably at end of day (5 PM ET) ± 30 minutes.
    My GBPJPY shows average spread = 26 points, average maximum spread = 134.
    My EURCHF shows average spread = 18 points, average maximum spread = 106.
    (your broker will be similar).
              Is it reasonable to have such a huge spreads (20 PIP spreads) in EURCHF? - General - MQL5 programming forum (2022)