Discussion of article "The checks a trading robot must pass before publication in the Market" - page 7

 
D Armond Lee Speers #: I have several EAs that I have written that provide a kind of dashboard of open trades and provide options for the user to close trades, do partial closes, etc.

Those too should be classified as "Utilities".

Have you never noticed that in the Market, that the "Utilities" section includes Dashboards, and Trade Assistants, etc.?

 
Fernando Carreiro #:

Those too should be classified as "Utilities".

Have you never noticed that in the Market, that the "Utilities" section includes Dashboards, and Trade Assistants, etc.?

I had not really put much thought to it, but no, I hadn't noticed that there were utilities that were technically EAs but not categorized as EAs in the market.  

Thank you for clarifying!

 
I have got issue then modified my ea now how to resubmit for verification?
 

2019.03.13 02:46:14 failed instant sell 0.2 XAUUSD at 1304.17, close #2 buy 0.2 XAUUSD 1304.11

please assist me with this error. how do I solution this?


 
Itumeleng Mohlouwa Kgotso Tladi #: 2019.03.13 02:46:14 failed instant sell 0.2 XAUUSD at 1304.17, close #2 buy 0.2 XAUUSD 1304.11. please assist me with this error. how do I solution this?

You posted in the wrong section, so I moved your post. Your question is about MQL5, not MQL4.

The answer is here on this very thread. Read it, as well as the main article, and apply it to your code.

Articles

The checks a trading robot must pass before publication in the Market

MetaQuotes, 2016.08.01 09:30

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.
 

There was an error in the check_freezelevel.mq5 file code (line 140) missing the `if(!TP_check)` statement

bool CheckPositionForFREEZE_LEVEL(ulong ticket)
  {
//--- get the SYMBOL_TRADE_FREEZE_LEVEL level
   int freeze_level=(int)SymbolInfoInteger(_Symbol,SYMBOL_TRADE_FREEZE_LEVEL);
   if(freeze_level!=0)
     {
      PrintFormat("SYMBOL_TRADE_FREEZE_LEVEL=%d: Cannot modify order"+
                  "  nearer than %d points from the activation price",freeze_level,freeze_level);
     }
//--- select position for working
   if(!PositionSelectByTicket(ticket))
     {
      //--- failed to select position
      return(false);
     }
//--- get the order data     
   ENUM_POSITION_TYPE pos_type=(ENUM_POSITION_TYPE)PositionGetInteger(POSITION_TYPE);
   double sl=PositionGetDouble(POSITION_SL);
   double tp=PositionGetDouble(POSITION_TP);
//--- result of checking StopLoss and TakeProfit
   bool SL_check=false,TP_check=false;
//--- position type
   switch(pos_type)
     {
      //--- buy
      case POSITION_TYPE_BUY:
        {
         SL_check=(Bid-sl>freeze_level*_Point);
         if(!SL_check)
            PrintFormat("Position %s #%d cannot be modified: Bid-StopLoss=%d points"+
                        " < SYMBOL_TRADE_FREEZE_LEVEL=%d points)",
                        EnumToString(pos_type),ticket,(int)((Bid-sl)/_Point),freeze_level);
         TP_check=(tp-Bid>freeze_level*_Point);
         if(!TP_check)
            PrintFormat("Position %s #%d cannot be modified: TakeProfit-Bid=%d points"+
                        " < SYMBOL_TRADE_FREEZE_LEVEL=%d points)",
                        EnumToString(pos_type),ticket,(int)((tp-Bid)/_Point),freeze_level);
         //--- return the result of checking
         return(SL_check&&TP_check);
        }
      break;
      //--- sell
      case POSITION_TYPE_SELL:
        {
         SL_check=(sl-Ask>freeze_level*_Point);
         if(!SL_check)
            PrintFormat("Position %s cannot be modified: StopLoss-Ask=%d points"+
                        " < SYMBOL_TRADE_FREEZE_LEVEL=%d points)",
                        EnumToString(pos_type),(int)((sl-Ask)/_Point),freeze_level);
         TP_check=(Ask-tp>freeze_level*_Point);
         PrintFormat("Position %s cannot be modified: Ask-TakeProfit=%d points"+
                     " < SYMBOL_TRADE_FREEZE_LEVEL=%d points)",
                     EnumToString(pos_type),(int)((Ask-tp)/_Point),freeze_level);
         //--- return the result of checking
         return(SL_check&&TP_check);
        }
      break;
     }
//--- position did not pass the check
   return (false);
  }
 
Hello, My EA trades based on news events and it doesn't work in the strategy tester but it is profitable in the live account. Will my EA not working in the tester make it fail the market validation
 

In general, checking the TakeProfit and StopLoss levels with the minimum distance of SYMBOL_TRADE_STOPS_LEVEL taken into account looks as follows:

  • Buying is done at the Ask price — the TakeProfit and StopLoss levels must be at the distance of at least SYMBOL_TRADE_STOPS_LEVEL points from the Bid price.
  • Selling is done at the Bid price — the TakeProfit and StopLoss levels must be at the distance of at least SYMBOL_TRADE_STOPS_LEVEL points from the Ask price.
Buying is done at the Ask price
Selling is done at the Bid price
TakeProfit - Bid >= SYMBOL_TRADE_STOPS_LEVEL
Bid - StopLoss >= SYMBOL_TRADE_STOPS_LEVEL
Ask - TakeProfit >= SYMBOL_TRADE_STOPS_LEVEL
StopLoss - Ask >= SYMBOL_TRADE_STOPS_LEVEL



Can someone please explain the doubt that I'm having?

I understand that buying is done on the ask price, and selling is done on the bid price. I also can understand why we're using bid price to compare when buying for stop loss and take profit (because we'll be taking the opposite trade, selling, thus bid price).

However, I don't understand why the take profit doesn't also get compared to the ask price when buying, because if we only compare it to the bid price, user could potentially set the value higher than the bid price but lower than the ask price, which totally doesn't make any sense?

Thanks for your time.

 

Hi,

my EA is declined because the validation reports "no trading activities". As my EA is designed to trade at a specific news date I would need to know what historical data is used during EA validation. Then I coudl provide a default date for validation purposes.

Thanks in advance

Tim

 
@Tim Arthur Herbert Kasprzyk #: my EA is declined because the validation reports "no trading activities". As my EA is designed to trade at a specific news date I would need to know what historical data is used during EA validation. Then I coudl provide a default date for validation purposes.

It seems you did not read this topic before posting ...

Forum on trading, automated trading systems and testing trading strategies

Discussion of article "The checks a trading robot must pass before publication in the Market"

Fernando Carreiro, 2022.12.24 18:46

As per the Market product rules, you are not allowed to restrict or limit your EA to a single symbol. Your EA must work for all symbols, even if its intended use is for a single symbol.

Forum on trading, automated trading systems and testing trading strategies

Discussion of article "The checks a trading robot must pass before publication in the Market"

Fernando Carreiro, 2023.03.27 01:50

You are not allowed to limit your EA in any way. It must be able to trade on anything an everything, even if it was designed for indices. Please read the Market rules.

Forum on trading, automated trading systems and testing trading strategies

Discussion of article "The checks a trading robot must pass before publication in the Market"

Fernando Carreiro, 2023.06.01 13:15

Your EA must be able to trade on all symbols and all time-frames. There must be no limitations.

To reduce your log size, consider ...

  • Reducing the number of "prints" statements to the log output
  • Using a trailing-step or time-step instead of continuous trailing stops.
  • Don't continuously create and delete pending orders. Consider using "virtual" pending orders.
Reason: