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

 

Hello, everyone.

What is the error so incomprehensible:

test on EURUSD,H1 strategy tester report not found

And how to fight it? What other report?

 
Denis Bogdanov:

Hey, everybody.

What kind of error is this strange:

test on EURUSD,H1 strategy tester report not found

And how to fight it? What report?

Hi, maybe there is an infinite loop somewhere, so the test does not reach the moment of report generation.

 

I'm having a weird time today, it says it's been completed with errors, but it's not clear what they are. It's empty.

 
Alexandr Gavrilin:

I'm having a weird time today, it says it's been completed with errors, but it's not clear what they are. It's empty.

Autovalidator tricks, run it again.
 
Alexandr Gavrilin:

I'm having a weird time today, it says it's been completed with errors, but it's not clear what they are. It's empty.

I think it's fixed.
 
Vladislav Andruschenko:
I think it's fixed.

It's definitely fixed, the robot's been tested.

 
Buying takes place at Ask price Selling takes place at 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

That's what the article says. But, isn't that the way to do it?

Buy occurs at Ask price Selling occurs at the Bid price
TakeProfit - Ask >= SYMBOL_TRADE_STOPS_LEVEL
Bid - StopLoss >= SYMBOL_TRADE_STOPS_LEVEL

Bid - TakeProfit >= SYMBOL_TRADE_STOPS_LEVEL
StopLoss - Ask >= SYMBOL_TRADE_STOPS_LEVEL

And also in the function code -


// ...

switch(type)
     {
      //--- purchase transaction
      case  ORDER_TYPE_BUY:
        {
         //--- check StopLoss
         SL_check=(Bid-SL>stops_level*_Point);
         if(!SL_check)
            PrintFormat("For order %s StopLoss=%.5f must be less than %.5f"+
                        " (Bid=%.5f - SYMBOL_TRADE_STOPS_LEVEL=%d points)",
                        EnumToString(type),SL,Bid-stops_level*_Point,Bid,stops_level);
         //--- check TakeProfit
         TP_check=(TP-Ask>stops_level*_Point);
         if(!TP_check)
            PrintFormat("For order %s TakeProfit=%.5f must be greater than %.5f"+
                        " (Bid=%.5f + SYMBOL_TRADE_STOPS_LEVEL=%d points)",
                        EnumToString(type),TP,Bid+stops_level*_Point,Bid,stops_level);
         //--- return the result of the check
         return(SL_check&&TP_check);
        }
      //--- sale transaction
      case  ORDER_TYPE_SELL:
        {
         //--- check StopLoss
         SL_check=(SL-Ask>stops_level*_Point);
         if(!SL_check)
            PrintFormat("For order %s StopLoss=%.5f must be greater than %.5f "+
                        " (Ask=%.5f + SYMBOL_TRADE_STOPS_LEVEL=%d points)",
                        EnumToString(type),SL,Ask+stops_level*_Point,Ask,stops_level);
         //--- check TakeProfit
         TP_check=(Bid-TP>stops_level*_Point);
         if(!TP_check)
            PrintFormat("For order %s TakeProfit=%.5f must be less than %.5f "+
                        " (Ask=%.5f - SYMBOL_TRADE_STOPS_LEVEL=%d points)",
                        EnumToString(type),TP,Ask-stops_level*_Point,Ask,stops_level);
         //--- return the result of the check
         return(TP_check&&SL_check);
        }
      break;
     }

// ...

???

If we do as in the article we just lose points from the spread in profit! Maybe I don't understand something?

 
Oleg Arsentev #:
Buying takes place at Ask price Selling takes place at 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

That's what the article says. But, isn't that the way to do it?

Buy occurs at Ask price Selling occurs at Bid price
TakeProfit - Ask >= SYMBOL_TRADE_STOPS_LEVEL
Bid - StopLoss >= SYMBOL_TRADE_STOPS_LEVEL

Bid - TakeProfit >= SYMBOL_TRADE_STOPS_LEVEL
StopLoss - Ask >= SYMBOL_TRADE_STOPS_LEVEL

And also in the function code -


???

If we do as in the article we just lose points from the spread in profit! Maybe I don't understand something?

We lose profit, of course. But it is impossible to put stops closer:

Therefore, TakeProfit and StopLoss levels should be compared with the current price, at which it is possible to make an operation of the opposite direction:

  • Buy is made at Ask price - TakeProfit and StopLoss levels should be compared with the current selling price Bid.
  • Selling is made at the Bid price - TakeProfit and StopLoss levels should be compared with the current Ask price.
[Deleted]  
Half of the robots on the Market are not working.
 
dryun777 #:
Half of the robots on the market are not working.

This is an article for those who write EAs. You need articles from the "How to Test" series.