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

 
Sergei Stakhanov:
Good afternoon, fellow traders! I want to add an Expert Advisor to the market, it was written by my friend, I have it in open source. When I add it, I get this error. Can anyone tell me if it is realistic to fix it for a person who is not very knowledgeable in programming and how hard it is to remove? Thanks in advance, profits to all!

This error can be fixed in three minutes. If you were at least a little knowledgeable, you would just say it in words. In your case, you need to see the code to add what you need in the right place.
However, I'll try to give you a hint without the code.
1. Find where the modification function is located in your code.
2. Find the line that specifies the TP or SL level for modification
3. Add (approximately) the following:

if(OrderTakeProfit()>0 && tp==OrderTakeProfit()) return(true);

// and/or

if(sl==OrderStopLoss()) return(true);

/*
The variables being compared must be normalised. 
I removed normalisation here so as not to clutter the code.
*/
You can use only an idea from these code fragments, you probably have a different code structure and other variable names.
The essence of the check is simple:
- compare TP or SL levels with the existing ones. If the levels are the same - exit without modification.
The error will disappear.


Instead of normalising variables, it is better to use this construct:
.
if(MathAbs(tp-OrderTakeProfit())<1*Point) return(true);
Translated into Russian this means:
"If the difference between the TP (or SL) price set for modification and the existing one on the deal is less than 1 pip - exit without doing anything"
.
 
test on EURUSD,H1 (netting)
strategy tester report 13 total trades
test on XAUUSD,D1 (netting)
 2020.02.20 17:00:37   failed cancel order #260  sell stop 0.6 XAUUSD at 1616.33 [Invalid stops]
 2020.02.20 18:03:40   failed cancel order #332  sell stop 0.6 XAUUSD at 1618.98 [Invalid stops]
 2020.02.25 13:57:55   failed cancel order #847  sell stop 0.6 XAUUSD at 1644.53 [Invalid stops]
 2020.02.25 14:11:30   failed cancel order #881  sell stop 0.6 XAUUSD at 1646.65 [Invalid stops]
 2020.02.25 16:03:15   failed cancel order #972  sell stop 0.6 XAUUSD at 1651.10 [Invalid stops]
 2020.02.25 17:22:41   failed cancel order #1007  sell stop 0.6 XAUUSD at 1652.99 [Invalid stops]
 2020.02.25 17:52:40   failed cancel order #1070  sell stop 0.6 XAUUSD at 1655.53 [Invalid stops]
strategy tester report 458 total trades

Good afternoon colleagues, how do you get around such errors?

The postponement is set, I understand that problems arise when trying to cancel it. I cannot reproduce it in the tester.

 
Alexandr Gavrilin:

Good afternoon colleagues, how do you get around such errors?

The postponement is set, I understand that problems arise when trying to cancel it. I cannot reproduce it in the tester.

You can do anything in the tester! To do this you need to use the magic button and edit the symbol: Stops level, Freeze level....

 
Vladimir Karputov:

You can do anything in the tester! To do this you need to use the magic button and edit the symbol: Stops level, Freeze level ....

live and learn. I'll be aware of that.

 
My indicator is heat map for deriv syntethic index like volatility index and boom crash and test report showing faild test on eurusd my indicator is just for showing trend strength of trend I don't know why they test on eurusd I attached the discrption and screen shot but still fail
 

Hello.

What kind of error is this?

has anyone encountered it?

Added

Now this is like this

Is there any functions to check this?

Added

Now such a thing

Added

banned gold trading

if(_Symbol=="XAUUSD")return;

and bypassed the autovalidator


 
Denis Nikolaev:

Hello.

What kind of error is this?

has anyone encountered it?

you traded gold on the first tick of the day at a crooked price ?? the robot forgot that there is a stop and re-closed again ???

Switch on the terminal and trade with your hands, it helps a lot.

 
Maxim Kuznetsov:

you traded gold on the first tick of the day at a crooked price ?? the robot forgot there was a stop and re-closed ???

switch on the terminal and trade with your hands, it helps a lot.

thanks, but how to deal with errors?

add special mode "only_autovalidation"?

 
Denis Nikolaev:

Thanks, but how do you deal with the errors?

add a special mode "only_autovalidation"?

The "check disk space" is obviously dealt with by increasing the disc or decreasing the tested range. It says so right there...

 
Maxim Kuznetsov:

The "check disk space" is obviously dealt with by increasing the disc or decreasing the tested range. It says so right there....

I'm sorry, it's understandable, that's why we need a special mode only for autovalidation.